Skip to content

chore: dissallow 'v' in the version#655

Merged
ava-silver merged 2 commits into
mainfrom
ava.silver/chore/dissallow-v-in-the-version
Jan 26, 2026
Merged

chore: dissallow 'v' in the version#655
ava-silver merged 2 commits into
mainfrom
ava.silver/chore/dissallow-v-in-the-version

Conversation

@ava-silver

@ava-silver ava-silver commented Jan 26, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Right now it's easy to accidentally change the version to vX.X.X, instead of X.X.X, this helps prevent that footgun.

Motivation

Testing Guidelines

Additional Notes

Types of changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ava-silver ava-silver marked this pull request as ready for review January 26, 2026 19:24
@ava-silver ava-silver requested a review from a team as a code owner January 26, 2026 19:24
@ava-silver ava-silver requested review from avangelillo and nina9753 and removed request for avangelillo January 26, 2026 19:24
@ava-silver ava-silver force-pushed the ava.silver/chore/dissallow-v-in-the-version branch from ef88ae5 to c4d686d Compare January 26, 2026 19:26
Comment thread scripts/publish_prod.sh Outdated
elif [[ $1 == v* ]]; then
echo "Version should not start with 'v', e.g., use 3.1.4 instead of v3.1.4"
exit 1
elif [[ ! $1 =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did this check not catch it? I always have too look up regex stuff, but is it just missing the start and end of string anchors?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

nope, it doesnt catch it right now -- i could change it to catch it though, that's probably simpler

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

now we're using the anchors like you mention:

bash-5.3$ hi=v1.2.3
bash-5.3$ [[ ! $hi =~ [0-9]+\.[0-9]+\.[0-9]+ ]] && echo bad
bash-5.3$ [[ ! $hi =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && echo bad
bad

@ava-silver ava-silver merged commit c13d2f5 into main Jan 26, 2026
10 checks passed
@ava-silver ava-silver deleted the ava.silver/chore/dissallow-v-in-the-version branch January 26, 2026 19:34
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.

2 participants