Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a non-numeric prefix before the unstable package version to avoid truncation #7400

Merged

Conversation

cosmicexplorer
Copy link
Contributor

Problem

See #7399. The commit 0672383 experienced CI failures, because our current method of generating the "unstable" pants version to build wheels puts the hexadecimal sha as its own version component: if the sha happens to be completely numeric and begins with any zeroes, packaging.version.Version() will helpfully truncate it -- but our release.sh script wasn't aware of that.

Solution

  • Add a non-numeric prefix before the sha to generate PANTS_UNSTABLE_VERSION in release.sh to avoid possible truncation.
    • The prefix chosen was git.

Result

Commit shas starting with zero and containing only numbers for the first 8 characters will no longer fail in CI.

Copy link
Contributor

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

Thank you Danny for discovering this and fixing it! Looks great.

@stuhood
Copy link
Member

stuhood commented Mar 18, 2019

It feels like it might be just as easy to tackle #7399 here as it is to add the git prefix?

A useful "date" slug to add might be something like:

$ date +"%Y%m%d%H%M%S"
20190318151238

EDIT: Oooh, nevermind. I take that back. Adding the time prefix would require coordination between wheel shards.

@cosmicexplorer cosmicexplorer force-pushed the fix-numeric-sha-prefix branch from a40673b to b6ef667 Compare March 19, 2019 05:36
@cosmicexplorer cosmicexplorer force-pushed the fix-numeric-sha-prefix branch from b6ef667 to 84b30a7 Compare March 19, 2019 05:38
@cosmicexplorer cosmicexplorer merged commit cd8d75a into pantsbuild:master Mar 19, 2019
stuhood pushed a commit that referenced this pull request Mar 20, 2019
… parsed and truncated as a number (#7400)

### Problem

See #7399. The commit 0672383 experienced CI failures, because our current method of generating the "unstable" pants version to build wheels puts the hexadecimal sha as its own version component: if the sha happens to be completely numeric and begins with any zeroes, `packaging.version.Version()` will helpfully truncate it -- but our `release.sh` script wasn't aware of that.

### Solution

- Add a non-numeric prefix before the sha to generate `PANTS_UNSTABLE_VERSION` in `release.sh` to avoid possible truncation.
  - The prefix chosen was `git`.

### Result

Commit shas starting with zero and containing only numbers for the first 8 characters will no longer fail in CI.
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.

3 participants