Skip to content

Syncpack setup v2#624

Open
ryanbas21 wants to merge 4 commits into
mainfrom
syncpack-setup-v2
Open

Syncpack setup v2#624
ryanbas21 wants to merge 4 commits into
mainfrom
syncpack-setup-v2

Conversation

@ryanbas21
Copy link
Copy Markdown
Collaborator

@ryanbas21 ryanbas21 commented May 5, 2026

JIRA Ticket

N/A

Description

sets up syncpack so it automatically keeps our versions aligned and everything.

Summary by CodeRabbit

  • Updates
    • Davinci client API: polling method renamed from poll() to pollStatus() for clearer semantics
    • Dependency management: standardized version catalog usage across the monorepo for more consistent dependency resolution
  • CI/CD
    • Pipeline now validates dependency/version alignment as part of PR checks
  • Tests
    • End-to-end logout flow simplified to rely only on token revocation response

Review Change Stack

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 5, 2026

⚠️ No Changeset found

Latest commit: d474593

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

📝 Walkthrough

Walkthrough

This PR establishes centralized dependency version management using Syncpack across the monorepo and updates the davinci-client's public API, renaming its polling method from poll to pollStatus. The Syncpack setup includes workspace catalog configuration, linting automation in CI and git hooks, and migration of package dependencies to catalog-based version references.

Changes

Syncpack Dependency Version Management

Layer / File(s) Summary
Workspace Catalog
pnpm-workspace.yaml
Added new catalog entries for @forgerock/javascript-sdk (4.9.0), @types/express (5.0.6), tsx (4.21.0), and tslib (^2.5.0).
Syncpack Configuration
.syncpackrc
Introduced Syncpack config with JSON schema reference and source list covering root and selected workspace package.json files.
Automation Setup
.github/workflows/ci.yml, lefthook.yml
Added pnpm syncpack:lint step to CI workflow after project setup; added new syncpack pre-commit hook with glob-scoped file targeting.
Package Scripts & DevDependency
package.json
Added syncpack:lint and syncpack:fix scripts; added syncpack to devDependencies; adjusted devDependency specifiers to use catalog entries.
Monorepo Package Updates
e2e/*, packages/*, tools/*, scratchpad/*
Updated many package.json entries to use catalog: or workspace specifiers for dependencies (e.g., @forgerock/javascript-sdk, @types/express, tsx, tslib, @effect/language-service).

DaVinci Client API Update

Layer / File(s) Summary
Public API Reports
packages/davinci-client/api-report/davinci-client.api.md, packages/davinci-client/api-report/davinci-client.types.api.md
Renamed polling method from poll(collector: PollingCollector) => Poller to pollStatus(collector: PollingCollector) => Poller; reordered return-type union members in start, getClient, and getNode without changing the set of possible types.

e2e DaVinci App OIDC changes

Layer / File(s) Summary
OIDC integration and flows
e2e/davinci-app/main.ts, e2e/davinci-app/tsconfig.app.json, e2e/davinci-app/package.json, e2e/davinci-suites/src/basic.test.ts
Replaced legacy SDK token/logout flows with @forgerock/oidc-client initialization and token.exchange flow; updated logout to use oidcClient.user.logout() and reload; added tsconfig project reference for packages/oidc-client; simplified logout test to await /revoke only.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested reviewers

  • cerebrl
  • ancheetah

"🐰 I hopped through package trees tonight,
Syncpack tucked versions tidy and tight.
Davinci polls no more — pollStatus now sings,
OIDC tokens exchanged with new wings.
Hooray! 🥕"

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The PR description is incomplete relative to the template. While it provides a brief explanation of the changes, it lacks detailed context about what syncpack does and why it was needed. The JIRA Ticket section is marked N/A appropriately, but the Description section is minimal. Expand the description to explain what syncpack accomplishes, why it was implemented, and how it benefits the monorepo's dependency management workflow.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Syncpack setup v2' is directly related to the main objective of the PR, which is to set up syncpack configuration and automation for keeping package versions aligned.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch syncpack-setup-v2

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.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented May 5, 2026

View your CI Pipeline Execution ↗ for commit d474593

Command Status Duration Result
nx affected -t build lint test typecheck e2e-ci ❌ Failed 6m 58s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-12 20:22:03 UTC

nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

@ryanbas21 ryanbas21 force-pushed the syncpack-setup-v2 branch from 8cffe6b to 8978132 Compare May 5, 2026 21:38
Copy link
Copy Markdown
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 is proposing a fix for your failed CI:

We updated the signoff assertion in basic.test.ts to use page.waitForRequest instead of page.waitForResponse for the /signoff check, which fixes the 30s timeout. With @forgerock/javascript-sdk 4.9.0 (introduced by this PR), endSession now uses window.location.assign() rather than fetch(), meaning the 302 redirect is a document navigation that Playwright's CDP-based waitForResponse does not capture. Switching to waitForRequest correctly intercepts the navigation request to /signoff, and the subsequent expect(page.getByText('Username/Password Form')).toBeVisible() continues to verify the full logout redirect completed.

Tip

We verified this fix by re-running @forgerock/davinci-suites:e2e-ci--src/basic.test.ts.

Warning

The suggested diff is too large to display here, but you can view it on Nx Cloud ↗


Apply fix via Nx Cloud  Reject fix via Nx Cloud


Or Apply changes locally with:

npx nx-cloud apply-locally DTyA-1GFB

Apply fix locally with your editor ↗   View interactive diff ↗



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

@ryanbas21 ryanbas21 force-pushed the syncpack-setup-v2 branch from 54a6cfe to 4ff7f04 Compare May 5, 2026 22:41
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 5, 2026

Open in StackBlitz

@forgerock/davinci-client

pnpm add https://pkg.pr.new/@forgerock/davinci-client@624

@forgerock/device-client

pnpm add https://pkg.pr.new/@forgerock/device-client@624

@forgerock/journey-client

pnpm add https://pkg.pr.new/@forgerock/journey-client@624

@forgerock/oidc-client

pnpm add https://pkg.pr.new/@forgerock/oidc-client@624

@forgerock/protect

pnpm add https://pkg.pr.new/@forgerock/protect@624

@forgerock/sdk-types

pnpm add https://pkg.pr.new/@forgerock/sdk-types@624

@forgerock/sdk-utilities

pnpm add https://pkg.pr.new/@forgerock/sdk-utilities@624

@forgerock/iframe-manager

pnpm add https://pkg.pr.new/@forgerock/iframe-manager@624

@forgerock/sdk-logger

pnpm add https://pkg.pr.new/@forgerock/sdk-logger@624

@forgerock/sdk-oidc

pnpm add https://pkg.pr.new/@forgerock/sdk-oidc@624

@forgerock/sdk-request-middleware

pnpm add https://pkg.pr.new/@forgerock/sdk-request-middleware@624

@forgerock/storage

pnpm add https://pkg.pr.new/@forgerock/storage@624

commit: 4ff7f04

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 17.61%. Comparing base (5d6747a) to head (4ff7f04).
⚠️ Report is 94 commits behind head on main.

❌ Your project status has failed because the head coverage (17.61%) 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     #624       +/-   ##
===========================================
- Coverage   70.90%   17.61%   -53.29%     
===========================================
  Files          53      154      +101     
  Lines        2021    24243    +22222     
  Branches      377     1160      +783     
===========================================
+ Hits         1433     4271     +2838     
- Misses        588    19972    +19384     

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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Deployed 9bc8071 to https://ForgeRock.github.io/ping-javascript-sdk/pr-624/9bc8071025d8c7dd8240d84ecea0109f9379ea22 branch gh-pages in ForgeRock/ping-javascript-sdk

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

📦 Bundle Size Analysis

📦 Bundle Size Analysis

🚨 Significant Changes

🔻 @forgerock/device-client - 0.0 KB (-10.0 KB, -100.0%)
🔻 @forgerock/journey-client - 0.0 KB (-91.9 KB, -100.0%)

📊 Minor Changes

📉 @forgerock/device-client - 10.0 KB (-0.0 KB)
📉 @forgerock/journey-client - 91.9 KB (-0.0 KB)

➖ No Changes

@forgerock/davinci-client - 48.9 KB
@forgerock/oidc-client - 25.2 KB
@forgerock/sdk-utilities - 11.2 KB
@forgerock/sdk-types - 7.9 KB
@forgerock/protect - 144.6 KB
@forgerock/storage - 1.5 KB
@forgerock/sdk-oidc - 4.8 KB
@forgerock/sdk-request-middleware - 4.5 KB
@forgerock/sdk-logger - 1.6 KB
@forgerock/iframe-manager - 2.4 KB


14 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

ryanbas21 added 4 commits May 12, 2026 14:12
- Install syncpack@15 for monorepo dependency alignment enforcement
- Add .syncpackrc with JSON schema reference
- Add syncpack:lint and syncpack:fix scripts (with explicit --source to
  exclude dist/ build artifacts, which syncpack reads via pnpm-workspace)
- Extend pnpm default catalog with: @forgerock/javascript-sdk, @types/express,
  tslib, tsx
- Migrate all consumers to catalog: references — fixes DiffersToCatalog
  and DiffersToHighestOrLowestSemver across 11 package.json files
4.9.0 added Accept: application/json to all requests, causing PingOne's
/signoff endpoint to return JSON instead of a 302 redirect, breaking the
logout e2e test.
TokenManager.getTokens → oidcClient.token.exchange
FRUser.logout → oidcClient.user.logout
Config.setAsync removed (oidc-client manages its own config)

This removes the last dependency on the legacy SDK from the davinci e2e app.
@ryanbas21 ryanbas21 force-pushed the syncpack-setup-v2 branch from 4ff7f04 to d474593 Compare May 12, 2026 20:13
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@e2e/davinci-app/main.ts`:
- Around line 89-93: Don't cast DaVinciConfig to OidcConfig; instead
construct/validate a proper OidcConfig before calling oidc. Replace the `oidc({
config: config as OidcConfig })` call by building an explicit OidcConfig object
(containing required fields clientId, redirectUri, scope, and
serverConfig.wellknown) from the existing config or by calling a
conversion/validation helper (e.g., buildOidcConfig(config) /
validateOidcConfig(config)) so structural incompatibilities are caught at
compile time; then pass that validated OidcConfig into the oidc(...) call and
assign the result to oidcClient as before.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bee8a638-bca7-4225-a26a-5f93fbf736ca

📥 Commits

Reviewing files that changed from the base of the PR and between 8cffe6b and d474593.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (19)
  • .github/workflows/ci.yml
  • .syncpackrc
  • e2e/am-mock-api/package.json
  • e2e/davinci-app/main.ts
  • e2e/davinci-app/package.json
  • e2e/davinci-app/tsconfig.app.json
  • e2e/davinci-suites/src/basic.test.ts
  • e2e/device-client-app/package.json
  • e2e/protect-app/package.json
  • lefthook.yml
  • package.json
  • packages/davinci-client/api-report/davinci-client.api.md
  • packages/davinci-client/api-report/davinci-client.types.api.md
  • packages/device-client/package.json
  • packages/journey-client/package.json
  • pnpm-workspace.yaml
  • scratchpad/package.json
  • tools/api-report/package.json
  • tools/interface-mapping-validator/package.json
💤 Files with no reviewable changes (1)
  • e2e/davinci-suites/src/basic.test.ts
✅ Files skipped from review due to trivial changes (6)
  • scratchpad/package.json
  • e2e/davinci-app/tsconfig.app.json
  • packages/journey-client/package.json
  • .syncpackrc
  • e2e/am-mock-api/package.json
  • tools/api-report/package.json
🚧 Files skipped from review as they are similar to previous changes (8)
  • .github/workflows/ci.yml
  • packages/device-client/package.json
  • tools/interface-mapping-validator/package.json
  • pnpm-workspace.yaml
  • e2e/protect-app/package.json
  • e2e/device-client-app/package.json
  • lefthook.yml
  • package.json

Comment thread e2e/davinci-app/main.ts
Comment on lines +89 to +93
const oidcResult = await oidc({ config: config as OidcConfig });
if ('error' in oidcResult) {
throw new Error(`Failed to initialize oidc client: ${oidcResult.error}`);
}
const oidcClient = oidcResult;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Inspect OidcConfig and the oidc() return type / error shape
fd -t f 'tsconfig.lib.json' packages/oidc-client 2>/dev/null
fd -t f -e ts . packages/oidc-client/src 2>/dev/null | head -50

# OidcConfig definition
ast-grep --pattern 'export type OidcConfig = $$$'
ast-grep --pattern 'export interface OidcConfig { $$$ }'

# DaVinciConfig definition
ast-grep --pattern 'export type DaVinciConfig = $$$'
ast-grep --pattern 'export interface DaVinciConfig { $$$ }'

# oidc() factory return type / error shape
ast-grep --pattern 'export function oidc($$$) { $$$ }'
ast-grep --pattern 'export const oidc = $$$'
rg -nP --type=ts -C3 "\berror\s*:" packages/oidc-client/src 2>/dev/null | head -60

Repository: ForgeRock/ping-javascript-sdk

Length of output: 5411


🏁 Script executed:

# Get OidcConfig definition
rg -n "export type OidcConfig|export interface OidcConfig" packages/oidc-client/src --type=ts -A 10

# Get DaVinciConfig definition
rg -n "export type DaVinciConfig|export interface DaVinciConfig" --type=ts -A 10

Repository: ForgeRock/ping-javascript-sdk

Length of output: 1443


🏁 Script executed:

# Check the oidc function export and its return type
rg -n "export.*function oidc|export.*const oidc" packages/oidc-client/src --type=ts -A 5

# Look for the complete oidc API return type (likely has data + error union)
rg -n "type.*OidcFactoryResult|interface.*OidcFactoryResult|export.*Result.*oidc|return.*error.*data" packages/oidc-client/src --type=ts -B 2 -A 5

Repository: ForgeRock/ping-javascript-sdk

Length of output: 1015


🏁 Script executed:

# Verify the error field type in the main oidc API
cat packages/oidc-client/src/lib/oidc.api.ts | head -200

Repository: ForgeRock/ping-javascript-sdk

Length of output: 6924


🏁 Script executed:

# Get full oidc function signature including return type
cat packages/oidc-client/src/lib/client.store.ts | sed -n '51,100p'

Repository: ForgeRock/ping-javascript-sdk

Length of output: 1549


🏁 Script executed:

# Search for the return type definition
rg -n "OidcClientResult|OidcFactoryResult|type.*oidc.*Result" packages/oidc-client/src --type=ts -A 3

Repository: ForgeRock/ping-javascript-sdk

Length of output: 55


🏁 Script executed:

# Look for where oidc function returns error
rg -n "return.*error|error.*:" packages/oidc-client/src/lib/client.store.ts --type=ts -B 2 -A 2 | head -80

Repository: ForgeRock/ping-javascript-sdk

Length of output: 3274


The type cast config as OidcConfig masks a structural incompatibility.

OidcConfig (extends AsyncLegacyConfigOptions with required clientId, redirectUri, scope, serverConfig.wellknown) is incompatible with DaVinciConfig (extends AsyncLegacyConfigOptions with only optional responseType). Casting bypasses type checking and will only surface missing required fields at runtime. Build an OidcConfig explicitly or export a validation/conversion helper instead of asserting the type.

The error message handling on line 91 is fine—oidcResult.error is always a string from the oidc factory.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/davinci-app/main.ts` around lines 89 - 93, Don't cast DaVinciConfig to
OidcConfig; instead construct/validate a proper OidcConfig before calling oidc.
Replace the `oidc({ config: config as OidcConfig })` call by building an
explicit OidcConfig object (containing required fields clientId, redirectUri,
scope, and serverConfig.wellknown) from the existing config or by calling a
conversion/validation helper (e.g., buildOidcConfig(config) /
validateOidcConfig(config)) so structural incompatibilities are caught at
compile time; then pass that validated OidcConfig into the oidc(...) call and
assign the result to oidcClient as before.

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.

3 participants