Skip to content

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

@migmartri

Description

@migmartri

Summary

The default project version (the un-versioned bucket that workflow runs fall into when no --version is specified) is stored as an empty string "" in the database. This is referred to colloquially as "v0" in documentation and conversation, but the actual stored value causes widespread friction:

  • Empty strings are opaque in APIs, CLIs, and MCP tools — every consumer must special-case "" to understand it means "the default version"
  • Declarative access is broken: users cannot say --version v0 to target the default; they must omit the flag entirely
  • CLI display is inconsistent: attestation status shows "none", workflow run list shows a blank column

Proposed Change

Rename the stored value from "" to "v0" everywhere:

  1. Add DefaultVersionName = "v0" constant in the biz layer
  2. Update Ent schema: change Default("")Default("v0"), remove the empty-string validator exception
  3. Update application code that creates/looks up the default version (workflow.go, workflowrun.go) to use the constant
  4. Add backward-compat translation: server translates incoming """v0" so old CLI clients keep working
  5. Database migration:
    • Rename any existing user-created "v0" versions → "v0.0" (conflict avoidance)
    • Rename all "" versions → "v0"
    • ALTER TABLE project_versions ALTER COLUMN version SET DEFAULT 'v0'
  6. Remove "none" fallback from CLI display — "v0" renders naturally as a real version string

Behavior After Change

Scenario Before After
Run without --version Associates with "" version Associates with "v0" version
Run with --version v0 Creates a NEW "v0" version Finds existing "v0" version
Old client sends "" Creates/finds "" version Server translates to "v0"
CLI attestation status Shows "none" Shows "v0"
CLI workflow run list Shows blank Shows "v0"

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions