-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -328,7 +328,25 @@ uto-amazonq-review.properties.json | |
| uto-amazonq-review.properties.json | ||
| for doc in README.md CONTRIBUTING.md LICENSE.md CHANGELOG.md CODE_OF_CONDUCT.md SECURITY.md; do | ||
| uto-amazonq-review.properties.json | ||
| if [ -f "$doc" ]; then | ||
| # Check for both LICENSE and LICENSE.md | ||
| uto-amazonq-review.properties.json | ||
| if [ "$doc" = "LICENSE.md" ]; then | ||
| uto-amazonq-review.properties.json | ||
| if [ -f "LICENSE.md" ] || [ -f "LICENSE" ]; then | ||
| uto-amazonq-review.properties.json | ||
| license_file=$([ -f "LICENSE.md" ] && echo "LICENSE.md" || echo "LICENSE") | ||
| uto-amazonq-review.properties.json | ||
| word_count=$(wc -w < "$license_file" 2>/dev/null || echo 0) | ||
| uto-amazonq-review.properties.json | ||
| echo "✅ LICENSE ($word_count words)" >> /tmp/review-results/documentation.md | ||
| uto-amazonq-review.properties.json | ||
| else | ||
| uto-amazonq-review.properties.json | ||
| echo "❌ LICENSE (missing)" >> /tmp/review-results/documentation.md | ||
| uto-amazonq-review.properties.json | ||
| fi | ||
| uto-amazonq-review.properties.json | ||
| elif [ -f "$doc" ]; then | ||
| uto-amazonq-review.properties.json | ||
| word_count=$(wc -w < "$doc" 2>/dev/null || echo 0) | ||
| uto-amazonq-review.properties.json | ||
|
|
@@ -476,11 +494,35 @@ uto-amazonq-review.properties.json | |
| uto-amazonq-review.properties.json | ||
|
|
||
| uto-amazonq-review.properties.json | ||
| # Python | ||
| # Python - Try in order of precedence: Poetry > requirements.txt > setup.py | ||
| uto-amazonq-review.properties.json | ||
| # This ensures modern Python projects using Poetry are built correctly | ||
| uto-amazonq-review.properties.json | ||
| # Python - Poetry | ||
| uto-amazonq-review.properties.json | ||
| if [ -f "requirements.txt" ]; then | ||
| 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 | ||
| uto-amazonq-review.properties.json | ||
| else | ||
| 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 commentThe reason will be displayed to describe this comment to others. Learn more. Poetry failure prevents fallback to alternative build methodsLow Severity When Additional Locations (1) |
||
| uto-amazonq-review.properties.json | ||
| # Python - requirements.txt | ||
| uto-amazonq-review.properties.json | ||
| elif [ -f "requirements.txt" ]; then | ||
| uto-amazonq-review.properties.json | ||
| pip install -r requirements.txt && echo "BUILD_SUCCESS=true" >> $GITHUB_OUTPUT | ||
| uto-amazonq-review.properties.json | ||
| # Python - setup.py | ||
| uto-amazonq-review.properties.json | ||
| elif [ -f "setup.py" ]; then | ||
| uto-amazonq-review.properties.json | ||
| pip install -e . && echo "BUILD_SUCCESS=true" >> $GITHUB_OUTPUT | ||
| uto-amazonq-review.properties.json | ||
| fi | ||
| uto-amazonq-review.properties.json | ||
|
|
||
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.
In the build step, once
pyproject.tomlcontainstool.poetry, this branch always executes; ifpip install poetryfails (e.g., transient PyPI/network issues or a constrained runner), the script only logs a warning and never reaches therequirements.txtorsetup.pybranches because the outerifalready matched. Repos that ship both Poetry metadata and arequirements.txtfallback will now be reported asBUILD_SUCCESS=falseeven though the requirements-based build could still succeed, which is a regression compared to the prior behavior.Useful? React with 👍 / 👎.