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

Projects
None yet
3 participants
@cosmicexplorer
Copy link
Contributor

commented Mar 18, 2019

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.

@Eric-Arellano
Copy link
Contributor

left a comment

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

@stuhood

This comment has been minimized.

Copy link
Member

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 cosmicexplorer:fix-numeric-sha-prefix branch from a40673b to b6ef667 Mar 19, 2019

@cosmicexplorer cosmicexplorer force-pushed the cosmicexplorer:fix-numeric-sha-prefix branch from b6ef667 to 84b30a7 Mar 19, 2019

@cosmicexplorer cosmicexplorer merged commit cd8d75a into pantsbuild:master Mar 19, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

stuhood added a commit that referenced this pull request Mar 20, 2019

add a non-numeric prefix before the unstable version to avoid getting…
… 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
You can’t perform that action at this time.