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

Allow conflicting Git URLs that refer to the same commit SHA #2769

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

charliermarsh
Copy link
Member

Summary

This PR leverages our lookahead direct URL resolution to significantly improve the range of Git URLs that we can accept (e.g., if a user provides the same requirement, once as a direct dependency, and once as a tag). We did some of this in #2285, but the solution here is more general and works for arbitrary transitive URLs.

Closes #2614.

@charliermarsh charliermarsh marked this pull request as ready for review April 2, 2024 02:27
@charliermarsh charliermarsh added the enhancement New feature or request label Apr 2, 2024
@charliermarsh charliermarsh force-pushed the charlie/allowed-urls branch 2 times, most recently from 164a873 to cae49a0 Compare April 2, 2024 02:51
@zanieb zanieb self-requested a review April 2, 2024 02:52
@zanieb
Copy link
Member

zanieb commented Apr 2, 2024

Nice. I'll give this a real read in the morning.

@charliermarsh
Copy link
Member Author

Thanks :)

Copy link
Member

@zanieb zanieb left a comment

Choose a reason for hiding this comment

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

Way better! Minor comment regarding a test

@charliermarsh charliermarsh force-pushed the charlie/allowed-urls branch 2 times, most recently from b01ac6d to 7f0f233 Compare April 2, 2024 23:29
@charliermarsh charliermarsh enabled auto-merge (squash) April 2, 2024 23:29
@charliermarsh charliermarsh merged commit c30a65e into main Apr 2, 2024
34 checks passed
@charliermarsh charliermarsh deleted the charlie/allowed-urls branch April 2, 2024 23:36
charliermarsh added a commit that referenced this pull request Apr 3, 2024
## Summary

I noticed in #2769 that I was now stripping `.git` suffixes from Git
URLs after resolving to a precise commit. This PR cleans up the internal
caching to use a better canonical representation: a `RepositoryUrl`
along with a `GitReference`, instead of a `GitUrl` which can contain
non-canonical data. This gives us both better fidelity (preserving the
`.git`, along with any casing that the user provided when defining the
URL) and is overall cleaner and more robust.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

uv pip compile fails with conflicting urls (sha vs tag) across dependencies
2 participants