feat(attestation): add --mark-latest flag to attestation init#3151
Conversation
Add tri-state --mark-latest flag to control whether a project version is promoted to latest during attestation initialization. Omitting the flag preserves current behavior, --mark-latest=true forces promotion of existing pre-release versions, and --mark-latest=false skips promotion entirely. Also adds MarkAsLatest biz/data method for the platform repo to build the standalone "project version mark-latest" command on top of. Assisted-by: Claude Code Signed-off-by: Javier Rodriguez <javier@chainloop.dev> Chainloop-Trace-Sessions: c9c4aac1-2015-43c3-bf26-47621b425735
AI Session Analysis
|
| Status | Attribution | File | Lines |
|---|---|---|---|
| modified | ai | app/controlplane/pkg/biz/workflowrun_integration_test.go |
+359 / -0 |
| modified | ai | app/controlplane/pkg/biz/projectversion_integration_test.go |
+86 / -1 |
| modified | ai | app/controlplane/pkg/data/projectversion.go |
+54 / -9 |
| modified | ai | app/controlplane/pkg/data/workflowrun.go |
+24 / -5 |
| modified | ai | app/controlplane/pkg/biz/projectversion.go |
+22 / -0 |
| modified | ai | app/cli/cmd/attestation_init.go |
+13 / -1 |
| modified | ai | app/controlplane/pkg/biz/workflowrun.go |
+7 / -0 |
| modified | ai | app/controlplane/api/controlplane/v1/workflow_run.proto |
+6 / -0 |
| modified | ai | app/cli/pkg/action/attestation_init.go |
+3 / -1 |
| modified | ai | app/controlplane/pkg/data/workflow.go |
+1 / -1 |
| modified | ai | app/controlplane/api/controlplane/v1/response_messages.proto |
+1 / -0 |
| modified | ai | app/controlplane/internal/service/attestation.go |
+1 / -0 |
| modified | ai | app/controlplane/internal/service/workflowrun.go |
+1 / -0 |
Policies (4)
| Status | Policy | Material | Messages |
|---|---|---|---|
| ✅ Passed | ai-config-ai-agents-allowed |
ai-coding-session-c9c4aa |
- |
| ✅ Passed | ai-config-no-dangerous-commands |
ai-coding-session-c9c4aa |
- |
| ✅ Passed | ai-config-no-secrets |
ai-coding-session-c9c4aa |
- |
| ✅ Passed | ai-config-mcp-servers-allowed |
ai-coding-session-c9c4aa |
- |
Powered by Chainloop and Chainloop Trace
There was a problem hiding this comment.
1 issue found across 21 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
…romotion The pre-transaction version lookup could be stale if a concurrent request released the version between the lookup and the transaction start. Re-read the version inside the transaction to ensure the prerelease check uses current data. Assisted-by: Claude Code Signed-off-by: Javier Rodriguez <javier@chainloop.dev> Chainloop-Trace-Sessions: c9c4aac1-2015-43c3-bf26-47621b425735
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
Acquire a row lock when re-reading the version inside the transaction to prevent a concurrent release from slipping through between the read and the promotion. Assisted-by: Claude Code Signed-off-by: Javier Rodriguez <javier@chainloop.dev> Chainloop-Trace-Sessions: c9c4aac1-2015-43c3-bf26-47621b425735
Summary
--mark-latestflag toattestation initto control whether a project version is promoted to latest (omitted = default behavior,true= force promote,false= skip promotion)MarkAsLatestbiz/data method for the platform repo to build the standaloneproject version mark-latestcommand on top oflatestfield on theProjectVersionproto response messagepromoteVersionToLatestWithTxhelper to avoid duplication between standalone promotion and workflow run creation pathsTest plan
--latest-version,require-existing-versioncombinations