Fix copilot upgrade pylib#7121
Conversation
📝 WalkthroughWalkthroughThis 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 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 |
There was a problem hiding this comment.
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 | 🟠 MajorStale cache after
PYTHON_VERSIONbump will silently use the wrong CPython source.When
PYTHON_VERSIONis updated (e.g.,v3.14.3→v3.14.4), the exact cache key misses butrestore-keys: cpython-lib-matches the previous version's cache. Thecpython/Libdirectory 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 +fiNote:
git describe --tags --exact-matchmay 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
Summary by CodeRabbit
Release Notes
Chores