Skip to content

refactor: simplify GHCR deploy poller - #136

Open
kmatsunami wants to merge 1 commit into
codex/issue-132-ghcr-auto-redeployfrom
codex/session-20260323-pr134
Open

refactor: simplify GHCR deploy poller#136
kmatsunami wants to merge 1 commit into
codex/issue-132-ghcr-auto-redeployfrom
codex/session-20260323-pr134

Conversation

@kmatsunami

Copy link
Copy Markdown
Collaborator

Summary

  • reduce the GHCR deploy poller to the minimum env-driven flow: resolve digest, compare, deploy, smoke check, rollback
  • remove poller state tracking, dry-run support, and the macOS launchd sample to keep the deploy contract small
  • rewrite deploy poller tests and align README/systemd/operations docs with the simplified behavior

Test Plan

  • /Users/kentoku.matsunami/Documents/GitHub/comic_crawler/.venv/bin/python -m unittest tests.test_ghcr_registry tests.test_deploy_poller tests.test_check tests.test_status tests.test_runner -v
  • /Users/kentoku.matsunami/Documents/GitHub/comic_crawler/.venv/bin/python -m unittest tests.test_source_drift tests.test_sources tests.test_update_classification tests.test_check tests.test_status tests.test_watchlist tests.test_runner tests.test_migrate_v2 tests.test_backlog

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce4e9a68a3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +199 to +203
rollback_once(
compose_file=compose_file,
deploy_env_path=deploy_env_path,
previous_image_ref=current_image_ref,
command_runner=command_runner,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Skip rollback when prior env digest is not deployable

run_once now always rolls back to the pre-run COMIC_CRAWLER_IMAGE_REF after any deploy failure, but this ref can be an initial placeholder (the docs allow sha256:replace-me before first deploy). In that case, a failed first deploy immediately triggers a rollback to an invalid digest, which reliably fails and obscures the real failure path instead of falling back to manual intervention. Rollback should be conditional on having a known-good previous digest/reference.

Useful? React with 👍 / 👎.

Comment on lines +199 to 205
rollback_once(
compose_file=compose_file,
deploy_env_path=deploy_env_path,
previous_image_ref=current_image_ref,
command_runner=command_runner,
redaction_secrets=redaction_secrets,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve original deploy error when rollback fails

The rollback call in run_once is no longer wrapped in its own try/except, so if rollback fails (for example, old image pull/up fails), the function raises only the rollback exception and drops the original deploy/smoke-check error context. This regresses troubleshooting and alert quality compared to the prior behavior that reported both failure stages. Catch rollback exceptions and re-raise with both causes (and a rollback-failed notification) to keep incident diagnosis actionable.

Useful? React with 👍 / 👎.

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.

1 participant