fix(poetry): keep /simple suffix on the resolution index URL - #536
fix(poetry): keep /simple suffix on the resolution index URL#536nicktr202 wants to merge 2 commits into
Conversation
SetPypiRepoUrlWithCredentials stripped the /simple suffix from the Artifactory URL before selecting the publish branch, so resolution commands were also configured with the truncated URL. Poetry then wrote .../api/pypi/<repo> into [[tool.poetry.source]] and queried it as a PEP 503 index, which fails with "doesn't match any versions". Extract the URL selection into poetryRepoUrl: publish keeps the upload endpoint (no /simple), every other command keeps the PEP 503 index. TestSetPypiRepoUrlWithCredentials_URLTransformation duplicated the production logic instead of calling it, so it could not catch this. It now calls poetryRepoUrl and asserts both the publish and the resolution URL. Fixes jfrog#381
|
All contributors have signed the CLA ✍️ ✅ |
|
Warning Review limit reached
Next review available in: 51 minutes Limit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughPoetry repository URL handling now distinguishes publish URLs from dependency-resolution URLs. Publish commands remove ChangesPoetry repository URL handling
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change preserves the required /simple suffix for dependency resolution while keeping the publish endpoint unchanged, and no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
I have read the CLA Document and I hereby sign the CLA |
Description
SetPypiRepoUrlWithCredentialsstrips the/simplesuffix from the Artifactory URL before choosing thepublishbranch, so resolution commands (install,add,update,lock) are configured with the truncated URL too:ConfigPoetryRepowrites that URL into[[tool.poetry.source]]inpyproject.toml. Poetry then queries.../api/pypi/<repo>as a PEP 503 index, which is not one, and reports every dependency as unresolvable:The two URLs are genuinely different endpoints and the Poetry documentation is explicit about it: a package source must carry the trailing
/simple/("Note the trailing/simple/. This is important when configuring PEP 503 compliant package sources"), and it notes that this "is not the same configuration used when publishing a package".Introduced in 98f7b22 (PR #316). First released in JFrog CLI 2.87.0; 2.86.0 is the last good version.
Fix
The URL selection is extracted into
poetryRepoUrl, which is applied after the command is known:publish→ upload endpoint,/simplestripped (unchanged behaviour)/simplepreservedWhy the existing test did not catch this
TestSetPypiRepoUrlWithCredentials_URLTransformationre-implemented the production logic inside the test body instead of calling it, and only ever asserted the publish case:So it validated a copy of the code, never the resolution path, and would have stayed green after any regression in
SetPypiRepoUrlWithCredentials. The test now callspoetryRepoUrldirectly and asserts both outcomes: the publish URL without/simple, and the resolution URL with/simplepreserved forinstall,add,update,lockand the empty command name.Related issues
jf poetry installjfrog-cli#3306 — Poetry version solving fails when runningjf poetry install(reporter confirms: "when adding back/simple,poetry updatenow works")Tests
go build ./artifactory/commands/python/...— OKgo vet ./artifactory/commands/python/...— OKgo test ./artifactory/commands/python/...— OKSummary by CodeRabbit
/simpleindex endpoint.