Skip to content

fix(deploy): stop hydrating content/data from empty publish branch (#627) - #628

Merged
jmservera merged 2 commits into
mainfrom
fix/deploy-hydration-content-data-627
Jul 31, 2026
Merged

fix(deploy): stop hydrating content/data from empty publish branch (#627)#628
jmservera merged 2 commits into
mainfrom
fix/deploy-hydration-content-data-627

Conversation

@jmservera

Copy link
Copy Markdown
Owner

Fixes #627.

Root cause

PR #623 added content/data/ to the deploy "Hydrate generated content from publish" step in .github/workflows/deploy-site.yml. The publish branch (last updated 2026-07-27, pre-#623) does not carry the observatory data pages, so the step's rm -rf "$path" followed by a failing git checkout origin/publish -- "$path" 2>/dev/null || true left content/data/ empty at deploy time.

The committed embed page content/embeds/fastest-growing-ai-repositories-chart/ (not in the hydration list) then referenced the now-missing /data/fastest-growing-ai-repositories-this-year/, and the errorf guards in layouts/embeds/single.html and layouts/shortcodes/observatory-chart.html aborted the build:

ERROR observatory-chart shortcode could not find page "/data/fastest-growing-ai-repositories-this-year/"
ERROR embed page embeds/fastest-growing-ai-repositories-chart/index.md is missing a valid source_page

Why CI didn't catch it

CI's Site Preview and Production site jobs build the repository content as committed on the branch, where content/data/ exists and the embed resolves. Only deploy-site.yml runs the publish-hydration step, so the main (code + embeds) ↔ publish (generated data) divergence is structurally invisible to CI.

Fix (Path B — interim unblock)

Omit content/data/ from the deploy hydration list so the committed pages ship until the crawl repopulates publish. content/data/ is still carried through the crawl-and-publish transaction; the provenance-invariant test is updated to reflect the intentional deploy exclusion.

Validation

  • pytest tests/test_pipeline.py — 28 passed
  • zizmor .github/workflows/deploy-site.yml — no findings
  • hugo --minify — clean build (exit 0); the embed and its data page render
  • ruff check . — clean

Follow-up (RPI handoff)

  • PRD updated: NFR-011 (deploy/CI build parity), NFR-012 (embed source_page must resolve), R-08 (hydration wipes committed pages), Q-03 (when to restore hydration), changelog v1.2.
  • New plan: .copilot-tracking/plans/2026-07-31/claracle-deploy-hydration-remediation-plan.instructions.md covering:
    1. Interim unblock (this PR)
    2. Regenerate observatory content onto publish (run the crawl/generation actions)
    3. Restore consistent deploy hydration
    4. Add a CI deploy-parity guard
    5. Validation + close 🔴 Deploy Hugo site failed (run 30616770243) #627

Note: this ships the committed (seed) content/data pages to production until the crawl publishes real observatory data. Restoring hydration (Phase 3) depends on running the generation actions first (Phase 2).

)

PR #623 added content/data/ to the deploy "Hydrate generated content from
publish" step. The publish branch does not yet carry those observatory
pages, so the step's `rm -rf` followed by a failing `git checkout ... || true`
left content/data/ empty at deploy time. The committed embed page
content/embeds/fastest-growing-ai-repositories-chart/ (not hydrated) then
referenced a missing data page, and the errorf guards in embeds/single.html
and shortcodes/observatory-chart.html aborted the build. CI never reproduces
the publish-hydration, so it stayed green.

Interim fix (Path B): omit content/data/ from the deploy hydration list so the
committed pages ship until the crawl repopulates publish. Keep content/data/
in the crawl-and-publish transaction and update the provenance invariant test
accordingly.

Documents the incident and follow-up in the PRD (NFR-011/012, R-08, Q-03) and
adds an RPI handoff plan covering regeneration onto publish, restoring
hydration, and a CI deploy-parity guard.
Copilot AI review requested due to automatic review settings July 31, 2026 09:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR unblocks GitHub Pages deploys by preventing the deploy workflow from deleting committed Observatory data pages when hydrating from an out-of-date publish branch, and aligns the pipeline provenance test + documentation with that interim exception (issue #627).

Changes:

  • Stop deploy-site.yml from hydrating content/data/ from publish (temporary exception to avoid wiping required pages).
  • Update tests/test_pipeline.py provenance invariant to exclude content/data/ from deploy hydration while still requiring it in the publish transaction.
  • Record the incident + interim mitigation in the PRD and add a remediation plan document for follow-up work.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
.github/workflows/deploy-site.yml Removes content/data/ from deploy hydration list to prevent build-breaking deletions when publish is missing those pages.
tests/test_pipeline.py Adjusts pipeline invariant expectations so deploy hydration intentionally excludes content/data/.
docs/prds/claracle-data-observatory-relaunch.md Documents deploy/CI parity requirements and records the incident/fix in v1.2.
.copilot-tracking/plans/2026-07-31/claracle-deploy-hydration-remediation-plan.instructions.md Adds a structured follow-up plan for regenerating publish, restoring hydration, and adding CI parity guards.
Suppressed comments (1)

.github/workflows/deploy-site.yml:99

  • The new explanatory comment doesn’t name the omitted path, which makes it harder to understand what needs to be re-added later. Calling out content/data/ explicitly will reduce the chance of reintroducing issue #627.
          # The observatory data-page directory is intentionally omitted here:
          # those pages are not yet present on publish, so hydrating an empty
          # source would delete the committed pages that the chart embeds depend
          # on and break the build (see issue #627). Re-add it once the crawl
          # publishes those pages.

Comment thread tests/test_pipeline.py Outdated
Comment thread .github/workflows/deploy-site.yml
Comment thread docs/prds/claracle-data-observatory-relaunch.md
Copilot AI review requested due to automatic review settings July 31, 2026 10:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (1)

tests/test_pipeline.py:652

  • deploy_hydrate_entries check only asserts the exact line content/data/ is absent. If someone later adds content/data (without the trailing slash) to GENERATED_PATHS, deploy would still delete the directory (because the script normalizes with ${path%/}), but this test would not catch the regression. Normalize trailing slashes (or assert both variants) before checking membership.
        deploy_hydrate_entries = {line.strip() for line in deploy_hydrate.splitlines()}
        self.assertNotIn("content/data/", deploy_hydrate_entries)

@jmservera
jmservera merged commit 93e5e8a into main Jul 31, 2026
14 checks passed
@jmservera
jmservera deleted the fix/deploy-hydration-content-data-627 branch July 31, 2026 11:06
jmservera added a commit that referenced this pull request Aug 1, 2026
…loy (#633) (#637)

Apply the guarded hydration pattern from #632 to the two remaining loops:

- deploy-site.yml and generate-data-pages.yml now only wipe+restore a path when
  it exists on publish; otherwise main's committed version is preserved. This
  removes the last instances of the hydration-wipes-committed-file bug class.
- Re-add content/data/ to the deploy hydration list. The crawl now publishes the
  observatory data pages to publish, and the guard makes hydration safe even when
  a path is temporarily absent, so the #628 interim exception is no longer needed.

Restore the provenance-invariant test to require content/data/ across the whole
publish transaction (including deploy hydration) and add assertions that both
loops use the git ls-tree guard.

Closes #633.

Co-authored-by: jmservera <jmservera@users.noreply.github.com>
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.

🔴 Deploy Hugo site failed (run 30616770243)

2 participants