Skip to content

fix(version): preserve unspecified commit placeholder#1831

Open
stephenlclarke wants to merge 1 commit into
apple:mainfrom
stephenlclarke:fix-version-unspecified-commit
Open

fix(version): preserve unspecified commit placeholder#1831
stephenlclarke wants to merge 1 commit into
apple:mainfrom
stephenlclarke:fix-version-unspecified-commit

Conversation

@stephenlclarke

Copy link
Copy Markdown

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

When container is built without a GIT_COMMIT value, the C version shim falls back to unspecified. ReleaseVersion.singleLine(appName:) shortened every non-nil commit string to seven characters, so the user-facing version banner displayed commit: unspeci instead of the complete placeholder.

This keeps missing or placeholder commit values as unspecified, while preserving the seven-character display for real commit hashes.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

Validated with:

swift test --disable-automatic-resolution --filter ContainerVersionTests
env -u GIT_COMMIT swift build --disable-automatic-resolution --product container
.build/debug/container --version

The local version smoke check prints:

container CLI version 0.0.0 (build: debug, commit: unspecified)

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.

1 participant