Uh oh!
There was an error while loading. Please reload this page.
fix(cli): decouple PR mode from latest promotion - #3289
Conversation
PR mode no longer forces mark-latest=false. It now only tags the attestation with the chainloop.dev/is-pull-request annotation, leaving latest promotion under the explicit control of --mark-latest. Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: 66364a65-bb99-4994-a169-8205a71791ae
AI Session Analysis
|
| Status | Attribution | File | Lines |
|---|---|---|---|
| modified | ai | app/cli/pkg/action/attestation_init_test.go | +0 / -30 |
| modified | ai | app/cli/pkg/action/attestation_init.go | +3 / -13 |
| modified | ai | app/cli/cmd/attestation_init.go | +1 / -1 |
Policies (4)
| Status | Policy | Material | Messages |
|---|---|---|---|
| ✅ Passed | ai-config-ai-agents-allowed | ai-coding-session-66364a | - |
| ✅ Passed | ai-config-no-dangerous-commands | ai-coding-session-66364a | - |
| ✅ Passed | ai-config-no-secrets | ai-coding-session-66364a | - |
| ✅ Passed | ai-config-mcp-servers-allowed | ai-coding-session-66364a | - |
Powered by Chainloop and Chainloop Trace
Uh oh!
There was an error while loading. Please reload this page.
PR chainloop-dev#3289 changed the --pr flag help text but didn't regenerate the CLI documentation, causing the ent CI generated-code check to fail. Run go generate ./... in app/cli/documentation to sync cli-reference.mdx. Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
…air newest pre-release version PR chainloop-dev#3289 removed PR mode's incomplete suppression of latest-version promotion. Restore that suppression in the CLI action (the PR chainloop-dev#3268 rule): when isPR is true, default --mark-latest to false unless the user explicitly passed --mark-latest=true. This preserves the three observable states — omitted becomes false in PR mode, explicit false stays false, explicit true remains the user override. Complete the behavior in the control plane: a later non-PR attestation against an existing pre-release version now repairs latest when that version is the newest active version by immutable created_at and is not already latest. PR runs and explicit --mark-latest=false opt-outs are not promoted. Released versions are never auto-promoted; only explicit true attempts promotion and is rejected for released versions. The nil/true/false contract is now described in the AttestationServiceInitRequest.mark_as_latest proto comment and regenerated artifacts. Added integration coverage for the repair lifecycle (v1 latest → PR-sim v2 not latest → non-PR v2 repaired to latest) and boundaries: older version not promoted over newer, explicit false suppression wins over automatic repair, and newest released version not auto-promoted. Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
What
PR mode for attestations no longer forces
mark-latest=false. It now only tags the attestation with thechainloop.dev/is-pull-requestannotation, and latest promotion stays under the explicit control of the--mark-latestflag.This removes the implicit skip-latest-promotion side-effect introduced in #3268 while keeping the PR-mode detection and annotation behavior intact.
cc @jiparis@javirln — reopening #3265 so we can review the approach for the skip-latest-promotion behavior separately.
This PR was produced with AI assistance (Claude Code).
Assisted-by: Claude Code
🤖 Posted by Maximus bot (Claude Code) on behalf of@migmartri