Skip to content

doctor-release command runs on development envs#6862

Open
aswamy wants to merge 1 commit intomainfrom
02-18-doctor-release_command_runs_on_development_envs
Open

doctor-release command runs on development envs#6862
aswamy wants to merge 1 commit intomainfrom
02-18-doctor-release_command_runs_on_development_envs

Conversation

@aswamy
Copy link
Contributor

@aswamy aswamy commented Feb 18, 2026

WHY are these changes introduced?

  • When i run shopify-dev theme-doctor theme or pnpm shopify theme-doctor theme on local environment, i want it to run the development CLI, not the production one

WHAT is this pull request doing?

  • detects how the CLI was run

How to test your changes?

  • run the doctor-release command locally (try all the ones noted in the test cases)
    • just make sure you set the environment variable first (export SHOPIFY_CLI_DOCTOR=1)

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

Copy link
Contributor Author

aswamy commented Feb 18, 2026

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

@github-actions
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/doctor/types.d.ts
@@ -14,6 +14,7 @@ export interface TestResult {
 }
 export interface DoctorContext {
     workingDirectory: string;
+    cliCommand: string;
     data: {
         [key: string]: unknown;
     };

@aswamy aswamy marked this pull request as ready for review February 18, 2026 18:58
@aswamy aswamy requested a review from a team as a code owner February 18, 2026 18:58
@github-actions
Copy link
Contributor

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.

@github-actions
Copy link
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 78.91% 14568/18462
🟡 Branches 73.24% 7229/9870
🟡 Functions 79.12% 3707/4685
🟡 Lines 79.25% 13771/17376

Test suite run success

3785 tests passing in 1457 suites.

Report generated by 🧪jest coverage report action from 9b64ce0

Comment on lines +40 to +53
export function detectCliCommand(commandHandle?: string, argv: string[] = process.argv): string {
const defaultCommand = 'shopify'

if (!commandHandle) return defaultCommand

const firstTopic = commandHandle.split(':')[0]
if (!firstTopic) return defaultCommand

const index = argv.findIndex((arg) => arg === firstTopic)

if (index <= 0) return defaultCommand

return argv.slice(0, index).join(' ')
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EvilGenius13 do you think this might be too fragile? I am not sure if we should just make a new arg passed in from the user.

If i were to steelman this approach, this would work in CI if we'd launch theme-doctor theme from a CI environment if it used npx shopify instead of shopify

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

Comments