chore: harden CI with credential-free gate and bumped actions#45
Open
pinecone-groundskeeper[bot] wants to merge 1 commit into
Open
chore: harden CI with credential-free gate and bumped actions#45pinecone-groundskeeper[bot] wants to merge 1 commit into
pinecone-groundskeeper[bot] wants to merge 1 commit into
Conversation
Refs #37 - Split validate.yml into a credential-free basic-hygiene job (format check, lint, tsc typecheck/build, unit + mocked tests) that runs on every PR including forks, and a live integration-tests job gated to main/workflow_dispatch/workflow_call and same-repo PRs. - Use `npm run format:check` instead of format-then-diff, and stop the setup action from running `npm run build` (which mutates formatting via its own npm-run-all step) before the hygiene checks run. - Bump actions/checkout, actions/setup-node, actions/cache to v4 and move non-e2e and integration jobs from macos-latest to ubuntu-latest. - Cache the @xenova/transformers model download (node_modules/@xenova/transformers/.cache) in the jobs that run live embeddings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #37
Problem
validate.yml's only PR gate was a singlemacos-latestjob running Prettier (vianpm run format+git diff --exit-code, which mutates the tree instead of just checking it) plus the full, credentialed integration-test job. Fork PRs have no access to thePINECONE_API_KEYsecret, so they got a single pass/fail signal that mixed lint/format/typecheck with live network calls, on an unnecessarily expensive runner, using actions pinned two majors behind current.Digging into
./.github/actions/setup, its "build" step rannpm run build, which isnpm-run-all format lint && tsc— i.e. it silently reformatted the tree before the workflow's own Prettier check ran, so that check was comparing post-format output to itself and could never fail on real formatting violations.Solution
validate.ymlinto:basic-hygiene: credential-free, runs on every PR including forks —npm run format:check,npm run lint,npx tsc(typecheck/build), thennpm run test(unit + mocked layers from Add unit + mocked test coverage; make live tests self-skip without credentials #36; the live integration tests in the same suite self-skip without a key, so this is safe to run as-is).run-integration-tests: gated withif: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repositoryso it only runs for pushes tomain, manual/workflow_calldispatch, and same-repo PRs — never spends a runner on a fork PR that can't use the secret anyway. The suite's existing self-skip (from Add unit + mocked test coverage; make live tests self-skip without credentials #36) remains as a second line of defense.npm run buildstep from.github/actions/setup(install-only now) so nothing reformats the tree ahead of the explicitformat:check/lint/tscsteps inbasic-hygiene.actions/checkout,actions/setup-node,actions/cachefromv3tov4, and moved every job frommacos-latesttoubuntu-latest(pure lint/build/test work, no macOS-specific need).@xenova/transformersmodel download (node_modules/@xenova/transformers/.cache, keyed on the lockfile hash) on the two jobs that actually run live embeddings, to speed up repeat runs.Verified locally (network-limited sandbox,
onnxruntime-node's native-binary postinstall couldn't reachnuget.org, so installed with--ignore-scripts):npm run format:check→ passesnpm run lint→ passesnpx tsc→ passes, no errorsnpm run test→ 25 passed, 5 skipped (all 5 skipped are the live integration tests, confirming self-skip works with noPINECONE_API_KEYset)User impact
Fork PRs (and any contributor without a Pinecone API key) now get a real, fast, credential-free green/red signal — typecheck, lint, format, and the unit/mocked test layers — instead of no signal or a build silently rewritten out from under the format check.
Follow-ups
None split off; #39 (dependency hygiene / major bumps) and #38 (workflow permissions, already merged) are tracked separately in the parent sweep, #41.