Skip to content

feat(coverage-matrix): add SDK coverage matrix dashboard#556

Draft
ryanbas21 wants to merge 9 commits intomainfrom
feat/coverage-matrix
Draft

feat(coverage-matrix): add SDK coverage matrix dashboard#556
ryanbas21 wants to merge 9 commits intomainfrom
feat/coverage-matrix

Conversation

@ryanbas21
Copy link
Collaborator

JIRA Ticket

N/A innovation

Description

Add a coverage matrix tool that automatically discovers all @forgerock/* package exports and measures test coverage across unit tests, type tests, and e2e tests — with zero manual path maintenance.

Pipeline (all via Nx):
pnpm nx run @forgerock/coverage-matrix:coverage-report

  • Discovers packages from workspace package.json exports fields
  • Extracts public exports via TypeScript AST
  • Collects V8 unit coverage from Vitest
  • Collects V8 e2e coverage from Playwright's built-in CDP API
  • Merges into a per-export coverage matrix
  • Builds a Svelte dashboard deployable to GitHub Pages

E2E coverage uses Playwright's page.coverage.startJSCoverage() — no instrumented builds, no Vite plugins, no Nx cache concerns. The @forgerock/e2e-shared package provides a coverage fixture that all 26 e2e test files import for automatic collection.

CI integration:

  • Non-blocking coverage-report step in PR workflow
  • Coverage summary posted as PR comment
  • Dashboard deployed to GitHub Pages on merge to main

@changeset-bot
Copy link

changeset-bot bot commented Mar 24, 2026

⚠️ No Changeset found

Latest commit: 60493b7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Mar 24, 2026

View your CI Pipeline Execution ↗ for commit 60493b7

Command Status Duration Result
nx run @forgerock/coverage-matrix:coverage-report ✅ Succeeded 18s View ↗
nx run-many -t build --no-agents ✅ Succeeded <1s View ↗
nx affected -t build lint test typecheck e2e-ci ✅ Succeeded 2m 4s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-24 17:55:27 UTC

nx-cloud[bot]

This comment was marked as outdated.

@coderabbitai
Copy link

coderabbitai bot commented Mar 24, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: df1ce794-46f3-462a-bde6-7f41c3d77c84

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/coverage-matrix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 24, 2026

Open in StackBlitz

@forgerock/davinci-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/davinci-client@556

@forgerock/device-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/device-client@556

@forgerock/journey-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/journey-client@556

@forgerock/oidc-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/oidc-client@556

@forgerock/protect

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/protect@556

@forgerock/sdk-types

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-types@556

@forgerock/sdk-utilities

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-utilities@556

@forgerock/iframe-manager

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/iframe-manager@556

@forgerock/sdk-logger

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-logger@556

@forgerock/sdk-oidc

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-oidc@556

@forgerock/sdk-request-middleware

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-request-middleware@556

@forgerock/storage

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/storage@556

commit: 60493b7

@github-actions
Copy link
Contributor

github-actions bot commented Mar 24, 2026

Deployed 59a382f to https://ForgeRock.github.io/ping-javascript-sdk/pr-556/59a382f1b514708ebf74f6a8181937de355ab394 branch gh-pages in ForgeRock/ping-javascript-sdk

@github-actions
Copy link
Contributor

github-actions bot commented Mar 24, 2026

📦 Bundle Size Analysis

📦 Bundle Size Analysis

🆕 New Packages

🆕 @forgerock/journey-client - 87.8 KB (new)
🆕 @forgerock/journey-client - 0.0 KB (new)

➖ No Changes

@forgerock/sdk-logger - 1.6 KB
@forgerock/sdk-request-middleware - 4.5 KB
@forgerock/iframe-manager - 2.4 KB
@forgerock/sdk-oidc - 4.8 KB
@forgerock/storage - 1.5 KB
@forgerock/sdk-types - 7.9 KB
@forgerock/protect - 150.1 KB
@forgerock/device-client - 9.2 KB
@forgerock/davinci-client - 41.3 KB
@forgerock/sdk-utilities - 11.2 KB
@forgerock/oidc-client - 24.9 KB


13 packages analyzed • Baseline from latest main build

Legend

🆕 New package
🔺 Size increased
🔻 Size decreased
➖ No change

ℹ️ How bundle sizes are calculated
  • Current Size: Total gzipped size of all files in the package's dist directory
  • Baseline: Comparison against the latest build from the main branch
  • Files included: All build outputs except source maps and TypeScript build cache
  • Exclusions: .map, .tsbuildinfo, and .d.ts.map files

🔄 Updated automatically on each push to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Mar 24, 2026

Coverage Matrix

Package Exports Unit Files Unit Exports E2E Uncovered
@forgerock/davinci-client 2 26% (7/27) 0% 50% 1
@forgerock/device-client 1 31% (4/13) 100% 0% 0
@forgerock/journey-client 35 75% (44/59) 91% 66% 3
@forgerock/oidc-client 1 61% (11/18) 100% 100% 0
@forgerock/protect 1 25% (1/4) 100% 100% 0
@forgerock/iframe-manager 1 0% (0/2) 0% 100% 0
@forgerock/sdk-logger 1 25% (1/4) 100% 100% 0
@forgerock/sdk-oidc 6 75% (3/4) 100% 100% 0
@forgerock/sdk-request-middleware 3 40% (2/5) 67% 67% 1
@forgerock/storage 1 50% (1/2) 100% 100% 0
@forgerock/sdk-types 4 0% (0/11) 0% 75% 1
@forgerock/sdk-utilities 19 25% (4/16) 37% 79% 3

Full dashboard · PR preview

@codecov-commenter
Copy link

codecov-commenter commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 14.77%. Comparing base (5d6747a) to head (60493b7).
⚠️ Report is 10 commits behind head on main.

❌ Your project status has failed because the head coverage (14.77%) is below the target coverage (40.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #556       +/-   ##
===========================================
- Coverage   70.90%   14.77%   -56.14%     
===========================================
  Files          53      153      +100     
  Lines        2021    26262    +24241     
  Branches      377     1056      +679     
===========================================
+ Hits         1433     3879     +2446     
- Misses        588    22383    +21795     

see 101 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Add a coverage matrix tool that automatically discovers all @forgerock/*
package exports and measures test coverage across unit tests, type tests,
and e2e tests — with zero manual path maintenance.

Pipeline (all via Nx):
  pnpm nx run @forgerock/coverage-matrix:coverage-report

- Discovers packages from workspace package.json exports fields
- Extracts public exports via TypeScript AST
- Collects V8 unit coverage from Vitest
- Collects V8 e2e coverage from Playwright's built-in CDP API
- Merges into a per-export coverage matrix
- Builds a Svelte dashboard deployable to GitHub Pages

E2E coverage uses Playwright's page.coverage.startJSCoverage() —
no instrumented builds, no Vite plugins, no Nx cache concerns.
The @forgerock/e2e-shared package provides a coverage fixture that
all 26 e2e test files import for automatic collection.

CI integration:
- Non-blocking coverage-report step in PR workflow
- Coverage summary posted as PR comment
- Dashboard deployed to GitHub Pages on merge to main
@ryanbas21 ryanbas21 force-pushed the feat/coverage-matrix branch from b812cbd to 0e53a0d Compare March 24, 2026 16:08
nx-cloud[bot]

This comment was marked as outdated.

The lockfile was regenerated in a way that dropped catalog definitions
for default, effect, and vitest catalogs — causing CI failures for all
packages referencing catalog: specifiers under --frozen-lockfile.
Nx discovers package.json files under tools/coverage-matrix test
fixtures and fails because they aren't valid workspace projects.
Adding .nxignore to exclude the fixtures directory.
nx-cloud[bot]

This comment was marked as outdated.

The deploy step was in ci.yml (PR-only) with a condition that could
never be true. Move it to publish.yml which runs on push to main.

Add note to PR comment that E2E coverage data is not available in PR
CI since e2e tests run on DTE agents without V8 instrumentation.
Coverage fixture now writes to {cwd}/.e2e-coverage/ (the suite's
project dir) instead of the workspace root. This allows Nx Cloud DTE
agents to transfer coverage data back as declared task outputs.

Updated e2e-ci target outputs to include .e2e-coverage, and changed
the collector to scan all e2e/*/.e2e-coverage/ directories.
E2E coverage data is now transferred back from DTE agents via declared
outputs, so the disclaimer is no longer accurate.
@ForgeRock ForgeRock deleted a comment from github-actions bot Mar 24, 2026
@ForgeRock ForgeRock deleted a comment from github-actions bot Mar 24, 2026
…R comment

E2e coverage paths from DTE agents are absolute and differ from the
main runner. Normalize both sides to workspace-relative paths
(packages/...) before comparison.

Use find-comment + create-or-update-comment pattern to update a single
PR comment instead of creating duplicates on each push.
Copy link
Contributor

@nx-cloud nx-cloud bot left a comment

Choose a reason for hiding this comment

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

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud has identified a possible root cause for your failed CI:

We classified this as an environment failure rather than a code change because the error (Timed out waiting 60000ms from config.webServer) occurs before any test files are loaded, meaning the PR's import changes cannot be the cause. Our analysis found no lines in the diff that could logically prevent the local web server from starting within the timeout window.

No code changes were suggested for this issue.

Trigger a rerun:

Rerun CI

Nx Cloud View detailed reasoning on Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

@ForgeRock ForgeRock deleted a comment from github-actions bot Mar 24, 2026
The deploy was only in publish.yml (main branch), so the dashboard
was never populated. Add it to ci.yml as well so it deploys on every
PR push to keep the dashboard current.
PR deploys to pr-{number}/{sha}/coverage-matrix/ alongside docs
preview. Main deploys to /coverage-matrix/ from publish.yml.

Changed Vite base to ./ so the same build works at any URL depth.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants