Skip to content

ci(stellar): make testnet snippet validation blocking (#187) - #208

Merged
truthixify merged 5 commits into
wraith-protocol:developfrom
biafra877-web:wave-10/stellar-testnet-snippet-validation-blocking
Oct 22, 2026
Merged

truthixify merged 5 commits into
wraith-protocol:developfrom
biafra877-web:wave-10/stellar-testnet-snippet-validation-blocking

Conversation

@biafra877-web

Copy link
Copy Markdown
Contributor

Problem

stellar-testnet-snippets used continue-on-error: true on the whole job, so
live Horizon incompatibilities silently passed and never blocked a merge.

Solution

Split the single validation step into two concerns with distinct exit codes and
different CI blocking semantics.

Exit-code contract (check-stellar-testnet-snippets.ts)

Code Meaning CI behaviour
0 All checks passed —
1 Content regression – file unreadable, snippet count below threshold, reachable Horizon endpoint returned wrong shape or unexpected 4xx Blocks merge
2 Provider outage – DNS/TCP failure, timeout, HTTP 429/5xx Warning annotation only, does not block

A MODE env-var selects which checks run (content / provider / all),
so CI can invoke them separately from the same check:stellar-testnet npm script.

Workflow changes (snippets.yml)

  • Removed top-level continue-on-error: true from stellar-testnet-snippets
  • Blocking step (MODE=content): deterministic file/snippet-count checks; no continue-on-error
  • Non-blocking step (MODE=provider): live Horizon calls; continue-on-error: true;
    emits ::warning:: on outage and ::error:: on content regression
  • Guard step: re-fails the job if the provider step exited 1 (content regression
    that continue-on-error would otherwise swallow)

Done when

  • Deterministic contract/API checks separated from provider availability
  • Deterministic failures blocking
  • Provider outages reported clearly without hiding content regressions

Closes #187

…l#187)

Separate deterministic content checks from live provider availability
so that real doc regressions block merges while Horizon outages do not.

Exit-code contract (check-stellar-testnet-snippets.ts):
  0 – all checks passed
  1 – content regression (always blocks): file unreadable, snippet count
      below threshold, reachable endpoint returned wrong shape or 4xx
  2 – provider outage (never blocks): DNS/TCP failure, timeout,
      HTTP 429/5xx from Horizon testnet

MODE env-var selects which checks run:
  content  – deterministic file checks only (blocking CI step)
  provider – live Horizon calls only       (non-blocking CI step)
  all      – both (default, used locally)

Workflow changes (snippets.yml):
- Remove top-level continue-on-error: true from stellar-testnet-snippets
- Add blocking 'content' step (MODE=content, no continue-on-error)
- Add non-blocking 'provider' step (MODE=provider, continue-on-error: true)
  emits ::warning:: annotation on outage, ::error:: on content regression
- Add guard step that re-fails the job if the provider step found a
  content regression that continue-on-error would otherwise swallow

Closes wraith-protocol#187
@drips-wave

drips-wave Bot commented Oct 21, 2026

Copy link
Copy Markdown

@biafra877-web Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

…r9p-f939-6h3c)

Two high-severity advisories in follow-redirects affect the transitive
path @stellar/stellar-sdk > axios > follow-redirects:

  GHSA-q3jh-wrc6-jgq8 – array-form headers bypass cross-origin
                         credential stripping (<1.16.1)
  GHSA-8r9p-f939-6h3c – sensitiveHeaders regex escaping can expose
                         credential headers (<1.16.1)

@stellar/stellar-sdk@^13.3.0 has not yet released a version that pulls
in a patched axios; add a pnpm.overrides entry to force follow-redirects
to >=1.16.1 across the whole install until the parent ships a fix.

Update DEPENDENCY-POLICY.md to record the override.
The previous commit added follow-redirects@<1.16.1 to pnpm.overrides in
package.json but did not update pnpm-lock.yaml, causing frozen-lockfile
to fail with ERR_PNPM_LOCKFILE_CONFIG_MISMATCH.

Surgically update the lockfile:
- Add follow-redirects@<1.16.1 to the overrides block
- Bump resolution from 1.16.0 to 1.16.1 (updated integrity hash)
- Update axios snapshot dependency reference to 1.16.1
- Update follow-redirects snapshot entry key to 1.16.1

@truthixify truthixify 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.

Blocking: .github/workflows/snippets.yml:208 cannot distinguish exit 1 from exit 2. With continue-on-error, a failed provider step has outcome=failure but conclusion=success, so the condition requiring both values to be failure is never true. A reachable Horizon 4xx or response-shape regression therefore exits 1 and still leaves the job green, contrary to #187. Capture the command exit status explicitly and fail only for status 1, while treating status 2 as the non-blocking outage case; add a workflow-level regression test or equivalent status-classification test.

With continue-on-error, GitHub Actions always sets conclusion=success,
making the old outcome==failure && conclusion==failure condition
permanently false. Exit 1 (content regression) was silently swallowed
just like exit 2 (provider outage), leaving the job green on regressions.

Fix: capture the raw exit status explicitly via $GITHUB_OUTPUT and
branch on it in a separate classify step (if: always()):
  exit 0 → pass
  exit 1 → hard fail, blocks merge
  exit 2 → ::warning:: annotation, non-blocking
  other  → hard fail

Also add scripts/check-stellar-testnet-snippets.test.mjs with six
node:test cases covering all classification paths, the core exit-1 vs
exit-2 invariant, and a MODE=content integration smoke test against the
real stellar.mdx. Wired as test:stellar-testnet in package.json and as
a workflow step after classification.

Closes wraith-protocol#187
@biafra877-web

Copy link
Copy Markdown
Contributor Author

Blocking: .github/workflows/snippets.yml:208 cannot distinguish exit 1 from exit 2. With continue-on-error, a failed provider step has outcome=failure but conclusion=success, so the condition requiring both values to be failure is never true. A reachable Horizon 4xx or response-shape regression therefore exits 1 and still leaves the job green, contrary to #187. Capture the command exit status explicitly and fail only for status 1, while treating status 2 as the non-blocking outage case; add a workflow-level regression test or equivalent status-classification test.

It has been addressed, Please review

@truthixify truthixify 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.

The raw provider exit status is now captured before continue-on-error can normalize the step result, and the classifier fails exit 1/unexpected values while allowing only exit 2 as a provider outage. Exact-head CI is green; locally, all 6 classifier/content tests and MODE=content validation pass.

@truthixify
truthixify merged commit 93be329 into wraith-protocol:develop Oct 22, 2026
10 checks passed
midenotch added a commit to midenotch/docs that referenced this pull request Oct 22, 2026
…llar-testnet-snippet-validation-blocking

ci(stellar): make testnet snippet validation blocking (wraith-protocol#187)
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.

[Wave 10] Make Stellar testnet snippet validation blocking

2 participants