Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add api_version to access.admin in app.toml #4360

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

billfienberg
Copy link
Contributor

@billfienberg billfienberg commented Aug 21, 2024

WHY are these changes introduced?

TLDR: Add api_version to access.admin in app.toml #4360

...hard-coding api versions in all the direct access network calls is a pain to maintain, and the default of latest is a moving target... - Shopify/shopify-app-bridge#409 (comment)

Part of https://github.com/Shopify/app-ui/issues/1474

WHAT is this pull request doing?

  • Add api_version: zod.string().optional() to AppAccessSchema
  • Add and update tests

How to test your changes?

  1. In your app, add api_version inside access.admin
    api_version = "2024-07"
  2. In cli, checkout the bf/add-api-version-to-app-toml branch
    git checkout bf/add-api-version-to-app-toml
  3. In cli, deploy your updated app toml file using the --path arg
    • Syntax:
    pnpm shopify app deploy --path ${PATH}
    
    • Example:
    pnpm shopify app deploy --path ~/src/github.com/Shopify/hackdays-app
  4. In your app, delete the contents of your app.toml
  5. In your app, run config:link to pull your config from the DB
    pnpm config:link
  6. In your app, confirm that api_version is present

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
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

References

Copy link
Contributor

Thanks for your contribution!

Depending on what you are working on, you may want to request a review from a Shopify team:

  • Themes: @shopify/advanced-edits
  • UI extensions: @shopify/ui-extensions-cli
    • Checkout UI extensions: @shopify/checkout-ui-extensions-api-stewardship
  • Hydrogen: @shopify/hydrogen
  • Other: @shopify/app-inner-loop

@billfienberg billfienberg changed the title Bf/add api version to app toml Add api_version to access.admin in app.toml Aug 21, 2024
Copy link
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/system.d.ts
@@ -1,5 +1,8 @@
 /// <reference types="node" resolution-mode="require"/>
+/// <reference types="node" resolution-mode="require"/>
+/// <reference types="node" resolution-mode="require"/>
 import { AbortSignal } from './abort.js';
+import { ReadStream } from 'tty';
 import type { Writable, Readable } from 'stream';
 export interface ExecOptions {
     cwd?: string;
@@ -45,8 +48,11 @@ export declare function exec(command: string, args: string[], options?: ExecOpti
  */
 export declare function sleep(seconds: number): Promise<void>;
 /**
- * Check if the standard input and output streams support prompting.
+ * In case an standard input stream is passed check if it supports raw mode. Otherwise default standard input stream
+ * will be used.
  *
- * @returns True if the standard input and output streams support prompting.
+ * @param stdin - The standard input stream to check.
+ * @param env - Environmemnt variables.
+ * @returns True in the selected input stream support raw mode.
  */
-export declare function terminalSupportsPrompting(): boolean;
\ No newline at end of file
+export declare function terminalSupportsRawMode(stdin?: ReadStream, env?: NodeJS.ProcessEnv): boolean;
\ No newline at end of file

Copy link
Contributor

github-actions bot commented Aug 21, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
72.79% (+0.1% 🔼)
8227/11303
🟡 Branches
69.53% (+0.09% 🔼)
4010/5767
🟡 Functions
71.52% (+0.03% 🔼)
2150/3006
🟡 Lines
73.14% (+0.12% 🔼)
7783/10641
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / ConcurrentOutput.tsx
98.39% (-1.61% 🔻)
90.91% (-4.55% 🔻)
100%
98.33% (-1.67% 🔻)
🔴
... / system.ts
31.58% (-1.75% 🔻)
20.69% (-0.74% 🔻)
62.5%
33.33% (-0.95% 🔻)

Test suite run success

1859 tests passing in 846 suites.

Report generated by 🧪jest coverage report action from 90177b6

@billfienberg
Copy link
Contributor Author

billfienberg commented Aug 21, 2024

🎩 Tophat

Before (main)

❌ Can't deploy access.admin.api_version

Validation errors in shopify.app.toml:                                                                                              
│  • [access.admin]: Unrecognized key(s) in object: 'api_version'
Screen.Recording.2024-08-21.at.11.48.33.mov

After (bf/add-api-version-to-app-toml)

✅ Can deploy and config:link access.admin.api_version

Screen.Recording.2024-08-21.at.11.44.mov

@billfienberg billfienberg marked this pull request as ready for review August 21, 2024 16:54
Copy link
Contributor

We detected some changes at either packages/*/src or packages/cli-kit/assets/cli-ruby/** 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.

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