fix: skip locale commit when source.json is missing - #165
Conversation
Treat an empty origin/main source SHA as stale so a missing or invalid .openclaw-sync/source.json cannot fail open into a locale push. Matches the aggregate finalizer skip for unreadable metadata. Signed-off-by: Sebastien Tardif <SebTardif@ncf.ca>
|
Verified head Ran the production All 117 control-plane tests passed, including their Node MDX integrations. Workflow shell syntax and budget checks passed. The first local suite attempt lacked Branch autoreview against
Ready for the orchestrator's squash merge. The shared changelog update will be in #167. |
Apply configurable request deadlines to hostname cutover API calls and reject malformed or overflowing budgets before requests begin. Document both request-timeout controls and consolidate the prepared dependency and publishing changelog entries. Land after PRs #132, #152, #161, #163, #164, #165, and #166. Co-authored-by: Sebastien Tardif <SebTardif@ncf.ca>
What Problem This Solves
Fixes an issue where a locale translation commit could still push to
mainwhenorigin/mainhad no readable.openclaw-sync/source.json.remote_source_sha()returns an empty string ongit showfailure, invalid JSON, or a missingshafield.ensure_base_currentonly skipped when that SHA was non-empty and different, so a missing or broken metadata file failed open.Why This Change Was Made
Empty remote source SHA is now treated as stale, the same way the aggregate finalizer already skips when source metadata is unreadable. The locale commit writes
committed=falseand does not push. A matching readable SHA still publishes. Sibling R2 work in #161, #163, and #164 is unchanged.User Impact
A translation worker no longer publishes locale pages against an unknown or missing source snapshot. Operators see a skip (
Source metadata missing or unreadable) instead of a successful push that can land translations for the wrong docs tree. The existingFail uncommitted locale refreshstep still fails the job so the run is not reported as published.Evidence
terminal output from live
python3against the productioncommit_locale_artifact.pypath.The old guard lets an empty SHA through:
Before the patch,
commit_localepusheddocs/hi/index.mdtoorigin/mainwhen source.json was missing, invalid, empty-sha, or missing theshafield. The control-plane suite on that unfixed script reportedAssertionError: True is not falseforcommittedin all four cases.After the patch, the same live driver imports the production script and runs
commit_localeagainst a real git origin:This empty-SHA fail-open has been present since #63 (2026-06-26). The aggregate finalizer already skips unreadable source metadata in
translate-finalize-reusable.yml. Related i18n commit control: #62 , #68 .Real behavior proof
origin/main.openclaw-sync/source.jsonstill allowed the locale worker to push translation files tomain.commit_locale=Falseandorigin_has_locale=False. The valid matching SHA still printscommit_locale=Trueandorigin_has_locale=True.committed=falseso the existing uncommitted-refresh step can fail the job.main. This change only affects the empty/unreadable SHA path; a later source SHA move still uses the existing skip message.