Repository navigation
feat: attestation progress events, M2 custom events (#3825) - #3865
Conversation
PR validation — ✅ 3 passing
AI Session Checks — 🟢 90% · ✅ 0 failing
|
| Status | Policy | Material | Messages |
|---|---|---|---|
| ✅ Passed | ai-config-ai-agents-allowed |
ai-coding-session-e9b776 |
- |
| ✅ Passed | ai-config-no-dangerous-commands |
ai-coding-session-e9b776 |
- |
| ✅ Passed | ai-config-no-secrets |
ai-coding-session-e9b776 |
- |
| ✅ Passed | ai-config-mcp-servers-allowed |
ai-coding-session-e9b776 |
- |
Security Checks — ⚠️ 1 failing
⚠️ AI Security Analysis
The per-PR audit did not finish: 20 concerns went unreviewed (spend ceiling or time). No introduced risk was found in what it reviewed, but treat this as incomplete, not clean.
View in Chainloop ↗ · How this works ↗
✅ Secret Scan
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | secrets-detection |
- |
✅ SAST Scan
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | owasp-top10-2025 |
- |
| ✅ Passed | sast |
- |
| ✅ Passed | cwe-top25 |
- |
| ✅ Passed | cwe-top26-40-cusp |
- |
✅ IaC Scan
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | iac-misconfiguration |
- |
Scans not applied (2)
| Scan | Reason |
|---|---|
| Vulnerability Scan | no manifest/lockfile changed |
| GitHub Actions Scan | no workflow files changed |
Powered by Chainloop and Chainloop Trace
There was a problem hiding this comment.
All reported issues were addressed across 20 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Add the custom run event type and the chainloop attestation event command, so a pipeline can add its own steps to the timeline of its run (R-009). workflow run describe shows each custom step with its status and duration. Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: e9b77674-6796-46c7-9ae7-1cbe6cab9a87
d35ff35 to
4e8a1d9
Compare
Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: e9b77674-6796-46c7-9ae7-1cbe6cab9a87
A wrong number of arguments or a wrong --status now shows a warning and exits with success, as the other failures do, so a progress signal never breaks a pipeline (R-009). Add tests that run the command end to end. Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: e9b77674-6796-46c7-9ae7-1cbe6cab9a87
There was a problem hiding this comment.
1 issue found across 3 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="app/cli/cmd/attestation_event.go">
<violation number="1" location="app/cli/cmd/attestation_event.go:42">
P2: `Args: cobra.ArbitraryArgs` only lets positional-count errors reach `RunE`; Cobra still rejects unknown flags and malformed flag values before the warning handler runs, so those invalid calls exit non-zero. Handle Cobra parsing failures for this progress-only command through the same warning-and-success path.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
The command takes the step with the --name flag, not a positional argument, as attestation add does. R-012 supersedes R-009 in the spec. CLAUDE.md records the convention: commands identify what they act on with a flag. Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: e9b77674-6796-46c7-9ae7-1cbe6cab9a87
There was a problem hiding this comment.
1 existing issue remains and no new issues found across 5 files (changes from recent commits).
Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.
View guided diff | Re-trigger cubic
Implements milestone M2 ("Custom events") of the attestation progress events spec. Refs #3825. Builds on M1 (#3859).
What it adds
WorkflowRunEvent.TypegetsTYPE_CUSTOM.RecordEventaccepts it with no attributes. A custom key uses the format of annotation names (letters, digits,_and-), up to 64 characters. It cannot hold a dot, so it never matches an automaticchainloop.key. Custom events do not change the material progress.chainloop attestation event --name <key> --status <started|succeeded|failed|canceled> [--message <text>]. It records a custom step on the run of the attestation in progress, from the local state or with--attestation-id. With remote state, the attestation ID is the run ID, so the command sends one call and does not download the state. Each failure shows a warning, and the command exits with success: no attestation in progress, a rejected key, an older control plane, and also a missing--name, an unexpected positional argument, or a wrong--status. A dry run records nothing.chainloop workflow run describe. The timeline shows each custom step as a line, with the status of its last event. A finished step shows its duration, and a step that still runs on a run in progress shows how long it runs. The events of a repeated step fold below it, as for materials.Examples
The output below comes from the command and the timeline renderer in this PR, against a test control plane.
1. Record steps in the pipeline
Record a step between
attestation initandattestation push. Events with the same--nameare one step of the timeline.A failed step, and a step that waits on something outside the job:
In GitHub Actions, wrap a job step, and keep the result of the step:
With remote state, add
--attestation-id "$ATTESTATION_ID", as for the other attestation commands.2. See the steps while the run is in progress
3. See the steps as history after the push
4. A failure never breaks the pipeline
Each failure prints a warning, and the command exits with 0:
Spec changes
R-012 supersedes R-009: the command takes the step with the
--nameflag, not a positional argument, aschainloop attestation add --namedoes. A wrong call, for example a missing--name, is also a warning with exit 0. CLAUDE.md now records the convention: CLI commands identify what they act on with a flag, not a positional argument.Differences from the plan
biz/workflowrunevent.go), next to the other event checks, not in the attestation service.describe. Its "Done when" needs the custom step indescribe, so this PR adds it.AI assistance: this change was implemented with Claude Code.
🤖 Posted by Maximus bot (Claude Code) on behalf of @migmartri