feat(github): support payload field on Deployment notifications#451
Open
aydabd wants to merge 3 commits into
Open
feat(github): support payload field on Deployment notifications#451aydabd wants to merge 3 commits into
aydabd wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
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
GitHubDeploymentto include apayloadfield. - Template and render the deployment payload alongside existing deployment fields.
- Document the new
payloadoption 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.
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
29a38d8 to
0aaad3c
Compare
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>
0aaad3c to
d9a2069
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a templated
Payloadfield onGitHubDeploymentso trigger templates can carry deploy-time metadata (image tag, build id, etc.) into the GitHub deployment record. The field maps to GitHub'sCreateDeploymentAPIpayloadparameter — a JSON text the API explicitly exposes for this purpose, today silently dropped by notifications-engine.Why
Downstream consumers of the
deployment_statusevent (workflows, Slack handlers, audit tooling) often need to know what was deployed (image tag, immutable artifact id). Without a templatedpayload, the field is always{}and consumers have to fall back to indirect lookups (e.g.git tag --points-at <sha>).Changes
Payload stringtoGitHubDeployment.GetTemplater.DeploymentRequest.Payloadwhen present.TestGetTemplater_GitHub_Deploymentto cover templated payload rendering.docs/services/github.md.Example
Closes #443