Skip to content

fix(container): fix GHCR PR tag cleanup credentials, pagination, error logging, and shared-tag safety - #1331

Merged
myakove merged 2 commits into
mainfrom
fix/issue-1330-ghcr-pr-tag-cleanup
Nov 26, 2026
Merged

myakove merged 2 commits into
mainfrom
fix/issue-1330-ghcr-pr-tag-cleanup

Conversation

@myakove

@myakove myakove commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

Closes #1330

Summary

  • Use container_repository_password via get_github_client() for GHCR Packages REST API calls in PullRequestHandler._delete_ghcr_tag_via_github_api, closing the client in finally: and falling back to self.github_webhook.github_api only when unset.
  • Paginate GET /{scope}/{owner}/packages/container/{package_name}/versions with per_page=100 until an empty or short page is returned, keeping orgs -> users 404 fallback and deduplicating version IDs across page boundaries.
  • Skip deleting any package version that shares additional tags (such as latest, release tags, or other pr-* tags) and log a warning instead; post the PR removal comment only when a version was actually deleted.
  • Log ex.status and redacted ex.data on GithubException failures (and redacted error text on generic exceptions) respecting mask_sensitive.
  • Update docs/configuration-reference.md and docs/set-up-checks-and-release-workflows.md, and add unit tests covering credential selection/fallback, multi-page pagination, deduplication, shared-tag preservation, and secret redaction.

Verification

  • uvx prek run --all-files: passed (all 20 hooks)
  • uvx tox: passed (unused-code OK, unittests: 2496 passed, 91.59% coverage)
  • Live multi-worker container E2E against myk-org/for-testing-only: pending post-Qodo approval

Assisted-by: PI (gemini-4-neon)

…red tags in GHCR PR tag cleanup

- Authenticate GHCR Packages API requests in `_delete_ghcr_tag_via_github_api` with `container_repository_password` (closing the temporary PyGithub client in `finally`), falling back to `github_api` only when unset
- Paginate `GET /{scope}/{owner}/packages/container/{package_name}/versions` with `per_page=100` until an empty or short page is returned, deduplicating version IDs across pages
- Skip deleting any package version sharing additional tags (e.g. `latest`, release tags, or other PR tags) and log a warning instead
- Include HTTP status and redacted response data in `GithubException` error logs
- Update operator docs and add unit tests covering credentials, pagination, shared-tag safety, and secret redaction

Fixes #1330

Assisted-by: PI (gemini-4-neon)
Signed-off-by: Meni Yakove <myakove@gmail.com>
@deadlock1bot

Copy link
Copy Markdown

Report bugs in Issues

Welcome! 🎉

This pull request will be automatically processed with the following features:

🔄 Automatic Actions

  • Reviewer Assignment: Reviewers are automatically assigned based on the OWNERS file in the repository root
  • Size Labeling: PR size labels (XS, S, M, L, XL, XXL) are automatically applied based on changes
  • Issue Creation: Disabled for this repository
  • Pre-commit Checks: pre-commit runs automatically if .pre-commit-config.yaml exists
  • Branch Labeling: Branch-specific labels are applied to track the target branch
  • Auto-verification: Auto-verified users have their PRs automatically marked as verified
  • Labels: All label categories are enabled (default configuration)

📋 Available Commands

PR Status Management

  • /wip - Mark PR as work in progress (adds WIP: prefix to title)
  • /wip cancel - Remove work in progress status
  • /hold - Block PR merging (PR author or approvers)
  • /hold cancel - Unblock PR merging (PR author or approvers)
  • /verified - Mark PR as verified
  • /verified cancel - Remove verification status
  • /reprocess - Trigger complete PR workflow reprocessing (useful if webhook failed or configuration changed)
  • /regenerate-welcome - Regenerate this welcome message
  • /security-override - Set security check runs to pass (maintainers only)
  • /security-override cancel - Re-run security checks

Review & Approval

  • /lgtm - Approve changes (looks good to me)
  • /approve - Approve PR (approvers only)
  • /automerge - Enable automatic merging when all requirements are met (effective maintainers and approvers only)
  • /automerge cancel - Remove automerge label (effective maintainers and approvers only)
  • /assign-reviewers - Assign reviewers based on OWNERS file
  • /assign-reviewer @username - Assign specific reviewer
  • /check-can-merge - Check if PR meets merge requirements

Testing & Validation

  • /retest tox - Run Python test suite with tox
  • /retest build-container - Rebuild and test container image
  • /retest python-module-install - Test Python package installation
  • /retest pre-commit - Run pre-commit hooks and checks
  • /retest conventional-title - Validate commit message format
  • /retest all - Run all available tests

Container Operations

  • /build-and-push-container - Build and push container image (tagged with PR number)
    • Supports additional build arguments: /build-and-push-container --build-arg KEY=value

Cherry-pick Operations

  • /cherry-pick <branch> - Schedule cherry-pick to target branch when PR is merged
    • Multiple branches: /cherry-pick branch1 branch2 branch3
  • /cherry-pick-retry <branch> - Retry a failed cherry-pick (merged PRs only)

Branch Management

  • /rebase - Rebase this PR branch onto its base branch

Label Management

  • /<label-name> - Add a label to the PR
  • /<label-name> cancel - Remove a label from the PR

✅ Merge Requirements

This PR will be automatically approved when the following conditions are met:

  1. Approval: /approve from at least one approver
  2. LGTM Count: Minimum 1 /lgtm from reviewers
  3. Status Checks: All required status checks must pass
  4. No Blockers: No wip, hold, has-conflicts labels and PR must be mergeable (no conflicts)
  5. Verified: PR must be marked as verified

📊 Review Process

Approvers and Reviewers

Approvers:

  • myakove
  • rnetser

Reviewers:

  • myakove
  • rnetser
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
  • automerge
AI Features
  • Conventional Title: Mode: fix (EnMaaS/rits/deepseek-ai/DeepSeek-V4.1-Flash-1017)
  • Cherry-Pick Conflict Resolution: Enabled (EnMaaS/rits/deepseek-ai/DeepSeek-V4.1-Flash-1017)
Security Checks
  • Suspicious Path Detection: Monitors paths: .claude/, .vscode/, .cursor/, .devcontainer/, .pi/, .github/workflows/, .github/actions/
  • Committer Identity Check: Verifies last committer matches PR author
  • Mandatory: Security checks block merge (use /security-override to bypass — maintainers only)

💡 Tips

  • WIP Status: Use /wip when your PR is not ready for review
  • Verification: The verified label is removed on new commits unless the push is detected as a clean rebase
  • Cherry-picking: Cherry-pick labels are processed when the PR is merged
  • Container Builds: Container images are automatically tagged with the PR number
  • Permission Levels: Some commands require approver permissions
  • Auto-verified Users: Certain users have automatic verification and merge privileges

For more information, please refer to the project documentation or contact the maintainers.

@qodo-code-review

qodo-code-review Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Fix GHCR PR tag cleanup credentials, pagination, and shared-tag safety

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Use container credentials for GHCR cleanup, with webhook-token fallback when unset.
• Search all package versions and preserve versions carrying other tags.
• Improve failure diagnostics and document cleanup permissions and behavior.
Merge Risk 🟡 Medium

Blast radius 🟢 Low 💥 1 capability

  • 1 affected end-to-end capability after fault-specific containment; implementation boundaries do not widen its functional scope.
  • The closed-pull-request caller reaches one end-to-end GHCR cleanup operation that reads package-version state and may delete the temporary PR version.
  • Credential selection, pagination, tag inspection, deletion, notification, and client closure are implementation steps within this bounded integration, not independent user or system outcomes.
Sources

webhook_server/libs/handlers/pull_request_handler.py[1022-1034]

        container_token = (self.github_webhook.container_repository_password or "").strip()
        redact_values = [secret for secret in (container_token, self.github_webhook.token) if secret]

        ghcr_client: Github | None = None
        try:
            if container_token:
                ghcr_client = get_github_client(container_token)
                requester = ghcr_client.requester
            elif self.github_webhook.github_api and self.github_webhook.token:
                requester = self.github_webhook.github_api.requester
            else:
                self.logger.error(f"{self.log_prefix} GitHub API or token not available for tag deletion")
                return

webhook_server/libs/handlers/pull_request_handler.py[1082-1098]

            _scan_page(page_versions)

            page = 1
            while len(page_versions) >= per_page and not matching_versions:
                page += 1
                _, next_page = await github_api_call(
                    requester.requestJsonAndCheck,
                    "GET",
                    f"{package_api_base}/versions",
                    parameters={"per_page": per_page, "page": page},
                    logger=self.logger,
                    log_prefix=self.log_prefix,
                )
                page_versions = next_page or []
                if not page_versions:
                    break
                _scan_page(page_versions)

webhook_server/libs/handlers/pull_request_handler.py[1104-1135]

            deleted_any = False
            for version_id, version_tags in matching_versions:
                other_tags = [tag for tag in version_tags if tag != pr_tag]
                if other_tags:
                    self.logger.warning(
                        f"{self.log_prefix} Skipping deletion of GHCR package version {version_id} for "
                        f"{repository_full_tag} because it is shared with other tags: {other_tags}"
                    )
                    continue

                # Delete the package version
                # DELETE /{scope}/{owner}/packages/{package_type}/{package_name}/versions/{package_version_id}
                delete_url = f"{package_api_base}/versions/{version_id}"
                try:
                    await github_api_call(
                        requester.requestJsonAndCheck,
                        "DELETE",
                        delete_url,
                        logger=self.logger,
                        log_prefix=self.log_prefix,
                    )
                    deleted_any = True
                except GithubException as ex:
                    if ex.status == 404:
                        # Version already deleted or doesn't exist
                        self.logger.warning(
                            f"{self.log_prefix} Package version {version_id} not found (may have been already deleted)"
                        )
                    else:
                        raise

            if deleted_any:
Behavioral complexity 🟡 Medium 🧩 Interacting branches, Compatibility cases

  • Before: matching versions were collected across all inspected pages before deletion.
  • After: pagination stops at the first match, while shared-tag filtering, credential fallback, deletion outcomes, redaction, and client closure remain.
  • New correctness condition: early termination must not hide a later eligible version when the first match is shared or duplicated.
Sources

webhook_server/libs/handlers/pull_request_handler.py[1022-1034]

        container_token = (self.github_webhook.container_repository_password or "").strip()
        redact_values = [secret for secret in (container_token, self.github_webhook.token) if secret]

        ghcr_client: Github | None = None
        try:
            if container_token:
                ghcr_client = get_github_client(container_token)
                requester = ghcr_client.requester
            elif self.github_webhook.github_api and self.github_webhook.token:
                requester = self.github_webhook.github_api.requester
            else:
                self.logger.error(f"{self.log_prefix} GitHub API or token not available for tag deletion")
                return

webhook_server/libs/handlers/pull_request_handler.py[1082-1098]

            _scan_page(page_versions)

            page = 1
            while len(page_versions) >= per_page and not matching_versions:
                page += 1
                _, next_page = await github_api_call(
                    requester.requestJsonAndCheck,
                    "GET",
                    f"{package_api_base}/versions",
                    parameters={"per_page": per_page, "page": page},
                    logger=self.logger,
                    log_prefix=self.log_prefix,
                )
                page_versions = next_page or []
                if not page_versions:
                    break
                _scan_page(page_versions)

webhook_server/libs/handlers/pull_request_handler.py[1104-1135]

            deleted_any = False
            for version_id, version_tags in matching_versions:
                other_tags = [tag for tag in version_tags if tag != pr_tag]
                if other_tags:
                    self.logger.warning(
                        f"{self.log_prefix} Skipping deletion of GHCR package version {version_id} for "
                        f"{repository_full_tag} because it is shared with other tags: {other_tags}"
                    )
                    continue

                # Delete the package version
                # DELETE /{scope}/{owner}/packages/{package_type}/{package_name}/versions/{package_version_id}
                delete_url = f"{package_api_base}/versions/{version_id}"
                try:
                    await github_api_call(
                        requester.requestJsonAndCheck,
                        "DELETE",
                        delete_url,
                        logger=self.logger,
                        log_prefix=self.log_prefix,
                    )
                    deleted_any = True
                except GithubException as ex:
                    if ex.status == 404:
                        # Version already deleted or doesn't exist
                        self.logger.warning(
                            f"{self.log_prefix} Package version {version_id} not found (may have been already deleted)"
                        )
                    else:
                        raise

            if deleted_any:

webhook_server/libs/handlers/pull_request_handler.py[1148-1179]

        except GithubException as ex:
            redacted_data = _redact_secrets(
                str(ex.data),
                redact_values,
                mask_sensitive=self.github_webhook.mask_sensitive,
            )
            redacted_tb = _redact_secrets(
                traceback.format_exc(),
                redact_values,
                mask_sensitive=self.github_webhook.mask_sensitive,
            )
            self.logger.error(
                f"{self.log_prefix} Failed to delete GHCR tag: {repository_full_tag} "
                f"(status={ex.status}, data={redacted_data})\n{redacted_tb}"
            )
        except Exception as ex:
            redacted_err = _redact_secrets(
                str(ex),
                redact_values,
                mask_sensitive=self.github_webhook.mask_sensitive,
            )
            redacted_tb = _redact_secrets(
                traceback.format_exc(),
                redact_values,
                mask_sensitive=self.github_webhook.mask_sensitive,
            )
            self.logger.error(
                f"{self.log_prefix} Failed to delete GHCR tag: {repository_full_tag}: {redacted_err}\n{redacted_tb}"
            )
        finally:
            if ghcr_client is not None:
                ghcr_client.close()
Potential damage 🟡 Medium 🩹 Recoverable

  • A regression can leave temporary GHCR versions behind or fail to remove an eligible version when an earlier matching version stops pagination.
  • Shared versions remain protected; API failures are contained.
  • Reverting stops new cleanup regressions, but stale registry versions require manual cleanup.
  • An externally deleted version may require rebuilding or republishing the image.
  • No automatic repair worker or retry caller was established.
Sources

webhook_server/libs/handlers/pull_request_handler.py[1082-1098]

            _scan_page(page_versions)

            page = 1
            while len(page_versions) >= per_page and not matching_versions:
                page += 1
                _, next_page = await github_api_call(
                    requester.requestJsonAndCheck,
                    "GET",
                    f"{package_api_base}/versions",
                    parameters={"per_page": per_page, "page": page},
                    logger=self.logger,
                    log_prefix=self.log_prefix,
                )
                page_versions = next_page or []
                if not page_versions:
                    break
                _scan_page(page_versions)

webhook_server/libs/handlers/pull_request_handler.py[1104-1135]

            deleted_any = False
            for version_id, version_tags in matching_versions:
                other_tags = [tag for tag in version_tags if tag != pr_tag]
                if other_tags:
                    self.logger.warning(
                        f"{self.log_prefix} Skipping deletion of GHCR package version {version_id} for "
                        f"{repository_full_tag} because it is shared with other tags: {other_tags}"
                    )
                    continue

                # Delete the package version
                # DELETE /{scope}/{owner}/packages/{package_type}/{package_name}/versions/{package_version_id}
                delete_url = f"{package_api_base}/versions/{version_id}"
                try:
                    await github_api_call(
                        requester.requestJsonAndCheck,
                        "DELETE",
                        delete_url,
                        logger=self.logger,
                        log_prefix=self.log_prefix,
                    )
                    deleted_any = True
                except GithubException as ex:
                    if ex.status == 404:
                        # Version already deleted or doesn't exist
                        self.logger.warning(
                            f"{self.log_prefix} Package version {version_id} not found (may have been already deleted)"
                        )
                    else:
                        raise

            if deleted_any:

webhook_server/libs/handlers/pull_request_handler.py[1148-1179]

        except GithubException as ex:
            redacted_data = _redact_secrets(
                str(ex.data),
                redact_values,
                mask_sensitive=self.github_webhook.mask_sensitive,
            )
            redacted_tb = _redact_secrets(
                traceback.format_exc(),
                redact_values,
                mask_sensitive=self.github_webhook.mask_sensitive,
            )
            self.logger.error(
                f"{self.log_prefix} Failed to delete GHCR tag: {repository_full_tag} "
                f"(status={ex.status}, data={redacted_data})\n{redacted_tb}"
            )
        except Exception as ex:
            redacted_err = _redact_secrets(
                str(ex),
                redact_values,
                mask_sensitive=self.github_webhook.mask_sensitive,
            )
            redacted_tb = _redact_secrets(
                traceback.format_exc(),
                redact_values,
                mask_sensitive=self.github_webhook.mask_sensitive,
            )
            self.logger.error(
                f"{self.log_prefix} Failed to delete GHCR tag: {repository_full_tag}: {redacted_err}\n{redacted_tb}"
            )
        finally:
            if ghcr_client is not None:
                ghcr_client.close()
Assessed commit 293ae57
Diagram

graph TD
  A["PR cleanup"] --> B["Select credentials"] --> C["List GHCR versions"] --> D{"Other tags?"}
  D -->|No| E["Delete version"] --> F["Comment on PR"]
  D -->|Yes| G["Preserve version"]
Loading
High-Level Assessment

Keep the conservative Packages API approach. Package-version deletion can remove every tag on a version, so skipping shared versions is safer than attempting cleanup through the existing deletion path; pagination and dedicated credentials address the other failure modes without changing non-GHCR cleanup.

Files changed (4) +499 / -54

Bug fix (1) +112 / -52
pull_request_handler.pyMake GHCR package-version cleanup safer and more complete +112/-52

Make GHCR package-version cleanup safer and more complete

• Uses a temporary container-token GitHub client when configured, otherwise the existing webhook client, and closes the temporary client. Paginates package versions, deduplicates IDs, skips versions with other tags, and comments only after deletion; failures log status and appropriately redacted details.

webhook_server/libs/handlers/pull_request_handler.py

Tests (1) +384 / -1
test_pull_request_handler.pyCover GHCR cleanup credentials, pagination, safety, and logs +384/-1

Cover GHCR cleanup credentials, pagination, safety, and logs

• Adds tests for dedicated-token selection and client closure, blank-token fallback, multi-page lookup and deduplication, and shared-tag preservation. Verifies exception detail logging with masking enabled and disabled, while adapting existing tests to exercise webhook-token fallback.

webhook_server/tests/test_pull_request_handler.py

Documentation (2) +3 / -1
configuration-reference.mdClarify GHCR cleanup credentials and permissions +1/-1

Clarify GHCR cleanup credentials and permissions

• Documents that container.password also authenticates GHCR package-version cleanup, with webhook-token fallback when unset. Notes the required package deletion permission.

docs/configuration-reference.md

set-up-checks-and-release-workflows.mdDocument PR tag removal behavior +2/-0

Document PR tag removal behavior

• Explains GHCR credential selection, paginated version lookup, and preservation of shared-tag versions. Distinguishes GHCR cleanup from regctl-based cleanup for other registries.

docs/set-up-checks-and-release-workflows.md

@qodo-code-review

qodo-code-review Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Container tokens leak in error traces ✓ Resolved

Resolving commit: 293ae57

Resolution reason
Both exception handlers now redact traceback.format_exc() with the same secret-redaction helper and
log it via logger.error() as part of the message, with no exception info attached, so the container
token can no longer appear in the emitted log record through the traceback.
Description
_delete_ghcr_tag_via_github_api redacts the exception text in its log message but calls
logger.exception(), which appends the original, unredacted exception traceback. When a GitHub
response or another failure includes the container token in its exception text, the token can appear
in logs even with sensitive-data masking enabled; the new tests check only the message passed to the
mocked logger.


Informational

2. PR says tag removed when nothing was deleted ✓ Resolved

Resolving commit: 293ae57

Resolution reason
The deleted_any = True line was moved from after the try/except into the try block directly after
the DELETE github_api_call, so the 404 branch no longer sets it. The 404 branch now only logs a
warning, and the success comment is posted only when a delete actually succeeded. The tests were
updated to assert no success comment is posted on the not-found path.
Description
In the delete loop, deleted_any = True also runs when the DELETE call returns 404, so the
Successfully removed PR tag comment is posted even though this run deleted nothing. This happens
when a concurrent close/merge worker or a manual cleanup already removed the version, and a second
worker then posts a duplicate success comment.

3. Cleanup fetches every package version page ✓ Resolved

Resolving commit: 293ae57

Resolution reason
Version pages are scanned incrementally for pr_tag with seen-ID dedup, and pagination halts as soon
as a matching version is found, so page 1 matches no longer trigger additional GET requests.
Description
_delete_ghcr_tag_via_github_api keeps calling GET .../versions until it gets a short page and
holds every version in memory before it looks for pr_tag, even when the tag shows up on page 1.
Each page is a sequential API call with retry backoff, so packages with thousands of versions
(multi-arch builds add untagged child versions on every push) cost many extra requests and seconds
on every PR close/merge.

Grey Divider

Context sources
⚠️ Tickets: not configured — No jira, linear integration is connected for the linked tickets
✅ Compliance rules (platform): 13 rules
✅ Cross-repo context — repo relationships
Review mode: Auto: ⚖️ Balanced: Security-sensitive credentials and destructive package deletion logic require careful review.
✅ Fix-loop round: fix loop

Grey Divider

Tip of the day
💡 Did you know, you can tweak Display settings with a live preview to see your comment before it ships

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 293ae57

Results up to commit 8200430 🧠 Deep


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required
1. Container tokens leak in error traces ✓ Resolved

Resolving commit: 293ae57

Resolution reason
Both exception handlers now redact traceback.format_exc() with the same secret-redaction helper and
log it via logger.error() as part of the message, with no exception info attached, so the container
token can no longer appear in the emitted log record through the traceback.
Description
_delete_ghcr_tag_via_github_api redacts the exception text in its log message but calls
logger.exception(), which appends the original, unredacted exception traceback. When a GitHub
response or another failure includes the container token in its exception text, the token can appear
in logs even with sensitive-data masking enabled; the new tests check only the message passed to the
mocked logger.


Informational
2. PR says tag removed when nothing was deleted ✓ Resolved

Resolving commit: 293ae57

Resolution reason
The deleted_any = True line was moved from after the try/except into the try block directly after
the DELETE github_api_call, so the 404 branch no longer sets it. The 404 branch now only logs a
warning, and the success comment is posted only when a delete actually succeeded. The tests were
updated to assert no success comment is posted on the not-found path.
Description
In the delete loop, deleted_any = True also runs when the DELETE call returns 404, so the
Successfully removed PR tag comment is posted even though this run deleted nothing. This happens
when a concurrent close/merge worker or a manual cleanup already removed the version, and a second
worker then posts a duplicate success comment.

3. Cleanup fetches every package version page ✓ Resolved

Resolving commit: 293ae57

Resolution reason
Version pages are scanned incrementally for pr_tag with seen-ID dedup, and pagination halts as soon
as a matching version is found, so page 1 matches no longer trigger additional GET requests.
Description
_delete_ghcr_tag_via_github_api keeps calling GET .../versions until it gets a short page and
holds every version in memory before it looks for pr_tag, even when the tag shows up on page 1.
Each page is a sequential API call with retry backoff, so packages with thousands of versions
(multi-arch builds add untagged child versions on every push) cost many extra requests and seconds
on every PR close/merge.

Grey Divider

Qodo Logo

- Format and redact tracebacks via `traceback.format_exc()` and log with `logger.error()` (no raw `exc_info`) so container tokens cannot leak in error traces
- Set `deleted_any = True` only when `DELETE` actually succeeds, avoiding duplicate PR comments on 404
- Scan version pages incrementally and stop paginating as soon as `pr_tag` is found
- Update unit tests (including real-logger redaction test) and docs wording

Assisted-by: PI (gemini-4-neon)
Signed-off-by: Meni Yakove <myakove@gmail.com>
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 293ae57

@myakove

myakove commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

/approve
/verified

Verification Evidence (293ae57b526c6f888bac9a524ca2120c96920bb5)

  • Local gates:
    • uvx prek run --all-files: passed (all 20 hooks)
    • uvx tox: passed (unused-code OK, unittests: 2499 passed, 91.59% coverage)
  • Qodo review: approved: true, 0 unresolved threads, updated through 293ae57b526c6f888bac9a524ca2120c96920bb5.
  • Live multi-worker container E2E (github-webhook-server-e2e, WEBHOOK_SERVER_DEV_MODE=0, 10 workers, myk-org/for-testing-only):
    • E1 (Positive — GHCR PR tag deletion via container.password): Probe PR Do not run regctl in container - 600 #601 built & pushed ghcr.io/myk-org/for-testing-only:pr-601 (GHCR version 1642070413). On close (delivery 579fa1f6-e99d-11f1-80bf-8a6001fb080d, pool bot deadlock1bot), version 1642070413 was deleted via container.password and PR Do not run regctl in container - 600 #601 received "Successfully removed PR tag: ghcr.io/myk-org/for-testing-only:pr-601.".
    • E2 (Negative / Safety — Shared-tag preservation): Probe PR Fix current system boot ID differs from cached boot ID podman bug - 602 #603 pushed pr-603 (version 1642098912) and attached e2e-keep-1330 to the same digest (['e2e-keep-1330', 'pr-603']). On close (delivery b7c277de-e99d-11f1-83bb-bb3b8f5723ff), container logged Skipping deletion of GHCR package version 1642098912 ... because it is shared with other tags: ['e2e-keep-1330'], GHCR version 1642098912 remained intact, and 0 removal comments were posted.
    • E3 (Negative / Security — Invalid container.password error status & secret redaction): Signed pull_request closed delivery e2e-1330-scen3-b38eb883-3173-4611-be0b-ff5c0c0e564c with temporary invalid container.password sentinel (config restored byte-for-byte) logged ERROR ... Failed to delete GHCR tag: ghcr.io/myk-org/for-testing-only:pr-601 (status=401, data={'message': 'Bad credentials', ...}) with traceback and 0 sentinel leaks in container or JSON webhook logs.
    • E4 (No-regression — Already-deleted tag): Signed pull_request closed delivery e2e-1330-scen4-3d840098-460f-48a1-8b67-d01ba37e3fba for PR Do not run regctl in container - 600 #601 logged WARNING ... Tag pr-601 not found in package for-testing-only versions and [SUCCESS] Webhook completed, keeping PR Do not run regctl in container - 600 #601's removal comment count at 1.

Assisted-by: PI (gemini-4-neon)

@myakove
myakove merged commit a9f5e78 into main Nov 26, 2026
10 of 11 checks passed
@myakove
myakove deleted the fix/issue-1330-ghcr-pr-tag-cleanup branch November 26, 2026 13:39
@myakove-bot1

Copy link
Copy Markdown

New container for ghcr.io/myk-org/github-webhook-server:latest published

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(container): GHCR PR tag cleanup fails on merge/close (wrong token, unpaginated versions, hidden errors & shared-tag safety)

3 participants