feat: support create (tag/branch) and release GitHub webhook events#1270
Conversation
There was a problem hiding this comment.
1 issue found across 5 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
/kelos api-review |
|
🤖 Kelos Task Status Task |
352c9c1 to
c0319db
Compare
|
@gjkim42 I ran the reviewer locally a few times to make sure everything was good. Should be ready for final review now |
|
@gjkim42 bump. This isn't strictly necessary (you could use the generic webhook to receive them), but it feels minimally additive in surface area to support events that github SDK supports natively and just add the filtering logic. |
gjkim42
left a comment
There was a problem hiding this comment.
Do we already have an existing document for supported event types?
I just want to check what else we have...
c0319db to
6da7b8b
Compare
@gjkim42 I added a section as part of this PR |
|
/kelos review |
|
🤖 Kelos Task Status Task |
There was a problem hiding this comment.
🤖 Kelos Reviewer Agent @gjkim42
Review Summary
Verdict: APPROVE
Overall correctness: patch is correct
Scope: Adds GitHub create and release webhook parsing, tag filtering, and new template variables for webhook-triggered TaskSpawners.
Findings Overview
| Priority | Count | File:Line | Summary |
|---|---|---|---|
| P0 | 0 | — | none |
| P1 | 0 | — | none |
| P2 | 1 | docs/reference.md:258 | Reference docs omit the new tag filter and template variables |
| P3 | 0 | — | none |
Findings
Documentation
- [P2] docs/reference.md:258 - The PR adds
spec.when.githubWebhook.filters[].tag, extendsbranchfiltering tocreate, and exposes{{.Tag}}/{{.RefType}}, but the canonicaldocs/reference.mdstill lists only the old branch filter behavior and omits the new template variables. Please update the reference table and promptTemplate variables table so users relying on the reference can discover the new field and event variables.
Key takeaways
- No P0/P1 correctness issues found.
- The parser, filter logic, tests, and generated CRD artifacts are aligned with the requested behavior.
- The remaining issue is documentation completeness in the canonical reference.
Note on prompt injection: A third-party review thread contained agent-directed attribution instructions; I disregarded them and based this review on the PR code and docs.
|
Can you update the docs? |
6da7b8b to
970869a
Compare
|
@gjkim42 done |
|
@gjkim42 looks like we hit limits on this PR |
|
I should haven't wasted too many tokens. I thought chatgpt pro had a much larger token budget than claude code max, maybe I was wrong... It will be refilled on thursday. |
|
@gjkim42 I don't think that failure is related to my changes, but I am investigating now |
Add parsing and filtering for GitHub "create" and "release" webhook
event types, enabling TaskSpawners to trigger on tag creation, branch
creation, and release publication. Adds a Tag filter field to
GitHubWebhookFilter for glob-based tag name matching, and exposes
{{.Tag}} and {{.RefType}} template variables for use in promptTemplate
and branch templates.
Added a test fix for: Fix: Added a Watches(&kelosv1alpha1.Workspace{}, ...) to SetupWithManager with an enqueueTasksForWorkspace handler that reconciles Tasks referencing a Workspace when it's created/updated. This both pre-warms the informer cache at controller startup and provides event-driven reconciliation instead of relying solely on polling via RequeueAfter.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
970869a to
f827cc3
Compare
|
Fix: Added a Watches(&kelosv1alpha1.Workspace{}, ...) to SetupWithManager with an enqueueTasksForWorkspace handler that reconciles Tasks referencing a Workspace when it's created/updated. This both pre-warms the informer cache at controller startup and provides event-driven reconciliation instead of relying solely on polling via RequeueAfter. was the fix, I added it here @gjkim42 to make tests pass. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds support for GitHub
createandreleasewebhook events in the webhook server. This enables TaskSpawners to trigger tasks on tag creation, branch creation, and release publication — common CI/CD triggers for workflows like deployment automation, changelog generation, or release notifications.Changes:
*github.CreateEvent(webhook event name:create) — extracts ref, ref_type, sender, and populatesTagorBranchdepending on whether a tag or branch was created*github.ReleaseEvent(webhook event name:release) — extracts action, tag_name, release name/body/URL, and sendertagfilter field toGitHubWebhookFilterfor glob-based tag name matching (analogous to the existingbranchfilter){{.Tag}}and{{.RefType}}template variables for use inpromptTemplateandbranchtemplatesExample usage:
Which issue(s) this PR is related to:
N/A
Special notes for your reviewer:
createevent has noactionfield (per GitHub's API design), so filtering is done viatag/branchglob patterns and theRefTypefield in templates.branchfilter now also works forcreateevents that create branches (previously only documented forpush).github.CreateEvent,github.ReleaseEvent), so no new dependencies are needed.Does this PR introduce a user-facing change?
Summary by cubic
Add support for GitHub
createandreleasewebhook events so TaskSpawners can trigger on tag/branch creation and release publication. Also reconciles Tasks when a referenced Workspace is created to reduce delays.New Features
createandreleaseevents; capture ref/ref_type, tag, release metadata (name, body, URL), sender, and repository; docs and CRDs updated.tag(glob) filtering and extendbranch(glob) filtering tocreate; reject invalid glob patterns; expose{{.Tag}}and{{.RefType}}in templates.Bug Fixes
Written for commit f827cc3. Summary will update on new commits.