Repository navigation
RTECO-2728 - Audit Poetry projects that declare dependencies in PEP 621 [project] - #938
reshmifrog wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
…21 [project] Since Poetry 2.0, dependencies are declared by default in the PEP 621 [project] table. 'jf audit --poetry' found no dependencies for such projects and failed with 'no dependencies were found'. Bumps build-info-go to the fix (jfrog/build-info-go#438) and adds a 'poetry-pep621-project' fixture, with the same dependencies as 'poetry-project', covered by a unit test and by TestXrayAuditPoetry. Fixes jfrog#560
5768b51 to
b6fb318
Compare
| } | ||
|
|
||
| // Poetry 2.0+ declares dependencies in the PEP 621 [project] table by default, instead of [tool.poetry.dependencies]. | ||
| func TestBuildPoetryDependencyListPep621(t *testing.T) { |
There was a problem hiding this comment.
Have the new tests run in CI? The main test workflow (test.yml) has not run on this PR. It runs only on a PR with the safe to test label, and this PR has no labels. The PR comes from a fork, so no push run exists for it either. The only checks that ran are the static analysis, the CLA check and the Embedded Jars tests. So TestBuildPoetryDependencyListPep621 and the new PEP 621 cases in TestXrayAuditPoetry have not run in CI. The description also says that the author could not run TestXrayAuditPoetry as it is, so nobody has run these cases yet. Please add the label, and confirm that these tests pass.
Relation to the issue: These tests are the checks that jf audit --poetry now finds the dependencies of a PEP 621 project in this repo. Until they run, nothing shows that the fix works here.
There was a problem hiding this comment.
You are right, the main tests have not run in CI yet. I cannot add the safe to test label, because I do not have write access to this repository. Could a maintainer please add it?
What I ran locally: TestBuildPoetryDependencyListPep621 and all the other Poetry tests in this package pass. I could not run TestXrayAuditPoetry, because it needs an Xray server and direct access to pypi.org, which I do not have. I will confirm here when the CI run is done.
devbranch.Problem
Since Poetry 2.0 the default layout declares dependencies in
[project].dependenciesinstead of[tool.poetry.dependencies]. For such projectsjf audit --poetryfails with:Nothing gets scanned. Reproduced on the latest release, JFrog CLI 2.131.0, with Poetry 2.5.1:
poetry new mre && poetry add aiostream && poetry lock && jf audit --poetry.Tests
tests/testdata/projects/package-managers/python/poetry/poetry-pep621-project: the same dependencies aspoetry-project(urllib3 <1.24,django <1.11.16,Werkzeug <0.10), declared in[project].poetry.lockwas generated with Poetry 2.5.1 and passespoetry check --lock.TestBuildPoetryDependencyListPep621(nopoetry install, no Xray). Fails without the fix ([]) and passes with it.TestXrayAuditPoetrynow also runsPEP 621variants of the JSON and Simple JSON cases, with the same expectations aspoetry-project(≥3 vulnerabilities, ≥1 license).jf audit --poetry --licensesagainst a SaaS instance, withjfbuilt from jfrog-climaster+ this fix. The fixtures were installed through an Artifactory PyPI remote, because direct pypi.org access isn't available in my environment, so I couldn't run theTestXrayAuditPoetryharness itself as-is.