Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat-notification: Notification conversion step for harness #251

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

vanisrikanithi
Copy link
Contributor

Notification go-conversion:
Added "Notification" support to go-convert specific to jenkins migration.

Norification Jenkins Trace:

vani_notification__18.json

go run main.go jenkinsjson --downgrade ~/go/vani_notification__18.json

Harness Notification Pipeline is here.

Notification harness pipeline step:

- step:
    identifier: notifyendpointsca9fc8
    name: Notification
    spec:
      image: plugins/webhook
      settings:
        content_type: application/json
        debug: "true"
        method: <+input>
        password: <+input>
        template: '{"status": "Build Successful", "job": "${env.JOB_NAME}", "buildNumber": "${env.BUILD_NUMBER}"}'
        urls: <+input>
        username: <+input>
    timeout: ""
    type: Plugin

@vanisrikanithi
Copy link
Contributor Author

Hello @Ompragash ,

Could you please review the Notification conversion PR and provide your comments if there are any?

Thank you.

Copy link
Member

@Ompragash Ompragash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like the template value is being formatted with a newline, which will throw an error in Harness. To fix this, ensure the template value is on a single line in the generated YAML. Once fixed, the changes can be merged

              identifier: Stage_null87edb4
              name: Notify
              steps:
              - step:
                  identifier: notifyendpointsca9fc8
                  name: Notification
                  spec:
                    image: plugins/webhook
                    settings:
                      content_type: application/json
                      debug: "true"
                      method: <+input>
                      password: <+input>
                      template: '{"status": "Build Successful", "job": "${env.JOB_NAME}",
                        "buildNumber": "${env.BUILD_NUMBER}"}'
                      urls: <+input>
                      username: <+input>
                  timeout: ""
                  type: Plugin

@vanisrikanithi
Copy link
Contributor Author

@Ompragash, YAML serializers typically have a default line length limit. If the string exceeds this limit, the serializer splits it into multiple lines.

Happy Path: I have copied the conversion step and pasted it in harness yaml, once I save the yaml it is automatically formatting the template.
Harness Test Pipeline

Could you please check it and confirm the changes?

@Ompragash Ompragash marked this pull request as draft December 3, 2024 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants