Skip to content

feat(github): support payload field on Deployment notifications#451

Open
aydabd wants to merge 3 commits into
argoproj:masterfrom
aydabd:feat/github-deployment-payload
Open

feat(github): support payload field on Deployment notifications#451
aydabd wants to merge 3 commits into
argoproj:masterfrom
aydabd:feat/github-deployment-payload

Conversation

@aydabd

@aydabd aydabd commented Jun 1, 2026

Copy link
Copy Markdown

Summary

Add a templated Payload field on GitHubDeployment so trigger templates can carry deploy-time metadata (image tag, build id, etc.) into the GitHub deployment record. The field maps to GitHub's CreateDeployment API payload parameter — a JSON text the API explicitly exposes for this purpose, today silently dropped by notifications-engine.

Why

Downstream consumers of the deployment_status event (workflows, Slack handlers, audit tooling) often need to know what was deployed (image tag, immutable artifact id). Without a templated payload, the field is always {} and consumers have to fall back to indirect lookups (e.g. git tag --points-at <sha>).

Changes

  • Add Payload string to GitHubDeployment.
  • Parse and execute the field as a Go template in GetTemplater.
  • Pass the rendered string to DeploymentRequest.Payload when present.
  • Extend TestGetTemplater_GitHub_Deployment to cover templated payload rendering.
  • Document the new field in docs/services/github.md.

Example

template.app-deployed: |
  github:
    repoURLPath: "{{.app.spec.source.repoURL}}"
    revisionPath: "{{.app.status.operationState.syncResult.revision}}"
    deployment:
      state: success
      environment: production
      payload: |
        {"image": "registry/app:{{.app.status.sync.revision}}"}

Closes #443

Copilot AI review requested due to automatic review settings June 1, 2026 08:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds support for providing a templated payload in GitHub deployment notifications and passing it through to GitHub’s Create Deployment API.

Changes:

  • Extend GitHubDeployment to include a payload field.
  • Template and render the deployment payload alongside existing deployment fields.
  • Document the new payload option and add a unit test assertion for payload templating.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
pkg/services/github.go Adds Payload to deployment model, templates it, and forwards it into github.DeploymentRequest.
pkg/services/github_test.go Extends templater test to cover payload rendering.
docs/services/github.md Documents new payload configuration for GitHub deployments.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/services/github.go Outdated
Comment thread docs/services/github.md Outdated
Comment thread pkg/services/github.go
@codecov

codecov Bot commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.47059% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.13%. Comparing base (da04400) to head (d83fe76).
⚠️ Report is 37 commits behind head on master.

Files with missing lines Patch % Lines
pkg/services/github.go 76.47% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #451      +/-   ##
==========================================
+ Coverage   55.41%   58.13%   +2.71%     
==========================================
  Files          46       49       +3     
  Lines        4125     3791     -334     
==========================================
- Hits         2286     2204      -82     
+ Misses       1511     1222     -289     
- Partials      328      365      +37     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aydabd aydabd force-pushed the feat/github-deployment-payload branch from 29a38d8 to 0aaad3c Compare June 1, 2026 08:36
GitHub's CreateDeployment API accepts an optional payload (JSON text)
for any extra information a deployment system needs to pass through.
notifications-engine currently drops this field, leaving payload={}
on every deployment. Add a templated Payload field on GitHubDeployment
so trigger templates can carry deploy-time metadata (image tag, build
id, etc.) into the deployment_status event downstream consumers see.

Closes argoproj#443

Signed-off-by: aydabd <ayd.abd@gmail.com>
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.

Support payload field on GitHub Deployment notifications

2 participants