feat: rename default project version from empty string to "v0"#3046
Merged
migmartri merged 2 commits intochainloop-dev:mainfrom Apr 16, 2026
Merged
Conversation
The default/unversioned project version was stored as "" in the database, causing friction in APIs, CLIs, and MCP tools that had to special-case empty strings. This renames it to "v0" everywhere: - Add DefaultVersionName constant in biz layer - Translate "" → "v0" in WorkflowRunUseCase.Create for backward compat - Update Ent schema default and remove empty-string validator exception - Add multi-layer guards preventing empty versions from being created - Database migration: rename existing "v0" → "v0.0", then "" → "v0" - Remove "none" fallback from CLI attestation status display Closes chainloop-dev#3045 Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
There was a problem hiding this comment.
1 issue found across 13 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="app/controlplane/pkg/biz/projectversion.go">
<violation number="1" location="app/controlplane/pkg/biz/projectversion.go:97">
P2: Add backward-compatible translation for empty version strings before validation. The validation will reject empty strings, but the PR states old clients sending "" should transparently resolve to "v0". Add the translation logic before calling ValidateVersion to ensure consistency across all code paths.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
939b94e to
a64872a
Compare
…workflow test Add backward-compat "" → "v0" translation in ProjectVersionUseCase.Create to match WorkflowRunUseCase.Create behavior. Update workflow integration test to look up the default version by DefaultVersionName instead of "". Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
jiparis
approved these changes
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
""to"v0"across storage, application code, and CLI display""transparently resolve to"v0""v0"→"v0.0"to avoid conflicts, then renames""→"v0"and updates the column defaultCloses #3045