Repository navigation
Validate workflow parseability after CI deploy - #469
Conversation
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR469Version: 🤖 Updated on each push. |
PR Review: #469 — Validate workflow parseability after CI deployCritical[errors] validation_warnings silently dropped in CLI — [errors] 2.5s setTimeout blocks Cloudflare Worker per invocation — Important[code] No retry/backoff for indexing lag — The entire rationale for the 2.5s delay is that GitHub's workflow index lags the git commit. A single fixed sleep with a single probe makes the check brittle: if GitHub indexing takes 3s on a loaded instance, every deploy generates a spurious warning. A simple 2-3 attempt retry loop with exponential backoff (1s, 2s, 4s) would cost at most ~7s in the slow case while nearly eliminating false positives. [code] Route does not forward [tests] No test for 429 / rate-limit on the validation listing call — [tests] Suggestions[simplify] [code] [comments] JSDoc on Nice-to-haves
False positives / intentional design choices
|
- Add validation_warnings field to AddCiResponse type - Print yellow warning block after workflow list in ci add - Print per-dataset warnings in --all loop with dsSpinner.warn() - Add --no-validate flag to ci add for fleet deploys - Pass ?validate=false query param to backend when --no-validate used - Backend reads validate param and forwards to deployWorkflows() - Include validation_warnings in audit log details - Add retry in deployWorkflows: probe at 2.5s, retry once at 5s if missing - Document disabled workflow state behavior in comments and JSDoc - Add per_page=100 pagination comment in validateWorkflowsParseable - Add 429 handling note in comment with TODO for future test coverage - Update tests: expect 2 listing calls on missing, 3 on server-error
Review findings addressed (commit 9a8e13e)Critical #1 — validation_warnings silently dropped:
Critical #2 — 2.5 s Worker sleep burns budget at scale:
Important #1 — retry/backoff for indexing lag:
Important #3 — 429 test coverage:
Important #4 — state: disabled workflows:
Suggestions (also addressed):
|
Closes #287
Summary
After
deployWorkflows()commits workflow YAML files via the Contents/TreesAPI, GitHub Actions only lists files it can actually parse. A workflow file
that committed cleanly but contains a YAML syntax error is silently broken:
it appears in the repo's
.github/workflows/directory but GitHub Actionsnever runs it.
Added a best-effort post-deploy verification step:
GET /repos/{org}/{repo}/actions/workflows?per_page=100deployed, check whether GitHub Actions listed itoptional
validationErrorsfield on the return valueValidation is opt-out (
validate: false) but defaults on. It never fails thedeploy: transient indexing lag is the most common cause of "missing" warnings,
and aggregating these as warnings lets the admin (or audit log) surface real
YAML parse errors without breaking the publish pipeline.
POST /admin/datasets/:id/ci/deploynow surfacesvalidation_warningsinits JSON response when validation finds any issue.
Test plan
bun test test/tree-batched-commit.test.ts(24 pass; new tests covermissing/all-present/server-error code paths against the existing fake
Bun.serve GitHub used by the rest of the suite)
bun run tsc --noEmit(passes for both CLI andbackend/)request, consistent with the project's NO MOCK policy