-
Notifications
You must be signed in to change notification settings - Fork 27
Fix CI/CD workflow false negatives for LICENSE detection and Poetry builds #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: hyp3ri0n-ng <3106718+hyp3ri0n-ng@users.noreply.github.com>
Co-authored-by: hyp3ri0n-ng <3106718+hyp3ri0n-ng@users.noreply.github.com>
Co-authored-by: hyp3ri0n-ng <3106718+hyp3ri0n-ng@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2d6a23e07e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if [ -f "pyproject.toml" ] && grep -q 'tool.poetry' pyproject.toml; then | ||
| uto-amazonq-review.properties.json | ||
| if pip install poetry; then | ||
| uto-amazonq-review.properties.json | ||
| poetry install && echo "BUILD_SUCCESS=true" >> $GITHUB_OUTPUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fall back when Poetry install fails
In the build step, once pyproject.toml contains tool.poetry, this branch always executes; if pip install poetry fails (e.g., transient PyPI/network issues or a constrained runner), the script only logs a warning and never reaches the requirements.txt or setup.py branches because the outer if already matched. Repos that ship both Poetry metadata and a requirements.txt fallback will now be reported as BUILD_SUCCESS=false even though the requirements-based build could still succeed, which is a regression compared to the prior behavior.
Useful? React with 👍 / 👎.
| uto-amazonq-review.properties.json | ||
| echo "⚠️ Poetry installation failed, skipping Poetry build" | ||
| uto-amazonq-review.properties.json | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Poetry failure prevents fallback to alternative build methods
Low Severity
When pyproject.toml with tool.poetry is detected but Poetry installation fails (line 505), the code prints a warning and exits the block, but the elif structure means requirements.txt and setup.py fallbacks are never attempted. For repositories that have both Poetry configuration and requirements.txt as backup, if pip install poetry fails due to environment constraints, BUILD_SUCCESS remains false even though the fallback could have worked. This could cause the same type of false negatives the PR aims to fix.
The CI/CD review workflow incorrectly reported missing documentation files and build failures due to hardcoded assumptions about file naming and Python build tooling.
Changes
LICENSE detection: Check for both
LICENSEandLICENSE.md, preferring whichever existsPoetry build support: Detect
pyproject.tomlwith Poetry config and install dependencies accordinglyPython build precedence: Poetry → requirements.txt → setup.py with proper error handling
This eliminates false negatives for repositories using standard LICENSE naming (no extension) and modern Python packaging (Poetry).
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Note
Improves the CI review workflow to avoid false negatives in docs and Python builds.
LICENSE.mdto accept eitherLICENSEorLICENSE.md, reporting asLICENSEwith word countpyproject.tomlwithtool.poetry, installs Poetry, runspoetry install; falls back torequirements.txt, thensetup.py(pip install -e .)Written by Cursor Bugbot for commit 2d6a23e. Configure here.