Skip to content

Add automated Python and Docker version update workflow with issue tracking#20

Open
Copilot wants to merge 9 commits intomainfrom
copilot/update-python-docker-workflow
Open

Add automated Python and Docker version update workflow with issue tracking#20
Copilot wants to merge 9 commits intomainfrom
copilot/update-python-docker-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 2, 2026

Python and Docker Update Workflow Implementation

  • Create workflow that creates issue first, then linked PR
  • Add comprehensive duplicate checking for both issues and PRs
  • Fix update detection logic to use git diff
  • Add concurrency control to prevent parallel runs
  • Address all review feedback from first round
  • Address all critical issues from second review
  • Fix final code review issues:
    • Use regex patterns to avoid false positive version detection
    • Use !cancelled() instead of always() for proper workflow handling
  • All tests pass
  • YAML syntax validated
Original prompt

Create a Python and docker update workflow. This workflow will run periodically like every couple of months and it will check for what the latest version of Python is, and it will find the latest version of docker slim image that works with the Python version that we are looking at. That means the latest version that we just acquired. Then, once it patches these two versions into the other workflows it tests to ensure that that version of Python works with all of our current code and that there aren't new errors introduced by a version, and if there are any attempts to fix the errors and make it so that the new python version will work with our code.

The point of this is to keep the doctor image up-to-date so that we are never behind with latest updates as well as to make sure that our code works with the latest versions of Python that come out, even if no new code has been published in quite a while .


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: zaxlofful <33877007+zaxlofful@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Jan 2, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
simplewish 99bec76 Feb 03 2026, 05:45 AM

Copilot AI and others added 2 commits January 2, 2026 11:05
Co-authored-by: zaxlofful <33877007+zaxlofful@users.noreply.github.com>
Co-authored-by: zaxlofful <33877007+zaxlofful@users.noreply.github.com>
Copilot AI changed the title [WIP] Create periodic update workflow for Python and Docker Add automated Python and Docker version update workflow Jan 2, 2026
Copilot AI requested a review from zaxlofful January 2, 2026 11:08
@zaxlofful zaxlofful marked this pull request as ready for review January 2, 2026 23:25
Copilot AI review requested due to automatic review settings January 2, 2026 23:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements automated Python and Docker version updates to keep the repository's dependencies current without manual intervention. The workflow runs every 2 months, detects the latest stable Python version from Docker Hub, updates version references across multiple files, validates changes through comprehensive testing, and automatically creates a pull request if all tests pass.

Key Changes

  • Scheduled automation that queries Docker Hub API for latest Python 3.x slim images and updates Dockerfiles and workflow files
  • Comprehensive validation including linting, pytest, Docker builds, and containerized tests before PR creation
  • Deduplication logic to prevent multiple open update PRs using the python-update label

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 17 comments.

File Description
.github/workflows/update-python-docker.yml New scheduled workflow that orchestrates version detection, file updates, testing, and PR creation with proper deduplication checks
scripts/update_python_version.py Python script that queries Docker Hub API for latest versions, validates Docker image availability, and updates version references in Dockerfiles and workflows
README.md Documentation updates explaining the new automated Python/Docker update workflow, its behavior, schedule, and benefits

Comment on lines +35 to +36
# Look for tags like "3.12-slim", "3.11-slim", etc.
pattern = r'^(\d+\.\d+)-slim$'
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The regex pattern only matches Python versions with format "X.Y" (e.g., "3.12") but Docker Hub may also have patch versions like "3.12.1-slim". Consider whether patch version tags should also be detected, or add a comment explaining why only minor versions are matched. The current implementation would miss more specific version tags.

Suggested change
# Look for tags like "3.12-slim", "3.11-slim", etc.
pattern = r'^(\d+\.\d+)-slim$'
# Look for tags like "3.12-slim", "3.11-slim", and also patch tags like
# "3.12.1-slim". We normalize to the major.minor part (e.g. "3.12").
pattern = r'^(\d+\.\d+)(?:\.\d+)?-slim$'

Copilot uses AI. Check for mistakes.
Comment on lines +45 to +49
# We assume versions 3.8 and above are relevant for this project
# The upper bound is intentionally generous to auto-adopt new
# stable releases; the workflow will test compatibility anyway
major, minor = map(int, version.split('.'))
if major == 3 and 8 <= minor <= 20:
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The upper bound of Python 3.20 for version filtering is arbitrary and may become outdated. When Python 3.21 or higher is released, this script will ignore them until the constant is updated. Consider making this more flexible, such as using a higher bound (e.g., 50) or removing the upper bound check entirely since the workflow tests compatibility anyway. The comment at line 46-47 mentions the bound is "intentionally generous" but 3.20 could be reached within a few years.

Suggested change
# We assume versions 3.8 and above are relevant for this project
# The upper bound is intentionally generous to auto-adopt new
# stable releases; the workflow will test compatibility anyway
major, minor = map(int, version.split('.'))
if major == 3 and 8 <= minor <= 20:
# We assume versions 3.8 and above are relevant for this project;
# the workflow will test compatibility with newer Python 3 releases
# automatically.
major, minor = map(int, version.split('.'))
if major == 3 and minor >= 8:

Copilot uses AI. Check for mistakes.
id: current-version
run: |
# Extract current Python version from build-ci-image.yml
CURRENT_VERSION=$(grep -m1 "python-version:" .github/workflows/build-ci-image.yml | sed -E "s/.*python-version:\s*['\"]?([0-9.]+)['\"]?.*/\1/")
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The sed command for extracting the Python version could fail silently if the format changes. The regex pattern expects optional quotes around the version number, but if the YAML format changes (e.g., using unquoted values consistently), the extraction might produce unexpected results. Consider adding validation to ensure the extracted version matches the expected format (e.g., checking it's not empty and matches \d+.\d+), or use a more robust YAML parser.

Copilot uses AI. Check for mistakes.
Comment on lines +16 to +17
Get the latest stable Python version from python.org.
Returns version string like '3.12' or None on failure.
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The docstring says "Get the latest stable Python version from python.org" but the implementation actually queries Docker Hub API. The docstring should be updated to accurately reflect what the function does.

Suggested change
Get the latest stable Python version from python.org.
Returns version string like '3.12' or None on failure.
Determine the latest stable Python 3.x version by querying Docker Hub
`library/python` tags (e.g. "3.12-slim").
Returns a version string like "3.12" or None on failure.

Copilot uses AI. Check for mistakes.
Comment on lines +22 to +51
result = subprocess.run(
['curl', '-s', 'https://registry.hub.docker.com/v2/repositories/library/python/tags?page_size=100'],
capture_output=True,
text=True,
timeout=30
)
if result.returncode != 0:
print(f"Failed to fetch Docker Hub tags: {result.stderr}")
return None

# Parse JSON response
data = json.loads(result.stdout)

# Look for tags like "3.12-slim", "3.11-slim", etc.
pattern = r'^(\d+\.\d+)-slim$'
versions = []

for tag_info in data.get('results', []):
tag_name = tag_info.get('name', '')
match = re.match(pattern, tag_name)
if match:
version = match.group(1)
# Only include stable Python 3.x versions
# We assume versions 3.8 and above are relevant for this project
# The upper bound is intentionally generous to auto-adopt new
# stable releases; the workflow will test compatibility anyway
major, minor = map(int, version.split('.'))
if major == 3 and 8 <= minor <= 20:
versions.append(version)

Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The Docker Hub API returns paginated results with page_size=100, which may not capture all available Python versions if there are more than 100 tags. While this is unlikely to miss the latest version (which should appear in the first page), consider adding pagination logic or increasing the page size, or document why 100 is sufficient for this use case.

Suggested change
result = subprocess.run(
['curl', '-s', 'https://registry.hub.docker.com/v2/repositories/library/python/tags?page_size=100'],
capture_output=True,
text=True,
timeout=30
)
if result.returncode != 0:
print(f"Failed to fetch Docker Hub tags: {result.stderr}")
return None
# Parse JSON response
data = json.loads(result.stdout)
# Look for tags like "3.12-slim", "3.11-slim", etc.
pattern = r'^(\d+\.\d+)-slim$'
versions = []
for tag_info in data.get('results', []):
tag_name = tag_info.get('name', '')
match = re.match(pattern, tag_name)
if match:
version = match.group(1)
# Only include stable Python 3.x versions
# We assume versions 3.8 and above are relevant for this project
# The upper bound is intentionally generous to auto-adopt new
# stable releases; the workflow will test compatibility anyway
major, minor = map(int, version.split('.'))
if major == 3 and 8 <= minor <= 20:
versions.append(version)
base_url = "https://registry.hub.docker.com/v2/repositories/library/python/tags?page_size=100"
url = base_url
# Look for tags like "3.12-slim", "3.11-slim", etc.
pattern = r'^(\d+\.\d+)-slim$'
versions = []
# Follow pagination to ensure we see all relevant tags, but cap the number
# of pages to avoid unbounded API usage in CI.
max_pages = 10
pages = 0
while url and pages < max_pages:
result = subprocess.run(
['curl', '-s', url],
capture_output=True,
text=True,
timeout=30
)
if result.returncode != 0:
print(f"Failed to fetch Docker Hub tags: {result.stderr}")
return None
# Parse JSON response
data = json.loads(result.stdout)
for tag_info in data.get('results', []):
tag_name = tag_info.get('name', '')
match = re.match(pattern, tag_name)
if match:
version = match.group(1)
# Only include stable Python 3.x versions
# We assume versions 3.8 and above are relevant for this project
# The upper bound is intentionally generous to auto-adopt new
# stable releases; the workflow will test compatibility anyway
major, minor = map(int, version.split('.'))
if major == 3 and 8 <= minor <= 20:
versions.append(version)
url = data.get('next')
pages += 1

Copilot uses AI. Check for mistakes.
Comment on lines +161 to +162
# Push branch
git push origin "$BRANCH_NAME"
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The branch name uses only the Python version (automated/update-python-${NEW_VERSION}), which could cause issues if multiple update attempts are made for the same version (e.g., after a failed PR is closed and the workflow runs again). The git push at line 162 will fail if the branch already exists. Consider either deleting the remote branch first if it exists, using git push --force, or appending a timestamp/run-id to make branch names unique.

Suggested change
# Push branch
git push origin "$BRANCH_NAME"
# Push branch (allow updating existing automation branch if it already exists)
git push --force-with-lease origin "$BRANCH_NAME"

Copilot uses AI. Check for mistakes.
Comment on lines +148 to +160
git commit -m "chore: update Python to version ${NEW_VERSION}

- Update Dockerfile.infra to use python:${NEW_VERSION}-slim
- Update Dockerfile.qr to use python:${NEW_VERSION}-slim
- Update build-ci-image.yml to use Python ${NEW_VERSION}
- Update check-todo.yml to use Python ${NEW_VERSION}

All tests passed:
- Linting: ✓
- Pytest: ✓
- Docker builds: ✓
- Docker tests: ✓"

Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The multi-line commit message has inconsistent indentation. The git commit command at line 148 starts a multi-line string, but lines 150-159 have leading spaces that will be included in the commit message verbatim. This creates a commit message with indented bullet points and text, which may look odd in git log. The indentation should either be removed or adjusted so the commit message renders cleanly.

Suggested change
git commit -m "chore: update Python to version ${NEW_VERSION}
- Update Dockerfile.infra to use python:${NEW_VERSION}-slim
- Update Dockerfile.qr to use python:${NEW_VERSION}-slim
- Update build-ci-image.yml to use Python ${NEW_VERSION}
- Update check-todo.yml to use Python ${NEW_VERSION}
All tests passed:
- Linting:
- Pytest:
- Docker builds:
- Docker tests: ✓"
git commit \
-m "chore: update Python to version ${NEW_VERSION}" \
-m "- Update Dockerfile.infra to use python:${NEW_VERSION}-slim" \
-m "- Update Dockerfile.qr to use python:${NEW_VERSION}-slim" \
-m "- Update build-ci-image.yml to use Python ${NEW_VERSION}" \
-m "- Update check-todo.yml to use Python ${NEW_VERSION}" \
-m "All tests passed:" \
-m "- Linting: ✓" \
-m "- Pytest: ✓" \
-m "- Docker builds: ✓" \
-m "- Docker tests: ✓"

Copilot uses AI. Check for mistakes.
Comment on lines +173 to +195
--body "## Automated Python and Docker Version Update

This PR updates the Python version used across the repository from the current version to **${NEW_VERSION}**.

### Changes Made
- Updated \`.github/ci/Dockerfile.infra\` to use \`python:${NEW_VERSION}-slim\`
- Updated \`.github/ci/Dockerfile.qr\` to use \`python:${NEW_VERSION}-slim\`
- Updated \`.github/workflows/build-ci-image.yml\` to use Python ${NEW_VERSION}
- Updated \`.github/workflows/check-todo.yml\` to use Python ${NEW_VERSION}

### Test Results
All automated tests have passed:
- ✅ Linting (flake8)
- ✅ Unit tests (pytest)
- ✅ Docker image builds
- ✅ Tests in Docker containers

### What to Review
- Verify that all CI workflows pass successfully
- Check that no new deprecation warnings are introduced
- Ensure Docker images build and push correctly

This PR was automatically created by the \`update-python-docker\` workflow." \
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The PR body description has leading indentation on lines 175-195 that will be rendered as part of the PR description. This creates a PR body where all content is indented, which may look unintended. The indentation should be removed so the PR body renders with proper formatting.

Copilot uses AI. Check for mistakes.
Comment on lines +76 to +77
result = subprocess.run(
['docker', 'manifest', 'inspect', f'python:{slim_tag}'],
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The script calls subprocess.run with a command that includes user-controlled data (python_version) in line 77. While python_version is validated through regex in get_latest_python_version, there's no validation if this function is called independently with arbitrary input. Consider adding input validation to ensure python_version matches expected format before using it in the docker command.

Copilot uses AI. Check for mistakes.
"""
workflow_file = repo_root / ".github" / "workflows" / "build-ci-image.yml"
try:
content = workflow_file.read_text()
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The encoding parameter is missing when reading the workflow file. The function calls workflow_file.read_text() without specifying encoding. Best practice is to explicitly specify encoding='utf-8' for consistency.

Copilot uses AI. Check for mistakes.
@zaxlofful
Copy link
Copy Markdown
Owner

@copilot : I have had a change of plan here. This pipeline should identify if a new version of the alpine container or python is available. If so, create an issue (check for duplicates as always) and also create a linked PR with the updates.

Copilot AI and others added 2 commits February 3, 2026 00:50
- Change workflow to create issue first, then linked PR
- Add concurrency control to prevent duplicate runs
- Fix update detection logic using git diff instead of exit codes
- Add Docker availability check in script
- Support patch version tags in regex pattern
- Remove upper bound on Python version filtering
- Add encoding='utf-8' to all file operations
- Improve error handling and input validation
- Use heredoc for multi-line strings in workflow
- Fix commit message formatting
- Add --force-with-lease for branch push

Co-authored-by: zaxlofful <33877007+zaxlofful@users.noreply.github.com>
Co-authored-by: zaxlofful <33877007+zaxlofful@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 3, 2026

@copilot : I have had a change of plan here. This pipeline should identify if a new version of the alpine container or python is available. If so, create an issue (check for duplicates as always) and ...

Done! The workflow now creates an issue first (with duplicate checking) and then creates a linked PR with the updates. The issue documents the available Python version update and test results, while the PR contains the actual code changes and references the issue with "Closes #X". Both issues and PRs are checked for duplicates using the python-update label. Changes are in commit e8dc8ad.

- Fix pipefail handling for git diff exit codes
- Improve force-with-lease error handling and logging
- Add explicit Python 3.x-only check to prevent Python 4.x adoption

Co-authored-by: zaxlofful <33877007+zaxlofful@users.noreply.github.com>
Copilot AI changed the title Add automated Python and Docker version update workflow Add automated Python and Docker version update workflow with issue tracking Feb 3, 2026
@zaxlofful zaxlofful requested a review from Copilot February 3, 2026 02:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +29 to +31
CURRENT_VERSION=$(grep -m1 "python-version:" .github/workflows/build-ci-image.yml | sed -E "s/.*python-version:\s*['\"]?([0-9.]+)['\"]?.*/\1/")
echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
echo "Using Python $CURRENT_VERSION for workflow execution"
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The sed -E expression uses \s*, but GNU/POSIX sed ERE does not support \s as “whitespace”. As written, this will usually fail to match and CURRENT_VERSION becomes the entire line (including spaces), causing actions/setup-python to receive an invalid version string. Use [[:space:]]* (or a simpler parser like awk/python) to reliably extract the version.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit 8b949d9. Changed \s* to [[:space:]]* for POSIX-compatible whitespace matching in sed.

Comment on lines +63 to +65
NEW_VERSION=$(grep -m1 "python-version:" .github/workflows/build-ci-image.yml | sed -E "s/.*python-version:\s*['\"]?([0-9.]+)['\"]?.*/\1/")
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "Updated to Python $NEW_VERSION"
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

Same issue as earlier: sed -E with \s* won’t match whitespace in sed ERE, so NEW_VERSION can become the full python-version: line instead of just the version. This will break downstream steps (branch name, commit message, PR title). Replace \s* with [[:space:]]* (or use a more robust extraction approach).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit 8b949d9. Changed \s* to [[:space:]]* for POSIX-compatible whitespace matching in sed.

Comment on lines +33 to +37
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ steps.current-version.outputs.version }}

Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

This workflow sets up Python using the current version (from build-ci-image.yml) and never re-runs actions/setup-python after updating files. As a result, the venv/lint/pytest steps run on the old Python version, not the newly detected version you’re trying to validate. Add a second actions/setup-python step gated on update_available == 'true' that uses ${{ steps.get-version.outputs.new_version }} before creating the venv and running tests.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit 8b949d9. Added a new "Set up new Python version for testing" step that runs actions/setup-python@v5 with the new version after files are updated, ensuring all tests run with the correct Python version.

Comment on lines +113 to +115
echo "Running pytest in Docker container..."
docker run --rm -v "$PWD:/workspace" -w /workspace test-infra:latest bash -c "python -m venv --system-site-packages .venv && ./.venv/bin/python -m pytest -q"
echo "docker_tests_passed=true" >> $GITHUB_OUTPUT
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

test-infra:latest sets USER ci (see .github/ci/Dockerfile.infra), but this docker run mounts the repo and tries to create .venv inside /workspace. This likely fails due to filesystem permissions (the existing container-based CI workflows run with options: --user 0, e.g. .github/workflows/pytest.yml:19-21). Run the container as root (--user 0) or write the venv to a writable path (e.g. /tmp`) to match established CI behavior.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit 8b949d9. Added --user 0 flag to the docker run command to match the pattern used in other workflows (e.g., pytest.yml).

Comment on lines +298 to +314
- name: Handle test failures
if: |
steps.check-update.outputs.update_available == 'true' &&
(steps.lint-test.outputs.lint_passed != 'true' ||
steps.pytest-test.outputs.tests_passed != 'true' ||
steps.docker-test.outputs.docker_build_passed != 'true' ||
steps.docker-pytest.outputs.docker_tests_passed != 'true')
run: |
echo "❌ Tests failed with the new Python version"
echo "Lint passed: ${{ steps.lint-test.outputs.lint_passed }}"
echo "Pytest passed: ${{ steps.pytest-test.outputs.tests_passed }}"
echo "Docker build passed: ${{ steps.docker-test.outputs.docker_build_passed }}"
echo "Docker tests passed: ${{ steps.docker-pytest.outputs.docker_tests_passed }}"
echo ""
echo "Manual intervention required to fix compatibility issues."
echo "The version update has been applied but not committed."
exit 1
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The “Handle test failures” step won’t run if flake8/pytest/docker build fails, because those steps will terminate the job before this conditional executes. This contradicts the PR description about reporting specific failures. To make this work, mark the test steps continue-on-error: true and gate the failure-reporting step with if: always() && steps.check-update.outputs.update_available == 'true' (then inspect each step’s outcome/outputs).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit 8b949d9. Added continue-on-error: true to all test steps and changed the failure handler to use if: always() with steps.*.outcome == 'failure' checks, ensuring it executes even when tests fail.

Comment on lines +209 to +223
# Update files
changes_made = False
for file_path in files_to_update:
if file_path.exists():
if update_file_content(
file_path,
current_version,
latest_version,
current_docker_tag,
latest_docker_tag
):
changes_made = True
else:
print(f"Warning: File not found: {file_path}")

Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

update_file_content() returns False both when a file truly needs no change and when an exception occurs (or the expected pattern wasn’t found). In main(), any such case is silently tolerated as long as some other file changed, which can produce a partial/inconsistent version update (and a PR that doesn’t update all intended references). Track per-file success and fail the script if any target file is missing or still contains the old version/tag when an update is being applied.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit 8b949d9. Enhanced the update logic to track failed files separately and verify that old versions were actually replaced. The script now fails with a clear error message if any file wasn't updated correctly, preventing partial updates.

@zaxlofful
Copy link
Copy Markdown
Owner

@copilot : Address the new issues raised by the reviewer

- Fix sed regex to use POSIX-compatible [[:space:]] instead of \s
- Add setup-python step to test with NEW version, not old version
- Add --user 0 to Docker run for proper permissions
- Add continue-on-error to test steps for proper failure handling
- Use step.outcome instead of outputs for test result checks
- Add always() condition to failure handler so it runs even after failures
- Improve file update tracking to fail on partial updates
- Check files after update to ensure old version was replaced

Co-authored-by: zaxlofful <33877007+zaxlofful@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 3, 2026

@copilot : Address the new issues raised by the reviewer

All reviewer issues have been addressed in commit 8b949d9:

  1. Fixed sed regex to use POSIX-compatible [[:space:]]
  2. Added setup-python step to test with the new Python version
  3. Fixed Docker container permissions with --user 0
  4. Added continue-on-error and always() for proper failure handling
  5. Enhanced file update validation to prevent partial updates

- Use regex patterns to check for old versions instead of substring matches
- Prevents false positives when new version contains old version as substring
- Change always() to !cancelled() in failure handler to avoid running on cancellation

Co-authored-by: zaxlofful <33877007+zaxlofful@users.noreply.github.com>
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.

3 participants