Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The exposed --allow-custom-checks flag is not forwarded to the checker during theme push, so custom-check errors cannot block uploads even when --strict is enabled.
1 open issue
1 file not reviewed
pnpm-lock.yaml: Generated file
What changed in this PR
Adds explicit operator consent for third-party Theme Check JavaScript in the CLI’s theme-check and language-server integrations, while keeping built-in checks enabled by default.
Changes:
- Adds command-line and environment-based authorization, independent of theme-controlled configuration.
- Handles typed diagnostics and reports skipped custom checks in text summaries or on stderr for JSON output.
- Upgrades Theme Tools dependencies, refreshes generated documentation/types, and updates the shared E2E fixture’s app-proxy scope.
| File | Description |
|---|---|
pnpm-lock.yaml |
Locks upgraded Theme Tools dependencies. |
packages/theme/src/cli/utilities/custom-checks.ts |
Resolves operator-controlled execution permission. |
packages/theme/src/cli/utilities/custom-checks.test.ts |
Tests authorization inputs and precedence. |
packages/theme/src/cli/services/check/result.ts |
Passes skipped-check status to summaries. |
packages/theme/src/cli/services/check/diagnostics.ts |
Routes typed diagnostics by output mode. |
packages/theme/src/cli/services/check/diagnostics.test.ts |
Tests diagnostic routing and console restoration. |
packages/theme/src/cli/services/check.ts |
Forwards loader options and formats notices. |
packages/theme/src/cli/services/check.test.ts |
Updates configuration-loader expectations. |
packages/theme/src/cli/flags.ts |
Defines the custom-check permission flag. |
packages/theme/src/cli/commands/theme/language-server.ts |
Supplies authorization to the language server. |
packages/theme/src/cli/commands/theme/language-server.test.ts |
Tests permission forwarding. |
packages/theme/src/cli/commands/theme/custom-check-authorization.test.ts |
Tests execution gating and summary notices. |
packages/theme/src/cli/commands/theme/check.ts |
Applies authorization across check modes. |
packages/theme/package.json |
Pins Theme Check and language-server upgrades. |
packages/store/src/cli/api/graphql/business-platform-organizations/generated/types.d.ts |
Refreshes generated GraphQL scalars. |
packages/organizations/src/cli/api/graphql/business-platform-organizations/generated/types.d.ts |
Refreshes generated GraphQL scalars. |
packages/e2e/tests/fixture-toml.spec.ts |
Verifies the fixture’s app-proxy scope. |
packages/e2e/data/valid-app/shopify.app.toml |
Adds write_app_proxy permission. |
packages/cli/README.md |
Refreshes generated command help. |
packages/cli/oclif.manifest.json |
Updates generated flag metadata. |
packages/app/src/cli/api/graphql/business-platform-organizations/generated/types.d.ts |
Refreshes generated GraphQL scalars. |
packages/app/package.json |
Pins the Theme Check upgrade. |
docs/cli/custom-theme-checks.md |
Documents authorization and diagnostic behavior. |
docs-shopify.dev/generated/generated_docs_data_v2.json |
Refreshes public command documentation. |
.changeset/custom-check-authorization.md |
Records the user-facing permission change. |
Review effort: Balanced
EvilGenius13
left a comment
There was a problem hiding this comment.
Ran a lengthy 🎩. I ran into a bug earlier with theme push --strict ignoring --allow-custom-checks, but your latest commit fixed it.
The only thing I'm seeing: if I set allow-custom-checks = true in shopify.theme.toml, custom checks don't run. I think that part's intentional, but the output is confusing. The environment banner says it's using the flag, then the green success summary says custom checks are still disabled.
Can we find a way to be more clear that we won't allow it in the toml file but will allow it as a direct flag?
|
@EvilGenius13 That's actually a really good find! I intentionally don't let the toml file override the consent since a person sharing a zip can just drop that consent IN the theme. But that info message can be confusing - will fix! Thank you! |
Differences in type declarationsWe 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:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/node/base-command.d.ts@@ -39,6 +39,8 @@ declare abstract class BaseCommand extends Command {
}>;
protected runWithParsedOutput<T>(flags: FlagOutput, execute: () => T): T;
protected environmentsFilename(): string | undefined;
+ /** Filters configuration flags before they are applied, validated, or reported. */
+ protected filterEnvironmentFlags(environment: FlagOutput): FlagOutput;
protected parseEnvironmentFlags<TFlags extends FlagOutput, TGlobalFlags extends FlagOutput, TArgs extends ArgOutput>(environment: JsonMap, options: Input<TFlags, TGlobalFlags, TArgs>, explicitFlags: FlagOutput): Promise<FlagOutput>;
protected validateNonTTYFlags(flags: FlagOutput): void;
protected failMissingNonTTYFlags(flags: FlagOutput, requiredFlags: string[]): void;
|

WHY are these changes introduced?
WHAT is this pull request doing?
--strictwhen enabling custom checks.@shopify/[email protected]in theme and app, and@shopify/[email protected]in theme, matching release #1369. Update the lockfile and generated command help.write_app_proxyscope to the shared E2E fixture.How to manually test your changes?
Run
pnpm installin the CLI repository. Use the custom check in theme-tools Tophatting.Run
pnpm shopify theme check --path /path/to/theme: built-in checks run and the summary shows the opt-in notice. Add--allow-custom-checks: the custom warning appears.Run
SHOPIFY_FLAG_ALLOW_CUSTOM_CHECKS=1 pnpm shopify theme check --path /path/to/theme --no-allow-custom-checks: custom checks stay disabled.Connect an LSP client to
theme language-server, with and without--allow-custom-checks, and confirm the same behavior.Run
theme push --allow-custom-checks: it errors before authentication. On a test store,theme push --strict --allow-custom-checkswith a custom error must block the upload.Validation
Checklist
minor) and added a changeset