Ensure user access to selected dev stores
WHY are these changes introduced?
Fixes https://github.com/Shopify/core-issues/issues/88829 for the CLI
Calls BP to ensure that a user has the ability to login to any store that is selected via app dev. This will become necessary when the list of selectable stores includes stores that:
- are created by other users, and
- have never been logged into by the current user
WHAT is this pull request doing?
Adds a new function to DeveloperPlatformClient to ensure user access to a store.
- implemented as a no-op in
PartnersClient - implemented as a call to BP's
organizationUserProvisionShopAccessmutation inApiManagementClient.
Calls the new function from storeContext. The call is made unconditionally because we currently don't have the ability to determine accessibility ahead of time. If we wanted to change this (i.e. add accessibility info to retrieved store information, we'd likely have to stop calling BP directly and instead call an API in core)
If the user already has access, the mutationl is a no-op on the BP side.
How to test your changes?
The entire PR stack can be tophatted using the instructions here.
Post-release steps
Measuring impact
How do we know this change was effective? Please choose one:
- [ ] n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
- [x] Existing analytics will cater for this addition
- [ ] PR includes analytics changes to measure impact
Checklist
- [x] I've considered possible cross-platform impacts (Mac, Linux, Windows)
- [x] I've considered possible documentation changes
[!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
- #5605

- #5596

- #5597

- #5531
π (View in Graphite) - #5530

- #5529

main
This stack of pull requests is managed by Graphite. Learn more about stacking.
Coverage report
St.:grey_question: |
Category | Percentage | Covered / Total |
|---|---|---|---|
| π‘ | Statements | 78.03% (+0.02% πΌ) |
12474/15987 |
| π‘ | Branches | 72.19% (+0.01% πΌ) |
6042/8370 |
| π‘ | Functions | 78.26% (-0.02% π») |
3275/4185 |
| π‘ | Lines | 78.46% (+0.02% πΌ) |
11801/15041 |
Show files with reduced coverage π»
St.:grey_question: |
File | Statements | Branches | Functions | Lines |
|---|---|---|---|---|---|
| π’ | ... / app.test-data.ts |
92.04% (-0.46% π») |
93.75% | 82.56% (-0.97% π») |
91.44% (-0.49% π») |
| π΄ | ... / partners-client.ts |
26.14% | 31.58% | 16.67% (-0.28% π») |
25.85% |
Test suite run success
2869 tests passing in 1254 suites.
Report generated by π§ͺjest coverage report action from 1b3d85af644861224416bb4a97b6c25009f1c3bd
We detected some changes at packages/*/src and there are no updates in the .changeset. If the changes are user-facing, run "pnpm changeset add" to track your changes and include them in the next release CHANGELOG.
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
mainyou might see odd diffs, rebasemaininto this branch.
New type declarations
We found no new type declarations in this PR
Existing type declarations
packages/cli-kit/dist/public/node/api/business-platform.d.ts
@@ -40,6 +40,6 @@ export declare function businessPlatformOrganizationsRequest<T>(query: string, t
* @param variables - GraphQL variables to pass to the query.
* @returns The response of the query of generic type <T>.
*/
-export declare function businessPlatformOrganizationsRequestDoc<TResult>(query: TypedDocumentNode<TResult, GraphQLVariables> | TypedDocumentNode<TResult, Exact<{
+export declare function businessPlatformOrganizationsRequestDoc<TResult, TVariables extends Variables>(query: TypedDocumentNode<TResult, TVariables> | TypedDocumentNode<TResult, Exact<{
[key: string]: never;
-}>>, token: string, organizationId: string, variables?: GraphQLVariables): Promise<TResult>;
\ No newline at end of file
+}>>, token: string, organizationId: string, variables?: TVariables): Promise<TResult>;
\ No newline at end of file
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
mainyou might see odd diffs, rebasemaininto this branch.
New type declarations
We found no new type declarations in this PR
Existing type declarations
packages/cli-kit/dist/public/node/api/business-platform.d.ts
@@ -40,6 +40,6 @@ export declare function businessPlatformOrganizationsRequest<T>(query: string, t
* @param variables - GraphQL variables to pass to the query.
* @returns The response of the query of generic type <T>.
*/
-export declare function businessPlatformOrganizationsRequestDoc<TResult>(query: TypedDocumentNode<TResult, GraphQLVariables> | TypedDocumentNode<TResult, Exact<{
+export declare function businessPlatformOrganizationsRequestDoc<TResult, TVariables extends Variables>(query: TypedDocumentNode<TResult, TVariables> | TypedDocumentNode<TResult, Exact<{
[key: string]: never;
-}>>, token: string, organizationId: string, variables?: GraphQLVariables): Promise<TResult>;
\ No newline at end of file
+}>>, token: string, organizationId: string, variables?: TVariables): Promise<TResult>;
\ No newline at end of file
This PR seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. β If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.
We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run pnpm changeset add to track your changes and include them in the next release CHANGELOG.
[!CAUTION] DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.