-
Notifications
You must be signed in to change notification settings - Fork 1
Copier update: CI success check #84
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
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 |
|---|---|---|
| @@ -1,21 +1,21 @@ | ||
| ## Link to Issue or Message thread | ||
| ## Link to Issue or Message thread | ||
|
|
||
|
|
||
|
|
||
| ## Why is this change necessary? | ||
| ## Why is this change necessary? | ||
|
|
||
|
|
||
|
|
||
| ## How does this change address the issue? | ||
| ## How does this change address the issue? | ||
|
|
||
|
|
||
|
|
||
| ## What side effects does this change have? | ||
| ## What side effects does this change have? | ||
|
|
||
|
|
||
|
|
||
| ## How is this change tested? | ||
| ## How is this change tested? | ||
|
|
||
|
|
||
|
|
||
| ## Other | ||
| ## Other |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -40,7 +40,7 @@ jobs: | |||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - 3.12.7 | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - 3.13.2 | ||||||||||||||||||||||||||||
| - 3.13.9 | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| copier: [ | ||||||||||||||||||||||||||||
| '--data-file tests/copier_data/data1.yaml', | ||||||||||||||||||||||||||||
|
|
@@ -56,7 +56,7 @@ jobs: | |||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||
| - name: Checkout code | ||||||||||||||||||||||||||||
| uses: actions/checkout@v6.0.1 | ||||||||||||||||||||||||||||
| uses: actions/checkout@v6.0.2 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| persist-credentials: false | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
|
@@ -151,9 +151,14 @@ jobs: | |||||||||||||||||||||||||||
| if: always() | ||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||
| - name: fail if prior job failure | ||||||||||||||||||||||||||||
| if: needs.lint-matrix.result != 'success' | ||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||
| success_pattern="^(skipped|success)$" # these are the possibilities: https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#needs-context | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| if [[ ! "${{ needs.lint-matrix.result }}" =~ $success_pattern ]]; then | ||||||||||||||||||||||||||||
| echo "❌ One or more jobs did not finish with skipped or success" | ||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||
| echo "✅ All jobs finished with skipped or success" | ||||||||||||||||||||||||||||
|
Comment on lines
+155
to
+161
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# First, let's find and examine the ci.yaml file
find . -name "ci.yaml" -o -name "ci.yml" | head -20Repository: LabAutomationAndScreening/copier-python-package-template Length of output: 127 🌐 Web query:
💡 Result: In GitHub Actions, when job B has
Common patterns: jobs:
build:
runs-on: ubuntu-latest
steps:
- run: exit 0
deploy:
needs: build
# Default behavior is effectively success() gating unless you override it
if: ${{ always() && needs.build.result != 'cancelled' }}
runs-on: ubuntu-latest
steps:
- run: echo "build result was ${{ needs.build.result }}"Notes:
Sources: GitHub Actions contexts reference (needs context) [1], job conditions docs (skipped job behavior) [2], expressions/status-check functions docs [3]. 🏁 Script executed: #!/bin/bash
# Test the regex pattern behavior
success_pattern='^(skipped|success)$'
echo "=== Testing regex pattern: $success_pattern ==="
for result in success skipped failure cancelled skipped_by_conditional; do
if [[ ! "$result" =~ $success_pattern ]]; then
outcome="FAILS"
else
outcome="PASSES"
fi
printf '%-25s -> %s\n' "$result" "$outcome"
doneRepository: LabAutomationAndScreening/copier-python-package-template Length of output: 327 🏁 Script executed: #!/bin/bash
# Read the ci.yaml file to understand the workflow structure
wc -l ./.github/workflows/ci.yamlRepository: LabAutomationAndScreening/copier-python-package-template Length of output: 131 🏁 Script executed: #!/bin/bash
# Read the section around the review lines (155-161) plus context
sed -n '1,180p' ./.github/workflows/ci.yaml | cat -nRepository: LabAutomationAndScreening/copier-python-package-template Length of output: 8482 Required-check incorrectly allows upstream failures to be reported as success. When The Fix required- success_pattern="^(skipped|success)$" # these are the possibilities: https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#needs-context
-
- if [[ ! "${{ needs.lint-matrix.result }}" =~ $success_pattern ]]; then
- echo "❌ One or more jobs did not finish with skipped or success"
+ required_pattern="^success$"
+ if [[ ! "${{ needs.get-values.result }}" =~ $required_pattern ]] || [[ ! "${{ needs.lint-matrix.result }}" =~ $required_pattern ]]; then
+ echo "❌ One or more required jobs did not finish with success"
exit 1
fi
- echo "✅ All jobs finished with skipped or success"
+ echo "✅ All required jobs finished with success"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
| - name: Mark updated dependabot hash commit as succeeded | ||||||||||||||||||||||||||||
| if: needs.get-values.outputs.dependabot-commit-created == 'true' | ||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,8 +73,8 @@ dist | |
|
|
||
| # Logs | ||
| *.log | ||
| *.log.* | ||
| **/logs/log*.txt | ||
| **/logs/*.log.* | ||
|
|
||
| # macOS dev cleanliness | ||
| **/.DS_Store | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -76,7 +76,7 @@ python_ci_versions: | |||||||||||||||||||||||||||||||||||||||||||||||||
| multiselect: true | ||||||||||||||||||||||||||||||||||||||||||||||||||
| choices: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - "3.12.7" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - "3.13.2" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - "3.13.9" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
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. Python 3.13.9 is not the latest 3.13.x patch. Python 3.13.10 was released on December 2, 2025, meaning 3.13.9 is one patch behind. Consider whether this should be bumped to 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||
| - "3.14.0" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -143,6 +143,16 @@ use_codecov: | |||||||||||||||||||||||||||||||||||||||||||||||||
| help: Upload code coverage results to CodeCov? | ||||||||||||||||||||||||||||||||||||||||||||||||||
| default: no | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| _tasks: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - command: | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -f ruff.toml ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Updating ruff target-version from python_version..." | ||||||||||||||||||||||||||||||||||||||||||||||||||
| py_major_minor="$(printf '%s' '{{ python_version }}' | cut -d. -f1,2)" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| py_tag="py$(printf '%s' "$py_major_minor" | tr -d '.')" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| sed -i -E 's/^target-version = "py[0-9]+"/target-version = "'"$py_tag"'"/' ruff.toml | ||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "ruff.toml not found; skipping Ruff target-version update." | ||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+146
to
+155
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.
GNU 🐛 Proposed cross-platform fix- sed -i -E 's/^target-version = "py[0-9]+"/target-version = "'"$py_tag"'"/' ruff.toml
+ if sed --version 2>/dev/null | grep -q GNU; then
+ sed -i -E 's/^target-version = "py[0-9]+"/target-version = "'"$py_tag"'"/' ruff.toml
+ else
+ sed -i '' -E 's/^target-version = "py[0-9]+"/target-version = "'"$py_tag"'"/' ruff.toml
+ fiAlternatively, use 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Additional Settings | ||||||||||||||||||||||||||||||||||||||||||||||||||
| _min_copier_version: "9.4" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
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.
Same
curl -sSwithout--failissue as intemplate/.devcontainer/Dockerfile.Apply the same fix here for consistency.
🛠️ Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents