Skip to content

feat: rename default project version from empty string to "v0"#3046

Merged
migmartri merged 2 commits intochainloop-dev:mainfrom
migmartri:feat/rename-default-version-to-v0
Apr 16, 2026
Merged

feat: rename default project version from empty string to "v0"#3046
migmartri merged 2 commits intochainloop-dev:mainfrom
migmartri:feat/rename-default-version-to-v0

Conversation

@migmartri
Copy link
Copy Markdown
Member

Summary

  • Rename the default/unversioned project version from "" to "v0" across storage, application code, and CLI display
  • Add backward-compatible translation so old CLI clients sending "" transparently resolve to "v0"
  • Add multi-layer guards (biz, data, Ent schema) preventing empty-string versions from being created again
  • Database migration renames existing "v0""v0.0" to avoid conflicts, then renames """v0" and updates the column default

Closes #3045

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>
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread app/controlplane/pkg/biz/projectversion.go
@migmartri migmartri force-pushed the feat/rename-default-version-to-v0 branch from 939b94e to a64872a Compare April 16, 2026 15:54
…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>
@migmartri migmartri merged commit 4dcbc41 into chainloop-dev:main Apr 16, 2026
15 checks passed
@migmartri migmartri deleted the feat/rename-default-version-to-v0 branch April 16, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: rename default project version from empty string to "v0"

2 participants