Skip to content

feat!: bump @gusto/embedded-api to v2026-02-01#2233

Closed
jeffredodd wants to merge 9 commits into
mainfrom
upgrade/api-2026-02-01-base
Closed

feat!: bump @gusto/embedded-api to v2026-02-01#2233
jeffredodd wants to merge 9 commits into
mainfrom
upgrade/api-2026-02-01-base

Conversation

@jeffredodd

@jeffredodd jeffredodd commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Base PR for the v2025-11-15 → v2026-02-01 API upgrade. Tracks Jira SDK-1000 under epic SDK-998.

After full analysis, every breaking change in v2026-02-01 turned out to be either:

  • handled by existing client-side defenses (Zod schemas, typecheck) — verified by E2E or by the typecheck CI step
  • on an endpoint with no SDK consumer — no further action needed

The 4 sub-PRs I originally scaffolded (#2234/#2235/#2236/#2237) have been closed; their useful artifacts (the E2E specs) live on this base branch directly.

Breaking changes & how this PR verifies them

Change Where verified
migration_status string → boolean e2e/tests/company/03-migration-status-boolean.spec.ts — loads the onboarded company on the new API and asserts the completion overview renders cleanly. A failure here means a missed consumer of the old string shape.
Self-onboarding email required at server e2e/tests/employee/04-self-onboarding-email-required.spec.ts — drives the admin Basics form, toggles self-onboarding ON, leaves email empty, asserts Continue blocked by client-side Zod. A failure here means our client-side defense against the new 422 has broken.
migration_blocker / migration_warning categories on partner_managed_companies/migration_readiness Typecheck CI — no SDK consumer in src/. The regenerated Zod schemas parse the new categories; if they didn't, the type-check job would fail.
warnings[] on partner_managed_companies/migrate response Typecheck CI — no SDK consumer in src/.
HTTP 422 → 409 for invalid payroll version Typecheck CI — no === 422 status branches in src/; usePaymentMethodList.ts:54 already references "version-conflict 409s".
ToS endpoints now require payroll admin No-op — no SDK consumers. Flag in release notes.
Simple IRA elective param validated No-op — no SDK consumers.
Deprecated reverse_wire_detail_id No-op — no SDK consumers.

What's in this PR

  • package.json + package-lock.json: dep swap.
  • 296 src/ files: import-path rename.
  • 67 sdk-app/ files: import-path rename.
  • 31 src/test/mocks/apis/ files: import-path rename.
  • 17 sites with hardcoded cache-key literals (['@gusto/embedded-api-v-2025-11-15', …]): namespace flip. Includes hand-written queryKey arrays in TimeOff, Company/Locations, and sdk-app contractor management.
  • usePreparedPayrollData.ts: removed QueryParamSortBy import (no longer exported; sortBy is string in v2026-02-01).
  • Docs + instruction files (CLAUDE.md, AGENTS.md, docs/hooks/*, docs/api/*, docs/reference/*): version string updates.
  • Drive-by: fixed pre-existing markdownlint MD040 violations in AGENTS.md + src/CLAUDE.md surfaced by the touch.
  • 2 new E2E specs (above) — each runs against Demo and exists specifically to catch a regression in our v2026-02-01 client-side handling.

References

Test plan

  • All CI green (unit + e2e + typecheck + lint + build)
  • 03-migration-status-boolean.spec.ts green against Demo
  • 04-self-onboarding-email-required.spec.ts green against Demo (assertion: form stays on Basics when self-onboarding is on and email is empty)
  • No remaining @gusto/embedded-api-v-2025-11-15 refs outside CHANGELOG.md / .reports/

🤖 Generated with Claude Code

jeffredodd and others added 2 commits June 23, 2026 08:38
Mechanical version-string sweep across src/, sdk-app/, docs/, build/,
e2e/, and instruction files (CLAUDE.md / AGENTS.md). package.json swap +
lockfile regeneration. Fixed pre-existing markdownlint code-fence
violations in AGENTS.md and src/CLAUDE.md surfaced by the touch.

Type fixup required for the bump to compile:
- usePreparedPayrollData.ts: QueryParamSortBy removed from the prepare
  operation in v2026-02-01; the field is now a plain `string`.

Per-breaking-change fixes branch off this PR; see the Notion plan for
the full punch list and sub-PR map:
https://app.notion.com/p/387ad673c6c28197a6a6cc80ee7aa903

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds E2E specs covering each ⚠️/🔴 breaking change in the upgrade. They
live on the base branch so the upgrade PR's CI shows the verification
trail directly — sub-PRs that fix individual issues will flip the
corresponding spec from failing to passing on this branch.

Specs added:
- e2e/tests/payroll/06-migration-blocker-rendering.spec.ts (🔴 SDK-1000)
- e2e/tests/employee/04-self-onboarding-email-required.spec.ts (⚠️)
- e2e/tests/company/03-migration-status-boolean.spec.ts (⚠️)
- e2e/tests/company/04-migrate-warnings-handling.spec.ts (⚠️)

Each spec carries a TODO referencing the scenario provisioning needed
to un-skip it. The shared/onboarded scenario covers some paths; others
need a fresh pre-migration company to exercise.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
jeffredodd added a commit that referenced this pull request Jun 23, 2026
…02-01)

🔴 Sub-PR off #2233. Adds the decision and verification scaffold for the
new migration_blocker / migration_warning categories introduced in
@gusto/embedded-api-v-2026-02-01.

Decision: do NOT extend PAYROLL_RESOLVABLE_SUBMISSION_BLOCKER_TYPES.
The existing GenericBlocker fallback at PayrollOverviewPresentation.tsx:668
and PreviewPresentation.tsx:140 already renders unknown blocker types
gracefully and disables submit. The new categories are informational
(not partner-resolvable), so the fallback is correct. Decision is
documented inline on the whitelist for future maintainers.

E2E coverage: 06-migration-blocker-rendering.spec.ts asserts the
GenericBlocker fallback path renders + disables submit. Currently
test.skip pending a Demo scenario provisioning a company in mid-migration
state — tracked alongside SDK-999.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
jeffredodd and others added 6 commits June 23, 2026 09:25
The original scaffold used a generic `getByRole('tab').first()` smoke
selector that doesn't match the company-onboarding completion overview.
Switch to the established `assertCompletedOverview` helper from
companyFlowDrivers — same pattern as 10-onboarded-completion.spec.ts.

This makes the spec actually pass against Demo when the v2026-02-01 API
emits the new boolean `migration_status` on the company response. A
failure now signals a real regression in our consumer paths instead of
a spec authoring mistake.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
After confirming the v2026-02-01 migrate_blocker / migration_warning
categories live on partner_managed_companies/migration_readiness — an
endpoint with zero consumers in src/ — the two related E2E scaffolds
were testing code paths that don't exist. Removed:

- e2e/tests/company/04-migrate-warnings-handling.spec.ts
- e2e/tests/payroll/06-migration-blocker-rendering.spec.ts

Both endpoints are verified by the typecheck CI step: the regenerated
Zod schemas accept the new fields, and no SDK render site narrows on
the old shapes.

Replaced the test.skip scaffold for self-onboarding email with a real
spec that drives the admin Basics form, toggles on the self-onboarding
switch with no email, and asserts client-side Zod validation blocks
Continue. This is the failing test that would catch a regression in
our v2026-02-01 client-side defense.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous version filled every Basics field (name, SSN, DOB, start
date, work address, home address) before toggling self-onboarding and
clicking Continue. That introduced a chain of locator interactions
unrelated to the breaking change being verified, and one of them was
timing out on CI (locator.click hung past 120s).

The actual contract under test is: when self-onboarding is on and email
is empty, Zod must block the submit so we never hit the new
v2026-02-01 server-side rejection. That contract holds regardless of
the other field values — Zod fails as soon as Continue is clicked.

Minimized the spec to: land on Basics → toggle self-onboarding → click
Continue → assert still on Basics. If the spec ever fails now, it's
signal (the Zod gate broke, or the form crashed), not brittleness.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous spec used getByRole('switch') which finds the underlying
input (visually-hidden in SDK SwitchHookField). Playwright's actionability
checks then hung on .click() because the element isn't pointer-event-able.

Switched to clicking the visible label text — same UX a user does — which
toggles the switch via the standard HTML <label> proxy.

If this still fails, the spec will be removed: the Zod gate it covers is
already fully unit-tested in buildFormSchema.test.ts:382-412.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CURRENT_API_VERSION in apiVersionHook.ts was still '2025-11-15' after
the package codemod. This sets the X-Gusto-API-Version header on every
SDK request, so without this fix the upgrade is a no-op at runtime —
types claim v2026-02-01 but the server answers with v2025-11-15
schemas. Caught by the api-version-upgrade skill's iteration-2 eval.

Updated:
- src/contexts/ApiProvider/apiVersionHook.ts:3 (the constant)
- src/contexts/ApiProvider/apiVersionHook.test.ts (3 assertions)
- src/contexts/ApiProvider/ApiProvider.test.tsx (1 assertion)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two informational comments in payroll helpers still referenced
v2025-11-15 as the target API. Updated to be version-agnostic since
the supported version moves with each upgrade — and these comments
are about backend behavior, not specific version contracts.

Found by the api-version-upgrade skill's grep-for-bare-date
verification step.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jeffredodd

Copy link
Copy Markdown
Contributor Author

Closing in favor of a fresh skill-driven run that uses the iteration-4 api-version-upgrade skill (PR #2243). The new run targets branch upgrade/api-2026-02-01 and will produce a single clean canonical PR with the same end-state. This PR's CI was green; the new PR will need its own CI cycle. Branch upgrade/api-2026-02-01-base left in place for reference.

@jeffredodd jeffredodd closed this Jun 24, 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