Skip to content

ci: unit tests on pull requests (Node 24); untrack coverage; declare and prune dependencies - #69

Draft
pritesh-jain-cstk wants to merge 4 commits into
test/MKT-22142-fix-specs-coveragefrom
chore/MKT-22143-ci-deps
Draft

pritesh-jain-cstk wants to merge 4 commits into
test/MKT-22142-fix-specs-coveragefrom
chore/MKT-22143-ci-deps

Conversation

@pritesh-jain-cstk

@pritesh-jain-cstk pritesh-jain-cstk commented Nov 4, 2026 •

Copy link
Copy Markdown

Branch graph

Epic MKT-21682. This PR is highlighted. Only [Routine] depends on [Tests]; the rest are independent.

Merge order: #68 before #69 (#69 is based on #68). #64 and #69 both change package.json and package-lock.json: merge #64 first, then bring master into #69 with a merge (no rebase) and regenerate the lock with npm install --legacy-peer-deps (expect a lock conflict). #65, #66, #67 and #70 are independent.

graph LR
  master --> bug1["Bug: host-only extensionEvent MKT-22139"]
  master --> bug2["Bug: getField console.log MKT-22140"]
  master --> sec["Security: Dependabot MKT-22141"]
  master --> s64["Snyk/audit + LICENSE: existing #64"]
  master --> tests["[Tests] MKT-22142"]
  tests --> ci["[Routine] MKT-22143"]
  master --> docs["[Docs] MKT-22144"]
  style routine fill:#f9d71c,stroke:#333,stroke-width:2px
Loading

What

Jira: MKT-22143

Depends on #68 (base branch; CI runs its tests).

Consumer impact: none. Only devDependencies, CI and ignored files change; the runtime dependencies (post-robot, wolfy87-eventemitter) and the dist build inputs are the same.

  • .github/workflows/unit-test.yml: build and test:coverage on every PR and push to master, Node from the new .nvmrc (24, current LTS). No workflow ran tests on PRs before; only the release workflow did (Node 16, actions v2; left alone here). Workflow files need @contentstack/security-admin review; this is a draft and no review is requested.
  • webpack.config.js: ESLint fix: !process.env.CI, so CI builds report lint problems instead of rewriting sources (no change to dist: nothing is auto-fixable today). Lint warnings are not gated (26 pre-existing max-len/no-console warnings).
  • karma coverage check at 90% (statements, branches, functions, lines); test:coverage enforces it and CI runs that. Current: 97.34 / 96.24 / 98.62 / 97.23.
  • coverage/ (43 files, rewritten by test runs) untracked and ignored; this is routine.clean-install-build.
  • package.json: declares eslint-config-airbnb-base (.eslintrc extends airbnb-base/legacy; it came in only through eslint-config-airbnb) and removes eslint-config-airbnb, @babel/cli, babel-eslint, braces, jasmine, jsdoc-to-markdown, karma-eslint, karma-spec-reporter, nyc, webpack-dev-server (imported, configured or scripted nowhere; checked with depcheck and grep). The lock loses 313 entries; only call-bind (1.0.8 -> 1.0.9) and one nested semver patch move. npm audit: 46 (4 Critical, 25 High) -> 31 (0 Critical, 21 High).
  • Still needs --legacy-peer-deps: eslint-config-airbnb-base@15 peers eslint 8 and the repo is on eslint 9. Fixing that is an ESLint flat-config migration, not done here.
  • Overlap: fix: raise webpack floor and update vulnerable dev deps in lock file #64 also changes package.json and package-lock.json; whichever merges second needs npm install --legacy-peer-deps to resolve the lock.

Readiness items

routine.clean-install-build, routine.dependencies, CI hygiene

Commands (exit codes, Node 24 locally)

Command master this branch
npm ci 1 (ERESOLVE) 1 (ERESOLVE, see above)
npm ci --legacy-peer-deps 0 0
npm run build 0 (26 ESLint warnings) 0 (same)
lint / typecheck n/a (lint runs inside build; plain JS) n/a
npm test 1 (5 failed, 128 passed) 1 (same, no code change)
npm audit --omit=dev 0 0
npm audit 1 (46: 4 Critical, 25 High) 1 (31: 0 Critical, 21 High; rest via #64)
npm run test:coverage n/a 0 (133 passed, gate 90% met)

Commits went through the repo's hooks (GitGuardian pre-commit and pre-push); none bypassed. Local Snyk cannot authenticate (org permission / 401), so the PR's Snyk checks are the scan.

CI: security-license fails here as on master: it requires the current year in LICENSE (still 2019-2025). Fixed by #64 (DX-29607), not by this PR. All Snyk, GitGuardian, CodeQL and policy checks pass. The new Unit tests workflow ran green on this PR (build, 133 specs, coverage gate).

🤖 Generated with Claude Code

PriteshJain and others added 2 commits November 4, 2026 08:59
…utput

MKT-22143.
- .github/workflows/unit-test.yml: build and test:coverage on every PR and
  push to master, Node from the new .nvmrc (24, current LTS).
- karma coverage check at 90% (statements, branches, functions, lines);
  only test:coverage enforces it, and CI runs that.
- coverage/ was tracked and rewritten by test runs: untracked and ignored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…endencies

MKT-22143. .eslintrc extends airbnb-base/legacy, which came in only through
eslint-config-airbnb. Removed (imported, configured or scripted nowhere):
@babel/cli, babel-eslint, braces, jasmine, jsdoc-to-markdown, karma-eslint,
karma-spec-reporter, nyc, webpack-dev-server, eslint-config-airbnb.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@snyk-io

snyk-io Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

MKT-22143.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security 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.

2 participants