Skip to content

fix(snipsync): drop duplicate origins and all non-main refs - #5022

Merged
lennessyy merged 2 commits into
mainfrom
fix/snipsync-origins
Aug 3, 2026
Merged

fix(snipsync): drop duplicate origins and all non-main refs#5022
lennessyy merged 2 commits into
mainfrom
fix/snipsync-origins

Conversation

@lennessyy

@lennessyy lennessyy commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Snipsync has been failing intermittently since 2026-07-20 and on every run since 2026-07-30, so no snippet has synced in five days. Two independent causes.

1. Duplicate origins race the same zip filename

features and reference-app-orders-go were each listed twice.

Sync.js:277 names every download `${repo}.zip` — from the repo alone, no owner or ref — and getRepos fans all origins out through a single Promise.all. unzip() then unlinks the archive when it finishes (Sync.js:297). Two tasks sharing a filename race, and the loser reads a partially written or already deleted archive:

Error: unexpected EOF
    at node_modules/yauzl/index.js:629:23
    at node_modules/fd-slicer/index.js:32:7
    at FSReqCallback.wrapper [as oncomplete] (node:fs:670:5)

That throw originates in an fs callback, so it escapes getRepos's try/catch and hard-kills the process — which is why the logs never show the handler's own Failed downloading ... message. Being a race, it explains the intermittency. The duplicates are old: reference-app-orders-go since #3932 (Nov 2025), features since #4247 (Mar 2026).

2. Branch pins, one of them dead

#4663 pinned both samples-dotnet and samples-java to ea/aws-lambda on 07-30.

samples-dotnet's branch no longer exists — that sample merged in temporalio/samples-dotnet#152 (07-21) and the branch was deleted — so every run since has 404'd on the archive download and burned five retries. That's the Operation failed - Retrying in 1000 ms... line.

Separating the two causes: the 07-20 and 07-27 failures show unexpected EOF with no retry line, i.e. the race alone, before the pin existed. 08-03 shows both. The pin is why occasional failures became five in a row.

This PR removes every non-main ref. samples-server keeps ref: main, which is already main.

Known consequence for the Java lambda page

temporalio/samples-java#784 has not merged, so lambda-worker/ exists only on ea/aws-lambda. Unpinning means the java lambda page's three snippets (java-lambda-worker, java-lambda-worker-workflow, java-lambda-worker-otel-collector-config) have no source on main and stop tracking upstream.

They keep their current content rather than breaking: snipsync only splices IDs it finds in a source, and leaves unmatched markers untouched. Re-pin or merge #784 when the snippets need to move again.

The tradeoff being made deliberately: a ref: pins every snippet from that repo, not one page's, so carrying a feature-branch pin in shared config to serve a single page is the more expensive side.

Testing

Ran yarn snipsync locally against the final config:

  • Completes in 88s, no crash — previously a hard exit.
  • 712/716 target file(s) unchanged.
  • Both lambda pages untouched, confirming unmatched markers are left alone.
  • The 4 files it did want to rewrite are legitimate upstream drift held back by five days of failures, e.g. golang:1.24.1golang:1.25.4 in docs/best-practices/worker.mdx. Discarded to keep this PR config-only; the next scheduled run picks them up.

Follow-ups, not in this PR

  • The .NET lambda page also stops tracking its source, permanently. Lambda Worker Sample samples-dotnet#152 merged that sample to main without snipsync markers — samples-dotnet@main has zero SNIPSTART markers anywhere, so the page's three IDs resolve nowhere on any ref. Content is correct today but frozen until markers are added upstream.
  • ${repo}.zip should include owner and ref so this class of collision is impossible. Belongs upstream in snipsync.
  • Pre-existing marker mismatches in docs/develop/java/best-practices/testing-suite.mdx — four java-nexus-*-mock snippets warn mismatched end marker ... Skipping splice and are silently not syncing. Unrelated to this failure, and invisible because the warning scrolls past in an exit-0 run.

🤖 Generated with Claude Code

Snipsync has failed intermittently since 2026-07-20 and on every run since
2026-07-30. Two independent causes.

Duplicate origins. features and reference-app-orders-go were each listed
twice. Sync.js names every download `${repo}.zip` from the repo alone and
fans all origins out through one Promise.all, and unzip() unlinks the
archive when it finishes. Two tasks sharing a filename race: one reads a
partially written or already deleted archive and yauzl throws

    Error: unexpected EOF
        at node_modules/yauzl/index.js:629:23

from an fs callback, which escapes getRepos()'s try/catch and kills the
process. Hence the intermittency, and hence no "Failed downloading" line
in the logs. The duplicates date to #3932 and #4247.

Dead branch pin. #4663 pinned samples-dotnet to ea/aws-lambda on 07-30.
That sample merged to main in temporalio/samples-dotnet#152 and the branch
was deleted, so every run since has 404'd on the archive download and
burned five retries. Unpinning is safe for the docs page: snipsync only
splices IDs it finds in a source, and leaves unmatched markers untouched,
so the .NET lambda page keeps its current content.

samples-java stays pinned. temporalio/samples-java#784 is still open and
lambda-worker/ exists only on that branch. The pin is collateral-free
today: the branch's only divergence from main outside lambda-worker/ is
.github/workflows/ci.yml, which carries no snippet markers.

Verified by running yarn snipsync locally against this config: completes
in 87s with no crash, 711/716 target files unchanged, and both lambda
pages untouched.
@lennessyy
lennessyy requested a review from a team as a code owner August 3, 2026 18:31
@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
temporal-documentation Ready Ready Preview Aug 3, 2026 6:47pm

Request Review

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

📖 Docs PR preview links

This PR does not change any pages in /docs. If you make updates, links to the modified pages will appear here.

Removes the remaining non-main ref. samples-server keeps ref: main, which
is already main.

temporalio/samples-java#784 has not merged, so lambda-worker/ exists only
on ea/aws-lambda. The java lambda page's three snippets therefore have no
source on main and stop tracking upstream. They keep their current content:
snipsync only splices IDs it finds in a source and leaves unmatched markers
alone. Confirmed by running yarn snipsync against this config, which leaves
both lambda pages untouched and reports 712/716 files unchanged.
@lennessyy lennessyy changed the title fix(snipsync): drop duplicate origins and the dead samples-dotnet pin fix(snipsync): drop duplicate origins and all non-main refs Aug 3, 2026
@lennessyy
lennessyy merged commit f80a9b2 into main Aug 3, 2026
11 checks passed
@lennessyy
lennessyy deleted the fix/snipsync-origins branch August 3, 2026 20:39
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.

2 participants