Skip to content

Fix copilot upgrade pylib#7121

Merged
youknowone merged 2 commits intoRustPython:mainfrom
youknowone:copilot-workflow
Feb 14, 2026
Merged

Fix copilot upgrade pylib#7121
youknowone merged 2 commits intoRustPython:mainfrom
youknowone:copilot-workflow

Conversation

@youknowone
Copy link
Member

@youknowone youknowone commented Feb 14, 2026

Summary by CodeRabbit

Release Notes

Chores

  • Enhanced CI/CD workflows with dependency caching to reduce build execution time
  • Updated workflow automation infrastructure

@youknowone youknowone marked this pull request as ready for review February 14, 2026 04:05
@youknowone youknowone enabled auto-merge (squash) February 14, 2026 04:05
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 14, 2026

📝 Walkthrough

Walkthrough

This pull request migrates the upgrade-pylib workflow from Claude/Anthropic-based tooling to GitHub Copilot. The changes systematically replace Claude engine identifiers, secrets, CLI setup, environment variables, and output parsing with Copilot equivalents. Additionally, cache configuration is introduced to the upgrade workflow to optimize CPython source handling.

Changes

Cohort / File(s) Summary
Workflow Engine Migration
.github/workflows/upgrade-pylib.lock.yml
Comprehensive rewrite switching from Claude to Copilot tooling: engine/model identifiers updated, concurrency groups renamed, secret handling migrated from CLAUDE_CODE_OAUTH_TOKEN/ANTHROPIC_API_KEY to COPILOT_GITHUB_TOKEN, CLI setup replaced (Claude Code CLI → GitHub Copilot CLI), output parsing adjusted, environment variables reconfigured, MCP gateway and safe-outputs configuration updated, and log/artifact collection modified for Copilot session state.
Workflow Configuration & Caching
.github/workflows/upgrade-pylib.md
Engine field switched from claude to copilot, new cache configuration block added with key, path, and restore-keys for CPython source, and upgrade step logic modified to conditionally clone CPython only if not cached (check for cpython/Lib existence).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 The agents dance, from Claude to Copilot's call,
Secrets swapped and caches stored, workflow's all,
Logs now whisper Copilot's tune,
Where CPython's cached, upgrade blooms soon! 🚀

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Fix copilot upgrade pylib' is vague and uses generic language that doesn't clearly convey the scope of changes made in this PR. Consider a more specific title that describes the primary change, such as 'Migrate upgrade-pylib workflow from Claude to GitHub Copilot' or 'Update pylib upgrade workflow to use Copilot instead of Claude'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/upgrade-pylib.md (1)

48-72: ⚠️ Potential issue | 🟠 Major

Stale cache after PYTHON_VERSION bump will silently use the wrong CPython source.

When PYTHON_VERSION is updated (e.g., v3.14.3v3.14.4), the exact cache key misses but restore-keys: cpython-lib- matches the previous version's cache. The cpython/Lib directory will exist from the old version, so the clone is skipped entirely — the agent silently operates on stale CPython sources.

Add a version check so the clone runs when the cached checkout doesn't match the desired tag:

🐛 Proposed fix: verify cached version matches
-if [ -d "cpython/Lib" ]; then
-    echo "CPython cache hit, skipping clone"
-else
-    git clone --depth 1 --branch "$PYTHON_VERSION" https://github.com/python/cpython.git cpython
-fi
+if [ -d "cpython/Lib" ] && git -C cpython describe --tags --exact-match 2>/dev/null | grep -qF "$PYTHON_VERSION"; then
+    echo "CPython cache hit for $PYTHON_VERSION, skipping clone"
+else
+    rm -rf cpython
+    git clone --depth 1 --branch "$PYTHON_VERSION" https://github.com/python/cpython.git cpython
+fi

Note: git describe --tags --exact-match may not work on a shallow clone without the tag fetched. An alternative is to persist the version in a marker file:

if [ -d "cpython/Lib" ] && [ "$(cat cpython/.cached_version 2>/dev/null)" = "$PYTHON_VERSION" ]; then
    echo "CPython cache hit for $PYTHON_VERSION, skipping clone"
else
    rm -rf cpython
    git clone --depth 1 --branch "$PYTHON_VERSION" https://github.com/python/cpython.git cpython
    echo "$PYTHON_VERSION" > cpython/.cached_version
fi

@youknowone youknowone disabled auto-merge February 14, 2026 04:47
@youknowone youknowone merged commit dd422a8 into RustPython:main Feb 14, 2026
13 checks passed
@youknowone youknowone deleted the copilot-workflow branch February 14, 2026 04:47
@coderabbitai coderabbitai bot mentioned this pull request Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants