Skip to content

fix(image): split pixi git revision from the URL path, not the authority - #1863

Open
m86hussein wants to merge 1 commit into
flyteorg:mainfrom
m86hussein:fix/pixi-git-url-split
Open

m86hussein wants to merge 1 commit into
flyteorg:mainfrom
m86hussein:fix/pixi-git-url-split

Conversation

@m86hussein

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

_pypi_requirement_to_pixi split git+ 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.0 rendered as {git = "ssh://git", rev = "github.com/org/repo.git@v1.0"}; credentialed https URLs broke the same way, and a #subdirectory=... fragment leaked into rev.

This adds a small _git_url_to_pixi helper that:

  • parses the URL with urllib.parse.urlsplit and takes the revision only from the URL path (rpartition("@")), so user info stays in git;
  • maps the #subdirectory=... fragment to pixi's subdirectory key and drops other fragments (e.g. egg=).

The existing git+https://...@v1.2.3 case renders exactly as before.

How was this patch tested?

  • New test_render_manifest_git_requirement_forms covers 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

  • Fix pixi script images to correctly parse git+ssh://git@... and credentialed git+https:// requirements, and to honour #subdirectory=.

Fixes flyteorg/flyte#8450

`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

codecov Bot commented Nov 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@6df18e4). Learn more about missing BASE report.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1863   +/-   ##
=======================================
  Coverage        ?   74.09%           
=======================================
  Files           ?      350           
  Lines           ?    44749           
  Branches        ?     7095           
=======================================
  Hits            ?    33155           
  Misses          ?     9760           
  Partials        ?     1834           
Files with missing lines Coverage Δ
src/flyte/_utils/pixi_script_parser.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

[BUG] [V2] pixi script parser splits git+ URLs on the first @ (breaks ssh://git@ and credentialed URLs)

1 participant