Proposal: schema-governed correlation-id label for PaC-created PipelineRuns #2333
ci-operator
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi PaC folks 👋
I’d like to propose a small, PaC-scoped feature: a deterministic, schema-governed correlation ID label that PaC applies to all
PipelineRuns created for a given webhook event.The goal is to give users a stable, configurable per-event correlation ID, derived from a configurable set of fields available at webhook delivery, that other controllers and observability tooling can key on.
Problem statement
When PaC handles a webhook (push / PR / MR, etc.), it may create multiple
PipelineRuns for that single event. Downstream, people often want to answer “which runs came from this event?” and group logs, metrics, and CloudEvents on that basis.Some constraints:
triggers-eventid, where used) are typically random, not derived from a user-defined schema, and not reproducible in a policy-driven way.Right now there is no standard, PaC-native mechanism to compute a deterministic correlation-id from these fields and apply it to all PipelineRuns that PaC creates for that event.”
Proposal
Introduce a schema-governed correlation ID that PaC computes per webhook event and applies as a label to all
PipelineRuns it creates for that event.1. Correlation policy reference on
RepositoryAdd an optional field to the PaC
RepositoryCR (shape subject to bikeshedding):spec.correlationPolicy.secretRef.nameis set, PaC looks up that Secret in theRepository’s namespace.2. Correlation policy Secret (schema)
The referenced Secret would contain a policy describing how to compute a correlation ID:
provider,org,repo_url,commit_sha,pr_number,event_id).For each webhook event, PaC would:
provider,org,repo_url,commit_sha,pr_number,event_id, etc.).UUIDv5(policy.namespaceUUID, canonical_json).This is explicitly about determinism, not security (UUIDv5 uses SHA-1; this is not an attestation mechanism).
3. Label on all PaC-created PipelineRuns for that event
For every
PipelineRunPaC creates in response to that webhook event, PaC would set:This covers:
Downstream controllers/tools can then group “all runs from this event” by this label, without PaC needing to coordinate with them.
4. Caching & performance
Implementation detail, but worth calling out:
Non-goals (PaC side)
Why in PaC?
PaC is in the right place to do this because it:
RepositoryCR),PipelineRuns.Having PaC mint a deterministic, policy-governed correlation-id and stamp all its
PipelineRuns with it gives users a consistent hook that other controllers and observability systems can rely on.Questions for maintainers
spec.correlationPolicy.secretRefonRepositoryfeel like the right place to configure this, or would you prefer a global config or different shape?pipelinesascode.tekton.dev/correlation-idon all PaC-createdPipelineRuns, or should the label key itself be configurable?Happy to adjust naming/shape to fit PaC’s design; the core ask is: can PaC standardize a deterministic, schema-driven correlation-id per webhook event and label all PaC-created PipelineRuns with it?
Beta Was this translation helpful? Give feedback.
All reactions