Skip to content

chore: make overrideAccess explicit in tests - #17859

Open
nathanlentz wants to merge 1 commit into
mainfrom
override-access/tests
Open

chore: make overrideAccess explicit in tests#17859
nathanlentz wants to merge 1 commit into
mainfrom
override-access/tests

Conversation

@nathanlentz

@nathanlentz nathanlentz commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Adds an explicit overrideAccess: true to every Local API call in test/ that
previously relied on the default.

This is preparation for making overrideAccess a required property, which lands
later in this stack. It is split out so that the breaking change itself stays small
enough to read.

This changes no behaviour

The Local API currently defaults overrideAccess to true — all 21 local operations
destructure overrideAccess = true. Writing the value explicitly produces exactly what
the default already produced, so every one of these tests asserts the same thing it did
before.

A note on verification

tsconfig.base.json excludes **/*.spec.ts, so a typecheck cannot see most of this
directory — and test/ carries thousands of pre-existing type errors regardless. Relying on all tests to pass to confirm correct changes.

@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

📦 esbuild Bundle Analysis for payload

This analysis was generated by esbuild-bundle-analyzer. 🤖
This PR introduced no changes to the esbuild bundle! 🙌

@nathanlentz
nathanlentz force-pushed the override-access/tests branch 2 times, most recently from 3903c69 to 3f55ee9 Compare August 20, 2026 02:41
@nathanlentz
nathanlentz marked this pull request as ready for review August 20, 2026 13:10
@nathanlentz
nathanlentz force-pushed the override-access/tests branch 2 times, most recently from 167b40d to 2d2fd3f Compare August 20, 2026 15:31
Adds an explicit `overrideAccess: true` to every Local API call in test/
that previously relied on the default.

The Local API currently defaults `overrideAccess` to `true`, so writing
the value explicitly produces exactly what the default already produced.
No behaviour changes.

Four kinds of call site are invisible to both the codemod and a typecheck,
and were found by running the suites instead:

- `(payload as any).create({ ... })` — the receiver is cast, so there is no
  typed parameter to be missing (plugin-mcp, pg-replica)
- `payload2.create({ ... } as any)` — the cast is on the argument, so the
  object literal is `any` (config)
- `payload.create(createDirector)` — the arguments are hoisted into a
  variable, so there is no object literal at the call (relationships)
- Calls added to `main` after this sweep first ran, which arrive whenever
  the branch is rebased (queues, versions)

`test/__helpers/shared/sdk/types.ts` makes `overrideAccess` required on the
PayloadTestSDK argument types, so writing an e2e test asks the same question
as writing product code. Every existing call site already passes a value.

Preparation for making `overrideAccess` a required property.
@nathanlentz
nathanlentz force-pushed the override-access/tests branch from 2d2fd3f to e384d86 Compare August 20, 2026 16:42
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