Skip to content

ci: land PR #4 (workflow hardening, Dependabot, coverage) on main - #5

Merged
ucjonathan merged 2 commits into
mainfrom
feat/node-22-bigquery-v9
Aug 9, 2026
Merged

ci: land PR #4 (workflow hardening, Dependabot, coverage) on main#5
ucjonathan merged 2 commits into
mainfrom
feat/node-22-bigquery-v9

Conversation

@ucjonathan

Copy link
Copy Markdown
Contributor

Why this PR exists

#4 was merged, but its changes never reached main. It was stacked with feat/node-22-bigquery-v9 as its base, and the merge order made that base a dead end:

23:59:41   #3 merged  feat/node-22-bigquery-v9 → main
00:00:44   #4 merged  chore/ci-hardening-dependabot → feat/node-22-bigquery-v9

By the time #4 merged, its base branch had already been merged and was no longer feeding main, so #4's two commits landed there and stopped. Both PRs read MERGED, which makes this easy to miss — main is simply missing .github/dependabot.yml, the hardened ci.yml, and 22 of the 42 tests.

GitHub auto-retargets a stacked PR only when the base branch is deleted on merge. The base was kept, so no retarget happened. My note on #4 said it would retarget automatically — that was wrong, and this PR is the correction.

What's in it

Nothing new. This is #4's diff verbatim, re-based onto maingit diff main..feat/node-22-bigquery-v9 is exactly the 10 files below, since #3's content is already on main.

.github/dependabot.yml new — weekly npm + github-actions, minor/patch grouped
.github/workflows/ci.yml npm ci, permissions: contents: read, SHA-pinned actions, coverage thresholds
.github/workflows/publish.yml stale v4 action pins → v7.0.1 / v7.0.0
CONTRIBUTING.md Node 22 requirement, npm run test:coverage
package.json test:coverage script
test/* 20 → 42 tests; 100% lines, 92.31% branches

See #4 for the full rationale on each.

After merging

Delete the branch this timefeat/node-22-bigquery-v9 is serving as the head here only because that's where the commits ended up.

🤖 Generated with Claude Code

ucjonathan and others added 2 commits August 8, 2026 19:56
CI hardening
- `npm ci` only. The previous `npm ci || npm install` fallback would silently
  ignore the committed lockfile and test a different dependency tree than the
  one we publish.
- Add `permissions: contents: read`, scoping the default GITHUB_TOKEN to what
  the job needs. publish.yml already did this; ci.yml did not.
- Pin actions to exact commit SHAs instead of mutable tags. A tag can be
  repointed at new code; a SHA cannot. Both actions were three majors behind, so
  they are upgraded first and then pinned — checkout v4 -> v7.0.1, setup-node
  v4 -> v7.0.0. publish.yml's pins were stale at v4.2.2/v4.4.0 and move to the
  same SHAs.
- Run `npm run test:coverage`, failing the build below 99% lines / 90% branches
  / 90% functions, so coverage cannot silently regress.

Dependabot
- Weekly npm and github-actions updates. Minor/patch are grouped into one PR to
  keep the noise down; majors stay separate, since @google-cloud/bigquery v9
  showed a major can carry a consumer-visible Node floor change that deserves
  its own review.
- ultra_cart_rest_api_v2 is ignored: it is a peer dependency whose declared
  range already admits every 4.x, so a lockfile bump changes nothing for
  consumers.
- Dependabot understands SHA pins and bumps the trailing "# vX.Y.Z" comment
  along with them, so pinning does not mean going stale.

Test coverage: 20 -> 42 tests, 97.89% -> 100% lines, 82.17% -> 92.31% branches.
Gaps closed, each a real untested behavior rather than a line-count exercise:
- resolveDataset() was entirely untested despite being public API — the full
  linked x taxonomy matrix, plus agreement with the exported constants.
- Constructor error path: neither merchantId nor projectId now fails loudly in
  a test, instead of deriving a bad project id and failing at query time.
- query() without a model returning plain objects — documented, never verified.
- Named parameters reaching createQueryJob. These are the library's alternative
  to interpolating SQL; nothing asserted they survived the call.
- pageSize defaulting and both override levels.
- dryRun() with no byte statistics, which previously risked NaN in a cost
  estimate.
- REPEATED scalar columns and bare (unwrapped) primitive-array elements.
- diffTrees recursion into nested records. This was the notable one: no test
  descended past the top level, so drift *inside* a nested record — the shape
  most warehouse PII lives in — would have gone unreported.
- A public API surface test pinning the package entry point, so an export
  cannot be removed or renamed without a test failing.

The one remaining uncovered function is the default `readFile` in buildSdkTree,
which exists so tests can inject a fake filesystem; exercising it would mean
reading real SDK files from disk.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ci: harden workflows, add Dependabot, close test coverage gaps
@ucjonathan
ucjonathan merged commit aac0b10 into main Aug 9, 2026
2 checks passed
@ucjonathan
ucjonathan deleted the feat/node-22-bigquery-v9 branch August 9, 2026 00:04
@ucjonathan ucjonathan mentioned this pull request Aug 9, 2026
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