Skip to content

Conversation

@saga-dasgupta
Copy link
Contributor

@saga-dasgupta saga-dasgupta commented Oct 30, 2025

Continuation of #6541
Fixes https://github.com/shop/issues-shopifyvm/issues/697

WHY are these changes introduced?

In my previous PR I had all the changes for function info command included in the command file which goes against the pattern of including most of the logic in the service file corresponding to the command so this PR fixes that and adds unit tests for the service file.

WHAT is this pull request doing?

Breaks the logic into the command file which is mostly orchestration:

  • Parse flags.
  • Choose function (user interaction). This is in the command file for build function command too.
  • Download binary (infrastructure).
  • Generate/get schema path (file operations with user flags). This is in the command file for the run command too.
  • Call service with prepared data.
  • Route output to appropriate display method.

And service file which is transformation/formatting:

  • Transform raw function data into display format.
  • Build targeting structure.
  • Format sections for text output.
  • Format JSON output.

How to test your changes?

  • npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20251031143515
  • shopify app function info --path <path to your function>
  • shopify app function info --path <path to your function> --json

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

@saga-dasgupta saga-dasgupta changed the title Moving formatting and organization of function info command output in… Refactoring function info command logic into service Oct 30, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 30, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
79.19% (+0.1% 🔼)
13527/17081
🟡 Branches
73.08% (+0.21% 🔼)
6609/9043
🟡 Functions
79.27% (+0.05% 🔼)
3477/4386
🟡 Lines
79.56% (+0.11% 🔼)
12786/16071
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / info.ts
100% 87.5% 100% 100%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / git.ts
92.38% (-0.78% 🔻)
89.29% (+1.35% 🔼)
90.48% (-0.43% 🔻)
93.14% (-1.2% 🔻)

Test suite run success

3334 tests passing in 1369 suites.

Report generated by 🧪jest coverage report action from 0afb7e0

@saga-dasgupta saga-dasgupta marked this pull request as ready for review October 30, 2025 16:48
@saga-dasgupta saga-dasgupta requested a review from a team as a code owner October 30, 2025 16:48
@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.

Copy link
Contributor

@gonzaloriestra gonzaloriestra left a comment

Choose a reason for hiding this comment

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

Thanks for the refactor! Tested that it works and left some minor comments

@saga-dasgupta
Copy link
Contributor Author

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @saga-dasgupta! Your snapshot has been published to npm.

Test the snapshot by installing your package globally:

npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20251031143515

Caution

After installing, validate the version by running just shopify in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@Shopify Shopify deleted a comment from github-actions bot Oct 31, 2025
@gonzaloriestra gonzaloriestra added this pull request to the merge queue Nov 3, 2025
Merged via the queue into main with commit 1b12e01 Nov 3, 2025
30 checks passed
@gonzaloriestra gonzaloriestra deleted the sd.refactor-function-info-command branch November 3, 2025 10:21
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.

3 participants