Skip to content

Update @mitodl/mitxonline-api-axios to 2026.8.6 - #3734

Open
ChristopherChudzicki wants to merge 1 commit into
mainfrom
update-mitxonline-api-client
Open

Update @mitodl/mitxonline-api-axios to 2026.8.6#3734
ChristopherChudzicki wants to merge 1 commit into
mainfrom
update-mitxonline-api-client

Conversation

@ChristopherChudzicki

@ChristopherChudzicki ChristopherChudzicki commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

What are the relevant tickets?

None, but doing this as a prereq to #3709

Description (What does it do?)

Bumps the mitxonline api client; adds fields to factories, etc.

How can this be tested?

Tests should pass

} = useQuery(managerOrganizationQueries.managerOrganizationsList())

const org = managerOrgs?.find(matchOrganizationBySlug(orgSlug))
const orgUuid = getOrgUuid(org)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Previously, this did

  const value = (org as { sso_organization_id?: unknown } | undefined)
    ?.sso_organization_id
  return typeof value === "string" && value.length > 0 ? value : null

I.e., it was a type-safe way of getting sso_organization_id before it was included in the API client.

(I guess it also omitted empty string "" uuids. The new version, direct access, does not do that. But if the uuid is empty, then we have bigger problems... we should trust the API)

@ChristopherChudzicki ChristopherChudzicki added the Needs Review An open Pull Request that is ready for review label Aug 6, 2026
@ChristopherChudzicki
ChristopherChudzicki marked this pull request as ready for review August 6, 2026 20:48
Copilot AI balanced review requested due to automatic review settings August 6, 2026 20:48

Copilot AI 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Three required-field additions in the regenerated client are breaking:

- `ManagerEnrollmentCode` gains `email_status` and
  `email_status_event_timestamp`
- `OrganizationPage` gains `sso_organization_id: string | null`
- `b2bManagerOrganizationsList` gains a positional `sso_organization_id`
  parameter ahead of `options` (our only caller passes no arguments, so
  it is unaffected)

Everything else in the release is additive and currently unused:
`OrderStatus`/`ordersStatusRetrieve`, `b2bServiceOrganizationManagerCheck`,
`EmailStatusEnum`, `anonymous_id` on baskets, and optional `LegalAddress`
fields. `Basket.user`/`BasketWithProduct.user` also loosened to
`number | null | undefined`; nothing reads `.user`.

Give the two factories the new fields. `OrganizationCards.test.tsx` built
eleven `OrganizationPage` literals by hand; route them through the factory
the file already uses elsewhere so the next required field does not break
them again. Every field except `sso_organization_id` was already
explicitly overridden and `mergeOverrides` overwrites arrays rather than
merging, so the objects are unchanged.

Drop the `Analytics/orgUuid.ts` shim, which carried a TODO to delete
itself once this client landed, and read `org.sso_organization_id`
directly. Behavior is unchanged: all four analytics queries are gated on
`enabled: analyticsAvailable`, which requires a truthy `orgUuid`, so an
absent, null, or empty UUID still reads as "analytics unavailable" and
never reaches the API with `undefined` in the path.

Pin the version exactly rather than with a caret, matching
`@mitodl/mit-learn-api-axios` and `@mitodl/smoot-design`. A caret on a
date-versioned generated client lets a plain `yarn install` pull one that
adds required fields, which is exactly the breakage above.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ChristopherChudzicki
ChristopherChudzicki force-pushed the update-mitxonline-api-client branch from 15449b9 to d4c7011 Compare August 7, 2026 14:05
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

OpenAPI Changes

No changes detected

View full changelog

Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review An open Pull Request that is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants