Skip to content

fix: sync package manifest state during auto-stage-candidate.yml - #139

Merged
bash0816 merged 1 commit into
mainfrom
fix/auto-stage-candidate-package-manifest-sync
Jul 22, 2026
Merged

fix: sync package manifest state during auto-stage-candidate.yml#139
bash0816 merged 1 commit into
mainfrom
fix/auto-stage-candidate-package-manifest-sync

Conversation

@bash0816

Copy link
Copy Markdown
Owner

Summary

  • auto-stage-candidate.yml only updated the root manifest when staging a successful build, leaving the package manifest's candidate_state_status (and related fields) out of sync. Observed concretely with codex 0.145.0: root ended up ready_to_publish while the package manifest stayed codex_build_dispatched.
  • Added a stage subcommand to scripts/update-codex-candidate-manifest.js (stageManifestsReadyToPublish()) that updates both manifests' state fields and shared updated_at, while keeping build provenance (build_run_id/source_ref/source_sha) root-only since the package manifest schema doesn't carry those fields.
  • Hardened auto-stage-candidate.yml's checkout/push sequence: re-fetch immediately before checkout, re-verify both manifests' candidate version/state (including expected_build_run_id) against the initial check, and push with --force-with-lease pinned to the re-fetched SHA to guard against concurrent branch updates (e.g. from codex-version-watch.yml's own force-with-lease updates).
  • Added node --check/node --test for this script to npm-package.yml's verify job (previously not run in CI).

Test plan

  • node --check scripts/update-codex-candidate-manifest.js — syntax OK
  • node --test scripts/update-codex-candidate-manifest.test.js — 14/14 PASS (7 existing + 7 new)
  • CI (npm-package verify job, lint actionlint/shellcheck) — pending, will confirm after PR opens

🤖 Generated with Claude Code (design/review by GPT-5.6-terra, implementation by GPT-5.4-mini)

auto-stage-candidate.yml only updated the root manifest on successful
build staging, leaving the package manifest's candidate_state_status
out of sync (observed with codex 0.145.0: root=ready_to_publish,
package=codex_build_dispatched). Add a stage subcommand to
update-codex-candidate-manifest.js that updates both manifests'
state fields, and harden the workflow's checkout/push with a
re-fetch + force-with-lease guard against concurrent branch updates.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@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: b2caf78854

ℹ️ 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".

# 使えるよう main 版で上書きし、そのままコミット対象に含める。
git checkout origin/main -- scripts/update-codex-candidate-manifest.js

node scripts/update-codex-candidate-manifest.js stage "$BUILD_RUN_ID" "$SOURCE_REF" "$SOURCE_SHA"

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 Allow staging to repair the existing split manifest state

When a candidate was already staged by the old workflow—leaving the root manifest at ready_to_publish while the package manifest remains codex_build_dispatched, as described for 0.145.0—this new synchronization call is unreachable. The preceding “Check candidate branch state” step still requires the root state to equal codex_build_dispatched, so re-dispatching the same successful run sets should_stage=false and leaves the manifests inconsistent. Accept this recovery state while validating the version and run ID, or add an explicit repair path.

Useful? React with 👍 / 👎.

@bash0816
bash0816 merged commit 46fe11e into main Jul 22, 2026
5 checks passed
@bash0816
bash0816 deleted the fix/auto-stage-candidate-package-manifest-sync branch July 22, 2026 05:56
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