Skip to content

[INT-3874] Harden CI workflow and fix red audit gate - #130

Merged
diego-suntaxi-onfleet merged 4 commits into
masterfrom
INT-3874-ci-improvements
Sep 21, 2026
Merged

diego-suntaxi-onfleet merged 4 commits into
masterfrom
INT-3874-ci-improvements

Conversation

@diego-suntaxi-onfleet

@diego-suntaxi-onfleet diego-suntaxi-onfleet commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Describe the solution

The Security audit job on master failed on 2026-09-15 because the lockfile pinned js-yaml 4.1.1 and older brace-expansion releases with high-severity advisories. That part has since landed on master through #131 and #132 (this branch is merged up to them and no longer changes package.json or the lockfile). What remains here is the CI hardening: run concurrency, job timeouts, current action versions, and removal of the dead Travis config.

Most of the original CI work (PR-level workflow, Node 20/22/24 matrix, lint/audit/coverage jobs, createRequire import fix, lint baseline) already landed in #127 and is not repeated here.

Two deliberate choices:

  • No paths-ignore for README/CHANGELOG. Once branch protection requires these checks, a workflow that is skipped for docs-only changes never reports them, and the PR cannot be merged. Each job takes about 20 seconds, so always running is cheap. A comment in ci.yml records this.
  • engines stays at >=20.0.0. The >=20.10.0 bump was only needed for the with { type: 'json' } import syntax, which [INT-3686] Overhaul CI/CD and quality assurance #127 replaced with createRequire.

Verified with fnm on Node 20.20.2, 22.22.2 and 24.15.0: npm ci, npm run lint (0 errors), npm test (44 passing), npm run coverage (thresholds met), npm audit --audit-level=high (0 vulnerabilities).


Changed

  • ci.yml: concurrency with cancel-in-progress so superseded runs on the same branch/PR are cancelled; timeout-minutes: 10 on every job in both ci.yml and npm-publish.yml.
  • ci.yml and npm-publish.yml: actions/checkout, actions/setup-node and actions/upload-artifact bumped to v7. The v2/v4 releases target the deprecated Node 20 runner and now emit warnings on every job.

Removed

  • .travis.yml (dead since GitHub Actions was adopted).

Security


Follow-up for a repo admin after this merges (not doable from a PR)

Settings → Branches → master → enable Require status checks to pass before merging with Require branches to be up to date before merging, and select these checks:

  • Lint
  • Test (Node 20)
  • Test (Node 22)
  • Test (Node 24)
  • Security audit
  • Coverage

The names only appear in the picker after they have run at least once, which this PR's CI run takes care of.

🤖 Generated with Claude Code

Review in cubic

- Regenerate package-lock.json via `npm audit fix`: js-yaml 4.1.1 -> 4.3.2
  and brace-expansion 1.x/2.x/5.x to patched releases. Clears the two
  high-severity advisories that have failed the Security audit job on
  master since 2026-09-15. package.json is unchanged.
- ci.yml: add concurrency (cancel superseded runs per branch/PR) and a
  10-minute timeout on every job. No paths-ignore on purpose: with required
  status checks, a skipped workflow leaves docs-only PRs unmergeable
  (explained in a comment in the file).
- ci.yml + npm-publish.yml: bump actions/checkout, actions/setup-node and
  actions/upload-artifact to v7. The v2/v4 releases target the deprecated
  Node 20 runner and now emit warnings on every job.
- Remove dead .travis.yml.
- CHANGELOG: Unreleased entry.

Already done on master by #127 and therefore not repeated here: lockfile
JSON repair, createRequire replacing the JSON import attribute, Node
20/22/24 matrix, lint/audit/coverage jobs, mocha env for test/**.
engines stays at >=20.0.0 because the `with {}` syntax that motivated
>=20.10.0 is no longer used.

Verified with fnm on Node 20.20.2, 22.22.2 and 24.15.0: npm ci, lint (0
errors), 44 tests passing, coverage thresholds met, audit clean at high.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread CHANGELOG.md Outdated
Comment thread .github/workflows/npm-publish.yml
Comment thread CHANGELOG.md Outdated
- npm-publish.yml: timeout-minutes: 10 on build, publish and notify so a
  stalled release job fails fast instead of holding a runner for 6 hours.
  No concurrency group on purpose: cancelling an in-flight npm publish is
  worse than a slow one, and release-triggered runs do not overlap.
- CHANGELOG: only v4 of the bumped actions targets the Node 20 runtime
  (v2 was node12/16), so the parenthetical now says v4.
- CHANGELOG: lockfile advisory fix moved from Changed to Security, per
  Keep a Changelog and the repo PR template.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 2 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would auto-approve. Bumps GitHub Actions to v7, adds CI concurrency/timeouts, drops the dead Travis config, and regenerates package-lock.json to clear dev-only audit advisories without changing package.json; a bounded CI/security hardening change.

Re-trigger cubic

Resolve package-lock.json conflict by taking master's version: #131 and
#132 already landed the same js-yaml 4.3.2 / brace-expansion patches
plus new overrides, so this branch no longer changes dependencies.
Verified: npm ci in sync, audit clean at high, lint OK, 44 tests passing.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
jvoliveiran
jvoliveiran previously approved these changes Sep 21, 2026

@jvoliveiran jvoliveiran left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review — round 1

Reviewed the branch diff against master with the PR description and INT-3874 as context. The CI hardening is sound: the v7 actions resolve, all checks pass, and the diff matches the stated remaining scope of the ticket.

Findings — no blocks:

  • 1 suggestion (potential bug): cancel-in-progress also applies to push runs on master, so back-to-back merges can leave a merge commit without any CI verdict.
  • 3 neats: missing cache: npm in the publish workflow, a changelog parenthetical that misstates the replaced action version, and pre-existing trailing whitespace on a touched hunk.

One additional finding — slackapi/slack-github-action@v1.18.0 still targets the deprecated Node 16 runtime, the same warning class this PR removes elsewhere — was withdrawn as out of scope during the local review round. Recommended as a small follow-up ticket (the job already sets the v2-only SLACK_WEBHOOK_TYPE env var, so the config half-anticipates the upgrade).

No open blocks and one open suggestion, so this review approves.

Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/npm-publish.yml Outdated
Comment thread .github/workflows/npm-publish.yml Outdated
Comment thread CHANGELOG.md Outdated
- ci.yml: only cancel in-progress runs for pull_request events. Pushes to
  master share one concurrency group, so cancelling there could leave a
  merge commit with no CI verdict after back-to-back merges.
- npm-publish.yml: add `cache: npm` to both setup-node steps to match
  ci.yml; this also drops the trailing whitespace on `node-version: 20`.
- CHANGELOG.md: the publish workflow was bumped from v2, not v4, so the
  parenthetical now says "the replaced v2/v4 releases"; the concurrency
  bullet now says runs of the same pull request are cancelled.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 3 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would auto-approve. Hardens CI workflows (action version bumps, job timeouts, PR-only run cancellation, npm cache) and removes the dead Travis config, with changelog updates; development-only tooling changes with no product-behavior impact.

Re-trigger cubic

jvoliveiran
jvoliveiran previously approved these changes Sep 21, 2026

@jvoliveiran jvoliveiran left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review — round 2

All four findings from round 1 are fixed in commit d0b4764 and verified against the code:

  • Fixed: conditional cancel-in-progress (master push runs are no longer cancellable), cache: npm on both publish-workflow jobs, changelog parenthetical corrected to the replaced v2/v4 releases, trailing whitespace removed.
  • Withdrawn (round 1): the slackapi/slack-github-action@v1.18.0 Node 16 runtime bump — out of scope here; recommended as a small follow-up ticket.
  • Still open: none. New findings: none.

All CI checks pass on the latest commit. Approving.

@joao-onfleet
joao-onfleet dismissed stale reviews from jvoliveiran and jvoliveiran September 21, 2026 18:46

Approval posted from the wrong account; re-approved from joao-onfleet.

@joao-onfleet joao-onfleet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-posting the approval from the correct account (the two dismissed approvals from jvoliveiran were mine, posted from my personal account by mistake).

Review outcome after 2 rounds: all four findings fixed in d0b4764 and verified (conditional cancel-in-progress so master push runs are never cancelled, cache: npm on both publish-workflow jobs, changelog v2/v4 wording, trailing whitespace); one finding withdrawn as out of scope (slackapi/slack-github-action Node 16 runtime bump — recommended as a follow-up ticket). No open findings, all CI checks pass.

@diego-suntaxi-onfleet
diego-suntaxi-onfleet merged commit b154688 into master Sep 21, 2026
10 checks passed
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.

3 participants