Skip to content

ci: stop gating the React package job on build - #1041

Closed
arkhindi12 wants to merge 1 commit into
conduit-protocol:mainfrom
arkhindi12:fix/react-job-not-gated
Closed

arkhindi12 wants to merge 1 commit into
conduit-protocol:mainfrom
arkhindi12:fix/react-job-not-gated

Conversation

@arkhindi12

Copy link
Copy Markdown
Contributor

The reason this went unnoticed

react-package declared needs: [build], and build declares needs: [lint-typecheck]:

lint-typecheck:   ...
build:
  needs: [lint-typecheck]
react-package:
  needs: [build]

So one SDK type error skipped build, which skipped react-package — and a skipped job is not a failing job. The React package's checks never ran, so its 20 type errors and 40 failing tests were never reported. Every run of this job in the repository's history shows skipping, and the one time it actually executed (#1038) it failed immediately.

The gate was also redundant

The job installs and builds the SDK itself before touching the package:

- run: npm ci
- run: npm run build
- run: npm ci
  working-directory: packages/react
- run: npm run typecheck
  working-directory: packages/react
- run: npx vitest --run
  working-directory: packages/react

And no job in this workflow shares artifacts:

$ grep -c "upload-artifact\|download-artifact" .github/workflows/ci.yml
0

So needs: [build] ordered the jobs without passing anything between them. The only thing it achieved was letting a failure in one package hide a failure in the other.

Change

Drop needs: [build] from react-package only.

  • build keeps needs: [lint-typecheck] — its gate is legitimate, since it verifies dist actually loads.
  • e2e-browser keeps needs: [build] — it is nightly-only, where ordering after a successful build is the intent.
  • Everything else untouched.

Net effect: an SDK type error and a React type error are now independently visible instead of one masking the other. This job will start running on every PR to main and reporting its real result.

Interaction with the other PRs

This is the root-cause fix; #1039 is the symptom fix.

If you would rather not see a red react-package in the interim, merge this last. Its value is preventing the same silent-skip from hiding the next regression.

Verification

$ python3 -c "import yaml; d=yaml.safe_load(open('.github/workflows/ci.yml')); \
  print(d['jobs']['react-package'].get('needs','(none)'))"
(none)

YAML parses; react-package has no needs; all six jobs otherwise unchanged.

`react-package` declared `needs: [build]`, and `build` declares
`needs: [lint-typecheck]`. So a single SDK type error skipped `build`, which
skipped `react-package` — and because a skipped job is not a failing job, the
React package's checks never ran and never reported anything.

That is how `@streamfi/react` reached 20 type errors and 40 failing tests
against a green-looking CI: the job's last recorded runs show `skipping`, and
the one time it did execute (conduit-protocol#1038) it failed.

The gate was also redundant. The job installs and builds the SDK itself:

```yaml
- run: npm ci
- run: npm run build
- run: npm ci
  working-directory: packages/react
```

No job in this workflow uploads or downloads artifacts (`grep -c artifact`
returns 0), so nothing is shared through the dependency — `needs: [build]`
only ordered the jobs.

Removing it makes an SDK type error and a React type error independently
visible instead of one masking the other. `build` keeps its own gate on
`lint-typecheck`, and `e2e-browser` keeps `needs: [build]` because it is a
nightly-only job where ordering is the intent.

Verified: YAML parses, `react-package` has no `needs`, all other jobs
unchanged.
@arkhindi12

Copy link
Copy Markdown
Contributor Author

Closing — my premise was wrong

I claimed this gate was redundant because "no job shares artifacts". That reasoning was wrong, and I verified it by removing dist/ and running the React package against an unbuilt SDK:

$ mv dist /tmp/sfi-dist-backup
$ cd packages/react && npm run typecheck
src/context/StreamFiProvider.tsx(15,8): error TS2307: Cannot find module '@conduit-protocol/sdk'
... 53 errors total

The React package depends on the SDK as "@conduit-protocol/sdk": "file:../.." (a symlink), and the SDK's exports map points at dist/:

"main": "dist/cjs/index.js",
"exports": { ".": { "import": "./dist/esm/index.js", "types": "./dist/types/index.d.ts" } }

So the job genuinely needs a built SDK. It gets one through the prepare hook ("prepare": "npm run build"), which npm ci runs — which is exactly what the CI log shows:

npm error path /home/runner/work/streamFi-sdk/streamFi-sdk
npm error command sh -c npm run build

needs: [build] is therefore not merely ordering; it prevents the React job from burning a run on a build that is already known to fail.

And the errors were never hidden anyway

My second claim — that the gate hid these errors — is also false. The SDK type errors surface in Lint & typecheck, which is not gated by anything:

Lint & typecheck  Run npm ci  ##[error]src/client.ts(499,7): error TS2322 ...
Lint & typecheck  Run npm ci  ##[error]src/custom-fetch.ts(133,44): error TS2304 ...

So on broken main, a reviewer already sees the real cause. What they did not see was the separate React failures — but those become visible the moment the SDK compiles, which #1038 does. On #1038's own run, react-package executed and failed (51s) rather than skipping, which is how I found them in the first place.

What I should have concluded

The skip is correct behaviour for a dependency that cannot be satisfied, not a CI defect. My change would have made the React job fail on every PR to main with Cannot find module '@conduit-protocol/sdk' noise duplicating errors already shown by Lint & typecheck — strictly worse signal.

Closing this. No change is needed here; #1038 and #1039 stand on their own and the combined state is verified green (7/7 jobs, including @streamfi/react at 1m38s — see the verification comment on #1038).

Thanks for the review prompt — the check was cheap and the claim was wrong.

@arkhindi12 arkhindi12 closed this Nov 4, 2026
@arkhindi12
arkhindi12 deleted the fix/react-job-not-gated branch November 4, 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.

1 participant