Repository navigation
fix(core): accept null address and description on organizations - #463
Conversation
The organizations API sends null for an absent address (every organization sampled) and for some descriptions. OrganizationSchema only allowed those fields to be omitted, so getOrganization threw for every lookup and BibleVersionPicker never showed publisher names. Test mocks now mirror the live response shape, including null fields. YPE-6399 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: d44ac04 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Per docs/testing.md: one top-level workflow test with its own client factory instead of two cases nested under beforeEach. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
camrun91
left a comment
There was a problem hiding this comment.
Thanks, @arinthros! The schema fix is correct, and the CI is green. I have some required changes before I can approve. Most are small. I put 4 inline comments on the diff. The items below are in files that are not in the diff.
1. Required: test the UI path with null fields
packages/ui/src/test/mock-data/organizations.json
The UI mock does not have address or description. Thus the UI tests do not see the null values that caused the bug. Also, no story checks that "Biblica" shows in the version picker (docs/testing.md: "Account for what their mocks bypass" and "Prefer E2E").
Please give the mock the live shape, with the null fields. Then add an integration story with a play check that "Biblica" shows.
2. Required: update the branch
The branch is behind main. Please merge or rebase main, then make sure the CI is green. I did a local merge, and it was clean. All tests passed.
When these items are done, I can approve. Thank you!
|
@arinthros reviewed and commented. Feel free to push back on anything that you think deserves the push back. |
…tion-nullable-fields
- UI organization mocks now match the live API shape, with null address, description, email, phone, and parent_organization_id - Add a PublisherNames story that checks the picker shows "Biblica" - Add a schema test that only address and description accept null - Changeset notes that the Organization types now include null - Schema comments link the spec follow-up, YPE-6438 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @camrun91, all addressed:
Locally, core, hooks, and ui tests pass (345, 200, 542), plus build, lint, and typecheck. In the Storybook project, 69 of 70 pass; |
…tion-nullable-fields
Why
OrganizationsClient.getOrganizationthrows a validation error for every organization the live API returns. The API sendsaddress: nullwhen an organization has no address, anddescription: nullfor some, butOrganizationSchemaonly allowed those fields to be omitted.useOrganizationsdrops failed queries, soBibleVersionPickerhas not shown publisher names since they shipped in 2.2.0.Jira: YPE-6399. Spec follow-up: YPE-6438
Sampled against production on 2026-10-29: the
organization_idof every version fromgetVersionsfor en, es, fr, pt, de, ko (11 unique organizations).addressdescriptionphone,parent_organization_idemailgetOrganizationthrew on 11/11.What changed
descriptionandaddressinOrganizationSchemaacceptnull.addressand a nulldescription, and a schema test that only those two fields acceptnull(nameandwebsite_urlstill reject it).packages/ui/src/test/mock-data/organizations.json) now match the live shape too, with the null fields.PublisherNamesstory (integration) checks that "Biblica" shows in the version picker.Scope
nullin live responses.name,primary_language, andwebsite_urlwere never null in the sample, so they stay as they are.Tradeoffs
The SDK matched the published spec, which declares
descriptionandaddresswithoutnullable: true. This PR follows the API's actual behavior. YPE-6438 tracks fixing the spec (or having the API omit the fields). The spec's source is GitLabapis/platform/transformersspec/schemas/organization.yaml; itssync_portal_artifactsjob copies it to the developer hub'sdevdocs/apis/schemas/organization.yaml, so the fix belongs in transformers. The Portal hit the same pattern in YPE-5767.Blast Radius
Organization['description']andOrganization['address']widen to includenull. Nothing in hooks or ui reads either field. A host that reads them with strict null checks may need a null check, but those reads could not have succeeded before, since every response failed to parse. The changeset calls out the type change.Verification
invalid_typeonaddressanddescription. After the fix they pass.PublisherNamesstory: fails with the old schema ("Unable to find an element with the text: Biblica"), passes with the fix.main:pnpm exec turbo testfor core, hooks, and ui: 345 (2 skipped), 200, and 542 passed.vitest run --project storybook: 69 of 70 passed locally.Navigate And Focusinbible-reader-search.stories.tsxfails the same way without this PR's changes.pnpm build,pnpm lint, andpnpm exec turbo typecheck --forcepass.Test plan
new OrganizationsClient(apiClient).getOrganization('05a9aa40-37b6-4e34-b9f1-a443fa4b1fff')(Biblica) against production resolves withaddress: null.BibleVersionPickerin the Vite example. Publisher names show above version titles (e.g. Biblica above NIV).🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no actionable defects remain.Summary
Allows
OrganizationSchemato accept nulladdressanddescriptionvalues without changing the other fields.Reviews (4) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile