Skip to content

ci: fix patch snapshot refresh to apply structural changes#2413

Merged
mariechatfield merged 2 commits into
mainfrom
fix/patch-refresh-structural-changes
Jul 15, 2026
Merged

ci: fix patch snapshot refresh to apply structural changes#2413
mariechatfield merged 2 commits into
mainfrom
fix/patch-refresh-structural-changes

Conversation

@mariechatfield

@mariechatfield mariechatfield commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The patch refresh logic only updated files already in the versioned snapshot, so renames and additions in a patch release were silently skipped. Updated content linking to new paths would break the downstream Docusaurus build.
  • Refresh now also copies files present in live docs/ but absent from the snapshot. Orphans (in snapshot but not in live docs) are left as-is so existing external links keep resolving.
  • Extracted all snapshot decision + file logic into .github/scripts/sync-snapshot.sh so it can be run and tested locally: .github/scripts/sync-snapshot.sh --downstream ../embedded-sdk-docs --trigger workflow_run --dry-run
  • Prints a warning when structural changes occur (additions or orphans) so someone can verify the snapshot looks right.

Test plan

  • Dry-run locally against embedded-sdk-docs: --trigger workflow_run --dry-run shows the 17 expected adds and 2 orphans for version-0.52
  • Merge and trigger workflow — embedded-sdk-docs build should pass with version-0.52 snapshot complete

🤖 Generated with Claude Code

mariechatfield and others added 2 commits July 15, 2026 13:10
…ral changes

The refresh logic only updated files already in the versioned snapshot,
so renames and additions in a patch release were silently skipped. This
left the snapshot with broken links (updated content pointing to files
that didn't exist yet).

Now also copies files present in live docs/ but absent from the snapshot.
Orphaned files (in snapshot but not in live docs) are still left as-is
so existing external links keep resolving.

When a patch refresh includes structural changes (additions or orphans),
a Slack notification fires so someone can verify the snapshot looks right.
Requires SLACK_WEBHOOK_URL in the publish-docs environment; silently
skips the notification if not set.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Moves the snapshot decision and file operations out of the inline YAML
into .github/scripts/sync-snapshot.sh so it can be run locally:

  .github/scripts/sync-snapshot.sh \
    --downstream ../embedded-sdk-docs \
    --trigger workflow_run \
    --dry-run

The workflow now detects the action before calling the script (so the
commit message label is based on pre-run state, not post-run state) and
delegates all file work to the script.

Drops the Slack webhook approach; structural change warnings are printed
to stdout (and become GitHub Actions annotations via ::warning:: in CI).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mariechatfield mariechatfield requested a review from a team as a code owner July 15, 2026 20:11

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Most of this logic is extracted from publish-docs.yaml, so that I could run this locally and manually reason about what will happen

@mariechatfield mariechatfield added this pull request to the merge queue Jul 15, 2026
Merged via the queue into main with commit 3d4790c Jul 15, 2026
41 checks passed
@mariechatfield mariechatfield deleted the fix/patch-refresh-structural-changes branch July 15, 2026 21:03
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.

3 participants