Repository navigation
✨ Expose Event triggers in Settings with scoped scanner presets - #15913
Conversation
Signed-off-by: Andy Anderson <andy@clubanderson.com>
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. @clubanderson this PR is held at Why:
Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path. Review findings from Read the Go side against the tree at What I verified:
The api-reference line renumbering is the usual citation shift from touching |
Signed-off-by: Andy Anderson <andy@clubanderson.com>
|
/lgtm |
|
@clubanderson: you cannot LGTM your own PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: clubanderson The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
|
CI repair: the Settings search audit correctly required a real anchored settings row. The Event triggers shell now uses the standard config-field row class and preserves its triggers key, rather than exempting the entry from the guard. The original source/API/UI tests passed; the associated coverage failure was downstream of that search audit. Waiting for the new exact head to rerun all applicable checks. |
Signed-off-by: Andy Anderson <andy@clubanderson.com>
There was a problem hiding this comment.
Read the server side (api_event_triggers.go, config/event_triggers.go, celtrigger/wire.go, cmd/hive/celwire.go) against v5 and the existing savers in config.go. The persistence and publish path looks correct to me.
- Owner gate and revision fence. Both handlers call
requireOwnerRolefirst (api_event_triggers.go:49,:59). The PUT rejects a missingIf-Matchwith 428, compares it against the live snapshot before validation (:116-119), andSaveTriggerRulesre-compares undersaveMu(event_triggers.go:30-33), so a save racing another editor between the two checks still fails with 412 rather than clobbering. - Runtime sees only persisted rules.
SaveTriggerRuleswrites a shallow copy (next := *c, same idiom asconfig.go:7537) and assignsc.Triggersonly aftersaveLockedreturns nil (event_triggers.go:36-40);TriggerRulesSnapshottakes the samesaveMu, andcelEngineFornow keys its signature off that snapshot (celwire.go:72), so the engine recompiles on the next evaluation from the committed rules, with no restart and no half-saved state visible. - Invalid CEL cannot be persisted.
CompileFromConfigruns on the proposed rules before any write (api_event_triggers.go:139), andcelEngineFor's existing fail-closed branch still covers a rule edited on disk. - Legacy rules pass verbatim.
TriggerRuleis a comparable value struct (config.go:440-445), soold == rulepreserves existing rules without re-validating their agent, while new/edited rules must name a configured agent (:124-136). Preset repos are checked againstcfg.Project.Reposonly, matching the body's "no wildcard / no all-repos" claim. dec.DisallowUnknownFields()plus the trailing-EOFcheck mean anenabledfield or a second JSON object is a 400, as the body states.
One small observation, not a defect: CompileFromConfig and celEngineFor now take the process-wide saveMu on every call via TriggerRulesSnapshot (wire.go:19, celwire.go:72). That lock also wraps the YAML write in every Save*, so an evaluation that lands mid-save will wait on the file write. The copy is tiny and the signature check makes the call cheap, so I would not block on it, but it is a new coupling between the evaluation path and config persistence.
CI: all completed checks green at 1433bbf; merge state is blocked by conflicts-with-open-pr, which I did not resolve here.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
Signed-off-by: Andy Anderson <andy@clubanderson.com>
|
Integrated the newly landed default branch once to resolve citation-only merge conflicts with the native queue Settings feature. Preserved native/preparation modules and manifest entries, regenerated the combined SPA and CI-reported citations, and moved the Event triggers editor styling into CSS without increasing any style-ratchet budget. Fresh exact-head CI is required for this composed result; no live changes. |
Signed-off-by: Andy Anderson <andy@clubanderson.com>
There was a problem hiding this comment.
Read the handler, the config save path and the eval wiring at c065fdc; this looks correct to me.
- Preset repo spelling is right. The preset writes
event.repo == <configured spelling>(src/pkg/dashboard/api_event_triggers.go:103). I traced the runtime side:issueToEvent/prToEvent(src/cmd/hive/celwire.go:118,138) copyiss.Repo/pr.Repo, which the enumerator sets from the configured repo string (src/pkg/github/client.go:1858,1974), bare or owner-qualified exactly as inproject.repos. So the generated rule matches what the engine actually sees, even thoughNormalizedEvent.Repo's doc says "fully-qualified" (celtrigger.go:64) — that doc comment is the stale one, not this code. - Lock discipline holds.
TriggerRulesSnapshot/SaveTriggerRules(src/pkg/config/event_triggers.go:14-40) take the samesaveMuasConfig.Save(config.go:7192) and the agent-scope saver (agent_repos.go:228), andcelEngineFor+CompileFromConfignow read through the snapshot, so evaluators never see a half-saved slice. Revision check is repeated inside the lock, so the handler-side precondition atapi_event_triggers.go:106is only a fast path. - Owner-gated on both verbs,
DisallowUnknownFields+ trailing-token check, CEL compiled to bool before persisting, publish-after-persist. No native browser dialogs in the new UI module.
Open question (pre-existing, not introduced here): items re-read via webhook patches (src/pkg/github/webhook_item_patch.go:52,137) take repo from the webhook path; if that is ever owner-qualified while project.repos is bare, a preset rule would miss those events. I did not trace that far — worth a glance by whoever owns the webhook path.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
|
Verified source merge: 2026-10-31T02:19:31Z, squash 9c9b08d. Tested exact head c065fdc; all 11 required contexts and full applicable CI passed, including both architecture image builds, freshness/security checks, tests, coverage, and lint. ARM64 job 124408436152 completed successfully at 02:18:35Z. Guarded admin squash used --match-head-commit and preserved DCO. Settings → Features → Work intake & issue lifecycle → Event triggers; also linked from Agent → Configuration → Channels. Select the scanner first-seen issue preset, an existing agent, and a managed repository, then Save Event triggers. Changes apply on the next evaluation without restarting or clearing seen history. First-seen ACTIONABLE semantics are once per process, including existing items and replay after restart; existing execution gates remain. Saving does not install signed GitHub delivery. Source-only: no live configuration, webhook registration, or deployment changes performed. |
Summary
Validation
No deployment, live configuration changes or webhook registration.