Skip to content

chore: harden CI with credential-free gate and bumped actions#45

Open
pinecone-groundskeeper[bot] wants to merge 1 commit into
mainfrom
chore/issue-37-harden-ci
Open

chore: harden CI with credential-free gate and bumped actions#45
pinecone-groundskeeper[bot] wants to merge 1 commit into
mainfrom
chore/issue-37-harden-ci

Conversation

@pinecone-groundskeeper

Copy link
Copy Markdown
Contributor

Fixes #37

Problem

validate.yml's only PR gate was a single macos-latest job running Prettier (via npm 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 the PINECONE_API_KEY secret, 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 ran npm run build, which is npm-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

  • Split validate.yml into:
  • Removed the npm run build step from .github/actions/setup (install-only now) so nothing reformats the tree ahead of the explicit format:check/lint/tsc steps in basic-hygiene.
  • Bumped actions/checkout, actions/setup-node, actions/cache from v3 to v4, and moved every job from macos-latest to ubuntu-latest (pure lint/build/test work, no macOS-specific need).
  • Added a cache for the @xenova/transformers model 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 reach nuget.org, so installed with --ignore-scripts):

  • npm run format:check → passes
  • npm run lint → passes
  • npx tsc → passes, no errors
  • npm run test → 25 passed, 5 skipped (all 5 skipped are the live integration tests, confirming self-skip works with no PINECONE_API_KEY set)

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Harden CI: gate on typecheck/build, self-skipping e2e, and bump pinned GitHub Actions

0 participants