Skip to content

feat(deploy): verify translations completed before declaring success#22

Merged
JohnRDOrazio merged 1 commit intomainfrom
feat/verify-translations-after-deploy
Apr 29, 2026
Merged

feat(deploy): verify translations completed before declaring success#22
JohnRDOrazio merged 1 commit intomainfrom
feat/verify-translations-after-deploy

Conversation

@JohnRDOrazio
Copy link
Copy Markdown
Member

Summary

Adds a Verify translations completed step that polls each translation
post's modified_gmt via the WP REST API and fails the workflow if any
didn't update past the deploy start time within 10 minutes.

  • /cdcf/v1/translate returns 202 "Translation queued" immediately —
    the deploy currently has no signal whether translation actually
    succeeded
  • New step polls up to 20× with 30s sleeps (10 min total)
  • Authenticated query (context=edit) so newly-created drafts are
    visible too
  • On timeout: lists stuck page IDs and a hint about likely causes
    (OpenAI timeout, dead Redis worker, missing/invalid API key)

Why

The v0.2 release on 2026-04-19 reported success in this workflow, but
all 5 translations of project-vetting-criteria (it/es/fr/pt/de) were
still serving v0.1 content 10 days later, and 12 of 15 newly-created
translation pages were stuck as drafts. WP REST confirmed: source page
833 modified_gmt: 2026-04-19T00:28:24, all 5 translations
modified_gmt: 2026-04-06T09:22:5x — untouched on Apr 19. The async
worker had silently abandoned the jobs (OpenAI cURL timeouts in
production logs, retry logic dead-coded out — fixed in
CatholicOS/cdcf-website#38).

This step would have caught it.

Drive-by

  • DEPLOYED_IDS moved into the env: block per workflow-injection
    hardening guidance
  • "translation failed" → "translation enqueue failed" — more accurate
    since a non-200 from /translate means the job didn't queue, not
    that translation itself failed

Dependencies

This step exercises behavior the cdcf-website backend now produces
correctly only after CatholicOS/cdcf-website#38 deploys. Merging this
first will work fine — the verify step just polls the existing
endpoint — but the next tagged release after both PRs deploy will
be the first one where verification can actually catch a worker
failure.

Test plan

  • Merge cdcf-website#38 first and let it deploy to production
  • Tag a no-op v0.2.1 (or trigger workflow_dispatch) and watch
    the new step succeed
  • (Optional staging test) Simulate a worker failure (revoke OpenAI
    key) and confirm the workflow fails with the stuck-IDs message
    after ~10 min
  • Confirm the existing translate step still emits page IDs into
    the new translated_ids step output

🤖 Generated with Claude Code

Adds a post-translate verification step that polls each translation
post's modified_gmt via the WP REST API until it advances past the
deploy start time, with a 10-minute (20 × 30s) timeout. Fails the
workflow with a list of stuck page IDs if any translation didn't
update — previously the deploy reported success even when async
translation jobs were silently abandoned by the queue worker.

The /cdcf/v1/translate endpoint is fire-and-forget (HTTP 202 with
"Translation queued"), so without this poll a backend failure
(OpenAI timeout, dead Redis worker, missing API key, exhausted
retries) is invisible at the workflow level. Concretely: the v0.2
release on 2026-04-19 reported success while leaving Italian/Spanish/
French/Portuguese/German project-vetting-criteria stuck on v0.1
content.

Also captures DEPLOYED_IDS in the env block (per workflow injection
hardening guidance) and renames the per-language failure log line
from "translation failed" to "translation enqueue failed" since a
non-200 from /translate only indicates the job didn't get queued.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@JohnRDOrazio JohnRDOrazio merged commit e893bcd into main Apr 29, 2026
1 check passed
@JohnRDOrazio JohnRDOrazio deleted the feat/verify-translations-after-deploy branch April 29, 2026 16:16
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