Repository navigation
fix(image): split pixi git revision from the URL path, not the authority - #1863
Open
m86hussein wants to merge 1 commit into
Open
m86hussein wants to merge 1 commit into
m86hussein wants to merge 1 commit into
Conversation
`pkg @ git+ssh://git@github.com/org/repo.git@v1.0` was split on the first `@`, producing `git = ssh://git` and `rev = github.com/org/repo.git@v1.0`. The same happened for https URLs with credentials, and a `#subdirectory=...` fragment leaked into `rev`. Parse the URL with urllib, take the revision only from the path, and map `#subdirectory=` to pixi's `subdirectory` key. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: m86hussein <317587333+m86hussein@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1863 +/- ##
=======================================
Coverage ? 74.09%
=======================================
Files ? 350
Lines ? 44749
Branches ? 7095
=======================================
Hits ? 33155
Misses ? 9760
Partials ? 1834
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
_pypi_requirement_to_pixisplitgit+requirement URLs on the first@, so an@in the URL authority was taken as the revision separator.pkg @ git+ssh://git@github.com/org/repo.git@v1.0rendered as{git = "ssh://git", rev = "github.com/org/repo.git@v1.0"}; credentialed https URLs broke the same way, and a#subdirectory=...fragment leaked intorev.This adds a small
_git_url_to_pixihelper that:urllib.parse.urlsplitand takes the revision only from the URL path (rpartition("@")), so user info stays ingit;#subdirectory=...fragment to pixi'ssubdirectorykey and drops other fragments (e.g.egg=).The existing
git+https://...@v1.2.3case renders exactly as before.How was this patch tested?
test_render_manifest_git_requirement_formscovers ssh with and without a revision, an https URL with credentials, and a#subdirectory=fragment. It fails without the fix.pytest tests/utils/test_pixi_script_parser.py: 18 passed.pytest tests/flyte/imagebuild/test_pixi_script_builder.py tests/flyte/test_image.py: pass.ruff check,ruff format --check,mypy,ty check: clean.Changelog
git+ssh://git@...and credentialedgit+https://requirements, and to honour#subdirectory=.Fixes flyteorg/flyte#8450