Repository navigation
Feat: Warn when a Python project skips resolution - #183
Merged
ModeSevenIndustrialSolutions merged 2 commits intoNov 1, 2026
Merged
ModeSevenIndustrialSolutions merged 2 commits into
ModeSevenIndustrialSolutions merged 2 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The diagnostic step fails when an unused path_prefix directory does not exist, preventing valid scans from running unless the step is made non-fatal.
1 open issue
What changed in this PR
This PR addresses #182 by warning when the Sonatype Lifecycle lane scans a Python project without dependency resolution, helping callers recognize scans that may evaluate few or no dependencies.
Changes:
- Adds a targeted warning and step summary recommending Python resolution mode.
- Adds generated-fixture tests and runs them in the workflow test job.
- Documents the warning conditions and verified Python scan behavior.
| File | Description |
|---|---|
tests/python-warning-steps.sh |
Tests warning conditions, output, and step placement. |
docs/BRIEF.md |
Explains the warning and records verified scan behavior. |
.github/workflows/workflow-tests.yaml |
Runs the new Python warning tests. |
.github/workflows/sonatype-lifecycle.yaml |
Detects unresolved Python projects and emits guidance. |
Review effort: Balanced
5 tasks
A Python project scanned with the default build_type 'none' passes green while Nexus IQ evaluates few or none of its dependencies: it cannot read pyproject.toml, setup.py or uv.lock, and reads only the '==' lines of requirements.txt. Both of the organisation's own uv callers scan that way and reported 0 and 4 components. Add a step to the scan job that, when scan_targets is left at '.', the project holds Python metadata and no poetry.lock or Pipfile.lock, emits a warning annotation and step summary naming the files found and recommending build_type 'python'. It always exits 0, so existing callers keep working. The step enters path_prefix itself, passed through env, and exits 0 when it names no directory, rather than setting working-directory: GitHub fails a step whose working directory is missing before its script runs, and 'none' mode never uses path_prefix, so a caller may leave it naming nothing. continue-on-error is avoided because it would also report a genuine bug in the step as a pass. Review of PR lfreleng-actions#183, round 1: Copilot found that a nonexistent path_prefix failed the step through its working-directory. Fixed as the maintainer asked, with harness cases for a missing PATH_PREFIX, for the default '.', and for the step setting no working-directory. The cases run from a new tests/python-warning-steps.sh, wired into the Workflow step tests job, because tests/workflow-steps.sh is an executable file this change could not edit. Co-authored-by: Copilot <[email protected]> Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>
Note beside D24 that the CLM lane now warns when a Python project is scanned with build_type 'none', why it warns rather than fails, why it enters path_prefix itself and stays silent when that is missing, and the two facts verified on 2026-11-01: Python mode yields exact components on the live server, and dirExcludes=**/.* does not exclude a dot-directory scan target. Co-authored-by: Copilot <[email protected]> Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>
lf-releng-code-monkey-bot
Bot
force-pushed
the
code-monkey/issue-182
branch
from
November 1, 2026 19:19
9981ebe to
9afa1bb
Compare
ModeSevenIndustrialSolutions
approved these changes
Nov 1, 2026
ModeSevenIndustrialSolutions
merged commit Nov 1, 2026
1e51855
into
lfreleng-actions:main
12 checks passed
5 tasks
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.

Closes #182
Authored by an AI agent; human review required
claude-opus-5.5via GitHub Copilot CLI378fcc19ebdf37f17fde4888d4b71c83b21d6cf3bash tests/python-warning-steps.shbash tests/workflow-steps.shzizmor --persona auditor .github/workflows/prek run --files .github/workflows/sonatype-lifecycle.yaml tests/python-warning-steps.sh docs/BRIEF.mdaislop scan --changes --base 378fcc19ebdf37f17fde4888d4b71c83b21d6cf3 --json .gitlint --commits 378fcc19ebdf37f17fde4888d4b71c83b21d6cf3..HEADThe
github-code-monkey-botworkflow opened this pull request.Nobody has merged it; a maintainer must review it first.
Review findings on this pull request are answered by a later revision round of this workflow, up to ten rounds; a maintainer must act on any finding that remains after that, and reviews every round before merge.
Round 1 of revision, on its base.
Adds a non-fatal step to the
scanjob ofsonatype-lifecycle.yaml,Check for an unresolved Python project. It warns when a Python project is scanned with the defaultbuild_type: 'none', because Nexus IQ then evaluates few or none of its dependencies (#182).What it does
build_typeisnone. It sits after both checkout steps and beforeSonatype Lifecycle scan.path_prefixitself, which it receives throughenv:. It sets noworking-directory:and exits 0 whenpath_prefixnames no directory.scan_targetsis., the directory holdspyproject.toml,setup.py,setup.cfg,uv.lockorrequirements.txt, and the directory holds neitherpoetry.locknorPipfile.lock.::warningannotation and the same text in the step summary. The text names the files found and recommendsbuild_type: 'python'withpython_version. The step always exits 0.docs/BRIEF.mdrecords the warning, why it does not fail the job, and the two facts verified on 2026-11-01.This round
path_prefixfailed the step throughworking-directory:before the script could exit 0. Following the maintainer's instruction, the step no longer setsworking-directory:and does not usecontinue-on-error. It now runscd -- "${PATH_PREFIX}" 2> /dev/null || exit 0.PATH_PREFIXpasses with no warning; the defaultPATH_PREFIX=.warns; the step sets noworking-directory;PATH_PREFIXis passed throughenv. The harness now runs the step from a directory other than the project, so it confirms the step entersPATH_PREFIXitself. Against the old step, 21 of the 36 cases fail.Checks run
bash tests/python-warning-steps.sh: 36 cases passedbash tests/workflow-steps.sh: 112 cases passedzizmor --persona auditor .github/workflows/: no findingsprek run --fileson the three changed files: passedaislop scan --changes --base <base>: no diagnosticsgitlint --commits <base>..HEAD: passedFor the reviewer
tests/python-warning-steps.sh, not intests/workflow-steps.sh, because that file is executable and this workflow cannot edit executable files. Moving the cases into it is a mechanical follow-up.