digidem / digidem/comapeo-docs
code.json merge always lets HEAD win on overlapping keys — may serve stale Notion-generated labels
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 0
- Avg merge
- 20h 29m
- Merged PRs (30d)
- 8
Description
Context
Raised by @greptile-apps during PR #189 review (thread on .github/workflows/deploy-production.yml:151, comment id 3608235482), after PR #189's jq -s '.[0] + .[1]' merge fix (commit feac2e2, refined in 6f2794b) replaced the previous blind git checkout HEAD -- i18n/*/code.json restore.
The behavior
code.json mixes two categories of keys:
- Curated theme/UI keys (~90+ keys: navbar, footer, breadcrumbs, TOC, a11y labels, etc.) — hand-maintained in this repo, never touched by the Notion pipeline. These never appear in the content branch's
code.jsonat all. - Notion-generated page-title/category labels — literal English page titles used as i18n keys (e.g.
"API Reference","Building Custom Background Maps"), generated by the translation pipeline (translate-docs.yml) and committed to the content branch (TARGET_BRANCHdefaults tocontentin that workflow), not tomain.
Checked against real refs: content branch's i18n/es/code.json has 65 keys; 63 of those already exist in main's code.json (159 keys total), presumably from an earlier one-time sync/backport. Only 2 are content-only.
The current merge (jq -s '.[0] + .[1]' "$f" <(git show "HEAD:$f")) is intentionally right-biased so HEAD wins any overlapping key — this was required so this PR's own curated fixes (navbar logo.alt, 5 Spanish grammar corrections, etc.) aren't silently overwritten by whatever the content branch happens to have. But it means: for any of those 63 overlapping Notion-generated keys, if translate-docs.yml pushes a newer translation to the content branch, production keeps serving main's older, frozen copy of that key until someone manually re-syncs it into main.
Why this isn't new, and isn't blocking PR #189
This exact "HEAD wins" behavior predates PR #189 — the previous code (git checkout HEAD -- i18n/*/code.json) was 100% HEAD-wins (it dropped content-only keys entirely, which PR #189 fixed). PR #189's merge only improved the situation (content-only keys now survive); it didn't change who wins on overlapping keys, and didn't introduce this staleness risk.
Possible directions
- Split
code.jsonconceptually: keep a repo-owned allowlist/pattern for curated theme keys (HEAD wins) vs. everything else (content wins), so Notion-generated labels track the content branch's freshest data. - Or: change
translate-docs.yml's target to sync page-title labels back intomainmore eagerly, somain's frozen copies don't drift. - Or: accept the current trade-off (curated fixes always win) as intentional and document it, if the staleness window is acceptable in practice.
Not blocking
Filed as a tracking issue rather than fixed inline in PR #189, since PR #189 already went through 10 rounds of independent readiness review focused on the restore/merge mechanics; this is a deeper data-ownership question deserving its own design discussion, not more churn on an already-large PR.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with .github/workflows/deploy-production.yml around line 151 and compare the HEAD and content-branch i18n/*/code.json inputs. Read translate-docs.yml to understand how generated labels reach the content branch. Done means an agreed ownership and merge policy that preserves curated fixes while avoiding stale generated labels, or documents the accepted trade-off.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, github-actions
- Domain
- ci-cd, localization
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100