Skip to content

Shrink PartnersClient and remove the GraphQL it exclusively used#8111

Open
isaacroldan wants to merge 3 commits into
partners-cleanup/01-extract-migration-interfacefrom
partners-cleanup/03-shrink-partners-client
Open

Shrink PartnersClient and remove the GraphQL it exclusively used#8111
isaacroldan wants to merge 3 commits into
partners-cleanup/01-extract-migration-interfacefrom
partners-cleanup/03-shrink-partners-client

Conversation

@isaacroldan

@isaacroldan isaacroldan commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

PartnersClient cleanup — 2 of 3. The keystone. No behavior change on the live migration path.

WHY are these changes introduced?

PartnersClient is only ever instantiated to run the three legacy extension migrations, yet it implements the full DeveloperPlatformClient. Reducing it to a migration-only client lets us delete the large surface of code — methods, GraphQL documents, and shared query consts — that only it used.

The shrink and the deletions are one PR on purpose: flipping PartnersClient to implements MigrationDeveloperPlatformClient orphans all of that code at once, and the Knip (unused-code) check runs per-PR, so the removal has to land in the same PR that orphans it.

WHAT is this pull request doing?

Three commits:

  1. Shrink PartnersClient to the migration surface — implement only MigrationDeveloperPlatformClient; delete the dead methods and every import they exclusively pulled in, keeping the migrate mutations plus the session/token/request infrastructure. session() no longer makes a redundant Partners currentAccountInfo round-trip (the migration path only reads the token). Test trimmed to the surviving behavior.
  2. Delete orphaned partners-era GraphQL documents — 16 now-unreferenced files (app_active_version, app_version_by_tag, create_app, find_app, find_org, find_org_basic, find_store_by_domain, generate_signed_upload_url, subscribe_to_app_logs, template_specifications, the two functions/*_schema_definition, and the partners/{all-orgs,dev-stores-by-org} query + generated pairs) plus their no-inline-graphql allowlist entries and the matching app.test-data.ts stubs.
  3. Trim dead partners-era consts — remove the PartnersClient-only query/mutation consts from shared GraphQL files (app_deploy, app_release, app_versions_diff, get_versions_list, update_urls, all_app_extension_registrations, extension_specifications, and the webhook request-* services), keeping the schema/variable types the App Management client still uses; remove generateFetchAppLogUrl from cli-kit; drop the corresponding allowlist entries.

Net ~1,830 lines removed.

How to test your changes?

pnpm nx type-check app cli-kit, lint, and Knip pass. Migration commands still work — only dead code and a redundant network round-trip were removed.

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing — I've identified the correct bump type (patch for bug fixes · minor for new features · major for breaking changes) and added a changeset with pnpm changeset add

isaacroldan commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Jul 16, 2026
isaacroldan and others added 3 commits July 16, 2026 16:39
Third step of the PartnersClient cleanup, and the keystone. PartnersClient is only ever instantiated to run the three legacy extension migrations, so it now implements just MigrationDeveloperPlatformClient. Delete the dead methods and every import they exclusively pulled in, keeping the migrate mutations plus the session/token/request infrastructure they depend on. Trim the test to the surviving behavior.

The migration path only reads the session token, so session() no longer makes a Partners currentAccountInfo round-trip; the App Management client already resolves account info independently. No behavior change on the live migration path.

The partners-era GraphQL documents these methods used (create_app, find_app, find_org, etc.) are now unreferenced and will be deleted in follow-up PRs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fourth step of the PartnersClient cleanup. These GraphQL documents were only
used by the PartnersClient methods removed in the previous step, so nothing
imports them anymore. Delete the 12 hand-written query/mutation files, the two
generated partners operations (all-orgs, dev-stores-by-org) with their .graphql
sources, and their no-inline-graphql allowlist entries. Retype the app-logs
subscribe test fixture to the generated document type. No behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Final step of the PartnersClient cleanup. The PartnersClient methods removed
earlier in the stack were the only users of these GraphQL query/mutation
constants and of the generateFetchAppLogUrl cli-kit helper. Drop the dead
constants from the shared query files (keeping the schema/variables types still
used by AppManagementClient and other live code), remove generateFetchAppLogUrl,
and prune the now-inert no-inline-graphql allowlist entries. No behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@isaacroldan
isaacroldan force-pushed the partners-cleanup/03-shrink-partners-client branch from da9696c to dda8750 Compare July 16, 2026 14:45
@isaacroldan
isaacroldan force-pushed the partners-cleanup/02-narrow-live-consumers branch from ff7062f to a30cffa Compare July 16, 2026 14:45
@isaacroldan
isaacroldan changed the base branch from partners-cleanup/02-narrow-live-consumers to graphite-base/8111 July 16, 2026 15:11
@isaacroldan
isaacroldan changed the base branch from graphite-base/8111 to partners-cleanup/01-extract-migration-interface July 16, 2026 15:11
@isaacroldan
isaacroldan marked this pull request as ready for review July 16, 2026 15:52
@isaacroldan
isaacroldan requested a review from a team as a code owner July 16, 2026 15:52
@isaacroldan isaacroldan changed the title Shrink PartnersClient to the migration surface Shrink PartnersClient and remove the GraphQL it exclusively used Jul 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/node/api/partners.d.ts
@@ -14,10 +14,6 @@ import { TypedDocumentNode } from '@graphql-typed-document-node/core';
  * @returns The response of the query of generic type <T>.
  */
 export declare function partnersRequest<T>(query: string, token: string, variables?: GraphQLVariables, cacheOptions?: CacheOptions, preferredBehaviour?: RequestModeInput, unauthorizedHandler?: UnauthorizedHandler): Promise<T>;
-export declare const generateFetchAppLogUrl: (cursor?: string, filters?: {
-    status?: string;
-    source?: string;
-}) => Promise<string>;
 /**
  * Executes a GraphQL query against the Partners API. Uses typed documents.
  *

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

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant