Skip to content

stage → production: sync-to-zesty conflict-recovery patch + 9 self-healed ZUID mappings - #101

Merged
ardeay merged 6 commits into
productionfrom
stage
Sep 9, 2026
Merged

ardeay merged 6 commits into
productionfrom
stage

Conversation

@ardeay

@ardeay ardeay commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Per ardeay (2026-09-09 Discord): "yes self heal then go stage to prod."

What's in this promotion

From #100 (already merged to stage today)

sync-to-zesty.js patched to recover from 400 "filename already exists" on POST by GET-looking up the existing ZUID. Any other error still fails loud.

From the FULL_SYNC dispatch on stage just now (run 34399911849)

The patch immediately self-healed 9 orphaned view records — files that had been on disk but missing ZUID mappings in `zesty.config.json` because someone created their view records manually in the Zesty editor earlier in the year without the ZUID ever making it back to git. Now mapped:

File ZUID
adobe-experience-manager-vs-content-one.html 11-faf7b3be9a-bg2p93
compare.html 11-88f4cecfdd-0rt36l
contentful-vs-content-one.html 11-86b3d39cdf-pnc702
contentstack-vs-content-one.html 11-fedca6c691-p24ggf
free-tools.html 11-808ee19be0-s89dd9
sitecore-vs-content-one.html 11-ac86f485e1-vrtfq9
storyblok-vs-content-one.html 11-b0f5f7f7f0-68d4r8
website-redesign-rfp-template.html 11-9cec91f791-kg8g1s
why-building-websites-is-still-hard.html 11-cab4a1e2e1-7tr458

From #99 earlier today

The 4 pages that kicked off the whole thread: culture-cares, duda-vs-content-one, nonprofit-website-rfp-template, webflow-vs-content-one — already live on prod via manual publish. This promotion carries their content forward from stage git so it stays in sync.

Left unmapped (deliberately skipped by the sync script — not a bug)

  • `webengine/views/press`
  • `webengine/views/press_releases`

Both are extensionless views. The script correctly can't infer whether they're templateset or pageset from the filename alone. If those need mapping, someone creates them in the Zesty admin (choosing templateset for a parent URL view, pageset for a per-instance view) then adds their ZUID to `zesty.config.json` by hand — same as with any other manually-created templateset.

After merge

  • Sync-to-zesty on production runs with the patched behavior + the 9 newly-mapped ZUIDs = future stage runs won't re-trigger the "filename already exists" recovery on any of those 9
  • Prod branch and stage branch back in code parity
  • Future landing-page work no longer needs the "manual ZUID handoff after each new file" step

Nothing user-visible changes on live URLs — the 4 pages ardeay published earlier stay live at the same URLs; the 9 self-healed ones were already resolving fine, they just weren't sync-managed.

ContentOneBot and others added 6 commits September 9, 2026 15:28
Per ardeay (2026-09-09): PR #97's stage-merge sync-to-zesty run failed
on Aug 31 with 401 (token expired), so view records were never created
in Zesty for these 4 pages. Token was rotated today; a fresh stage push
that touches these 4 files puts them in DIFF_BASE scope, so sync-to-zesty
will POST-create view records + capture ZUIDs into zesty.config.json.

Trivial HTML comment at line 1 is the diff signal (valid HTML5 - comments
before DOCTYPE are explicitly allowed by spec, standards mode preserved).

Affects:
- culture-cares.html
- duda-vs-content-one.html
- nonprofit-website-rfp-template.html
- webflow-vs-content-one.html
Trigger sync-to-zesty view auto-create for 4 pending pages
…xisting ZUID

Per ardeay (2026-09-09): before this patch, any file present on disk but
without a ZUID mapping in zesty.config.json triggers a POST /web/views on
stage sync. If the Zesty instance already has a view record with that
fileName (usually because it was created manually in the editor before
its ZUID made it into config), the POST fails with 400 'filename already
exists' and the whole sync crashes. Every subsequent file in newFiles is
never touched.

The patch teaches createNew() to recover from that specific 400: catch it,
GET /web/<endpoint>, find the record whose fileName matches, and continue
as if we had just created it. The workflow's writeback step then commits
the resolved ZUID into zesty.config.json so subsequent runs treat it as a
normal already-mapped resource.

Also:
- apiRequest now attaches .status and .bodyText onto the thrown Error so
  callers can introspect (previously only a string message was available)
- apiRequest no longer sends body='null' on GET/DELETE (JSON.stringify(null)
  = 'null', which some fetch implementations flag)
- Small test file exercises the shape of the patch — asserts the recovery
  branch, the helper function, and the body-on-GET guard all exist. Zero
  runtime cost since it's opt-in (node scripts/sync-to-zesty.test.js)
…ing-view

sync-to-zesty: recover from 'filename already exists' on POST
@ardeay
ardeay merged commit e596a67 into production Sep 9, 2026
3 checks passed
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