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

Update shim for new VERSION location #135

Closed
wants to merge 1 commit into from

Conversation

thejcannon
Copy link
Member

See pantsbuild/pants#17563 for the pants repo change.

Copy link
Contributor

@chrisjrn chrisjrn left a comment

Choose a reason for hiding this comment

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

Soooo, I think we might actually need to make the PANTS_FROM_SHA functionality a bit smarter, because it’s going to break if you’re testing commits a few months either side of now -- you need the new script for newer versions, and the old script for older versions.

Can we ask GitHub the timestamp of a specific Pants commit and then decide on the URL based on whether it's older or newer than a specific timestamp?

@chrisjrn
Copy link
Contributor

It looks like you can use the GitHub compare commits endpoint without authentication:

% curl \
  -H "Accept: application/vnd.github+json" \
  https://api.github.com/repos/pantsbuild/pants/compare/169d2e613cad7b1bd2593ae9e747100458bf2e5f...66edd8917f5c57b8ab0e36c88dc556142b321732 | grep \"status\"
  "status": "behind",

That status field will give either ahead, behind, or identical. So you can check to see if the requested SHA is behind the changeover commit, and in that case, use the old URL version.

@thejcannon
Copy link
Member Author

Going to drop in favor of a symlink

@thejcannon thejcannon closed this Nov 18, 2022
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.

None yet

2 participants