Unify python version used by CI. Update to 3.14.4#7571
Unify python version used by CI. Update to 3.14.4#7571ShaharNaveh wants to merge 3 commits intoRustPython:mainfrom
3.14.4#7571Conversation
📝 WalkthroughWalkthroughWorkflows removed hardcoded Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| ## Summary | ||
|
|
||
| Check \`scripts/update_lib\` for tools. As a note, the current latest Python version is \`${{ env.PYTHON_VERSION }}\`. | ||
| Check \`scripts/update_lib\` for tools. As a note, the current latest Python version is \`${{ steps.cpython-version.outputs.version }}\`. |
| <!-- | ||
| Quick guideline for Copilot: | ||
| # Clone \`github.com/python/cpython\` \`${{ env.PYTHON_VERSION }}\` tag under RustPython working dir with depth 1 option; never 3.14.0 or 3.14.1 or 3.14.2 | ||
| # Clone \`github.com/python/cpython\` \`${{ steps.cpython-version.outputs.version }}\` tag under RustPython working dir with depth 1 option; never 3.14.0 or 3.14.1 or 3.14.2 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/update-libs-status.yaml:
- Around line 33-37: The workflow step "Get target CPython version" fails
because it runs cat .python-version from the repository root while the code is
checked out under rustpython/, so update the command that sets version=$(cat
.python-version) to read the correct path (e.g., version=$(cat
rustpython/.python-version) or use the GitHub workspace variable) in that step
so the file is found and the CPython version is emitted to GITHUB_OUTPUT; change
the occurrence of ".python-version" in that step to "rustpython/.python-version"
(or equivalent workspace-aware path).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: c5f5c75a-6f14-46cd-a80e-6f989adb2d5e
📒 Files selected for processing (7)
.github/workflows/ci.yaml.github/workflows/cron-ci.yaml.github/workflows/lib-deps-check.yaml.github/workflows/update-libs-status.yaml.github/workflows/upgrade-pylib.md.gitignore.python-version
💤 Files with no reviewable changes (2)
- .gitignore
- .github/workflows/ci.yaml
There was a problem hiding this comment.
♻️ Duplicate comments (1)
.github/workflows/update-libs-status.yaml (1)
33-37:⚠️ Potential issue | 🟠 MajorTemplate expansion in heredoc is still shell-injection prone.
Line 65 and Line 72 insert
${{ steps.cpython-version.outputs.version }}into an unquoted heredoc (<<EOF). If.python-versionever contains shell substitution text, bash will evaluate it while rendering the heredoc body. Please validate the version format at source (Line 33-37) before exporting it.🔧 Minimal hardening patch
- name: Get target CPython version id: cpython-version run: | - version=$(cat rustpython/.python-version) + version="$(tr -d '\r\n' < rustpython/.python-version)" + if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Invalid .python-version: $version" >&2 + exit 1 + fi echo "version=${version}" >> "$GITHUB_OUTPUT"In bash, does a here-document with an unquoted delimiter (<<EOF) perform command substitution on content like $(...)?Also applies to: 65-72
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/update-libs-status.yaml around lines 33 - 37, The step with id "cpython-version" currently reads rustpython/.python-version into the variable "version" and writes it to GITHUB_OUTPUT without validation; validate/sanitize "version" before exporting (e.g., allow only a strict pattern such as digits and dots or semver characters), reject or normalize any input containing shell metacharacters like $, `, ;, |, or backslashes, and only echo the validated value to "$GITHUB_OUTPUT"; keep the step id "cpython-version" and the "version" variable but add a regex check and fail or sanitize on mismatch so downstream uses (including unquoted heredocs) cannot trigger shell substitution.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In @.github/workflows/update-libs-status.yaml:
- Around line 33-37: The step with id "cpython-version" currently reads
rustpython/.python-version into the variable "version" and writes it to
GITHUB_OUTPUT without validation; validate/sanitize "version" before exporting
(e.g., allow only a strict pattern such as digits and dots or semver
characters), reject or normalize any input containing shell metacharacters like
$, `, ;, |, or backslashes, and only echo the validated value to
"$GITHUB_OUTPUT"; keep the step id "cpython-version" and the "version" variable
but add a regex check and fail or sanitize on mismatch so downstream uses
(including unquoted heredocs) cannot trigger shell substitution.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 8295493e-fa96-47c0-8098-abc00c54e769
📒 Files selected for processing (1)
.github/workflows/update-libs-status.yaml
fix #7570
Summary by CodeRabbit