Open bradgwest opened 11 months ago
Only the last template specified in a trigger will be sent when using the github service. I'm not sure if this behavior extends to other services.
github
Consider the following config. Note that two templates are specified in the "send" clause of the on-deployed trigger.
trigger.on-deployed: | - description: Application successfully deployed send: [app-deployed, app-config-deployed] when: app.status.operationState.phase in ['Succeeded'] and app.status.health.status == 'Healthy' template.app-deployed: | message: | Successfully deployed `{{.app.metadata.name}}`. github: repoURLPath: '{{((first .app.status.sync.comparedTo.sources).repoURL)}}' revisionPath: "{{(first .app.status.sync.revisions)}}" status: state: success label: "continuous-delivery/{{.app.metadata.labels.environment}}/{{.app.metadata.name}}" targetURL: "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true" template.app-config-deployed: | message: | Successfully deployed `{{.app.metadata.name}}` with this config. github: repoURLPath: "git:github.com:org/config.git" revisionPath: "{{(last (last .app.status.history).revisions)}}" status: state: success label: "continuous-delivery/{{.app.metadata.labels.environment}}/{{.app.metadata.name}}" targetURL: "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"
Only the app-config-deployed notification will be sent. The service quietly fails to send app-deployed. Not even a debug log is emitted.
app-config-deployed
app-deployed
send
notifications-engine@v0.4.1-0.20230620204159-3446d4ae8520
info: Trigger on-deployed result: [{[0].y7b5sbwa2Q329JYH755peeq-fBs [app-deployed app-config-deployed] true}] info: Sending notification about condition 'on-deployed.[0].y7b5sbwa2Q329JYH755peeq-fBs' to '{github }' debug: Sending request: POST /app/installations/redacted/access_tokens <redacted> debug: msg="Received response: HTTP/2.0 201 Created <redacted> debug: msg="Sending request: POST /repos/org/config/statuses/17b9362483179c29dfb79a5aa4bc7b41e01a229f <redacted> debug: msg="Received response: HTTP/2.0 201 Created\r <redacted> debug: Notification was sent
Summary
Only the last template specified in a trigger will be sent when using the
github
service. I'm not sure if this behavior extends to other services.Observed Behavior
Consider the following config. Note that two templates are specified in the "send" clause of the on-deployed trigger.
Only the
app-config-deployed
notification will be sent. The service quietly fails to sendapp-deployed
. Not even a debug log is emitted.Expected Behavior
send
configuration of the trigger to be sent.Version
Logs