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

Fix issue with CLI2 process printing tasks inside concurrent output #1194

Merged
merged 3 commits into from
Jan 25, 2023

Conversation

matteodepalo
Copy link
Contributor

WHY are these changes introduced?

I've extracted this fix from #1185

WHAT is this pull request doing?

Fix execCLI2 running tasks inside renderConcurrent. Previously renderTasks was trying to be rendered inside renderConcurrent, but that's not possible.

How to test your changes?

  • Run pnpm shopify app dev --path fixtures/app
  • Output shouldn't break

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
  • I've made sure that any changes to dev or deploy have been reflected in the internal flowchart.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 24, 2023

Benchmark report

The following table contains a summary of the startup time for all commands.

Status Command Baseline (avg) Current (avg) Diff
🟢 app build 1016.67 ms 1021 ms 0.43 %
🟢 app deploy 1211.33 ms 1212 ms 0.06 %
🟢 app dev 1203.33 ms 1196.33 ms -0.58 %
🟢 app env pull 1113.67 ms 1112.33 ms -0.12 %
🟢 app env show 1107.67 ms 1115.67 ms 0.72 %
🟢 app generate extension 1161.33 ms 1170.33 ms 0.77 %
🟢 app generate schema 1135 ms 1160 ms 2.2 %
🟢 app info 1122.33 ms 1118.33 ms -0.36 %
🟢 app scaffold extension 1166.67 ms 1189.33 ms 1.94 %
🟢 app update-url 1083.33 ms 1076.67 ms -0.62 %
🟢 theme check 864.67 ms 871.33 ms 0.77 %
🟢 theme delete 1061.33 ms 1078 ms 1.57 %
🟢 theme dev 1075.67 ms 1069.67 ms -0.56 %
🟢 theme help-old 863.67 ms 856.33 ms -0.85 %
🟢 theme info 994 ms 1008.33 ms 1.44 %
🟢 theme init 976.67 ms 980 ms 0.34 %
🟢 theme language-server 857 ms 863.67 ms 0.78 %
🟢 theme list 1059.67 ms 1072 ms 1.16 %
🟢 theme open 1063.33 ms 1068.67 ms 0.5 %
🟢 theme package 858.67 ms 864.33 ms 0.66 %
🟢 theme publish 1055.33 ms 1069.33 ms 1.33 %
🟢 theme pull 1053.67 ms 1053.67 ms 0 %
🟢 theme push 1048.67 ms 1064 ms 1.46 %
🟢 theme share 1054.33 ms 1058.67 ms 0.41 %
🟢 webhook trigger 1060.33 ms 1064 ms 0.35 %

@github-actions
Copy link
Contributor

github-actions bot commented Jan 24, 2023

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
70.05% (-0.95% 🔻)
3785/5403
🟡 Branches
67.06% (-0.78% 🔻)
1643/2450
🟡 Functions
68.37% (-1.08% 🔻)
977/1429
🟡 Lines
71.08% (-0.98% 🔻)
3606/5073
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🔴 cli-kit/src/git.ts 0% 0% 0% 0%
🔴
... / store.ts
50.91% 62.5% 40.91% 48.08%
🟢
... / store.ts
100% 50% 100% 100%

Test suite run success

949 tests passing in 484 suites.

Report generated by 🧪jest coverage report action from f7744d9

if (exists) {
await tasks[0]!.task()
if (!exists) stdout.write('Installing theme dependencies...')
const usingLocalCLI2 = Boolean(process.env.SHOPIFY_CLI_2_0_DIRECTORY)
Copy link
Contributor

@pepicrft pepicrft Jan 24, 2023

Choose a reason for hiding this comment

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

I'd adjust this one to use the isTruthy function for this since the environment variable can take values that can't be coerced to a boolean.

@matteodepalo matteodepalo merged commit 5f298b1 into main Jan 25, 2023
@matteodepalo matteodepalo deleted the fix-ruby-concurrent branch January 25, 2023 01:09
@shopify-shipit shopify-shipit bot temporarily deployed to production January 25, 2023 01:35 Inactive
@shopify-shipit shopify-shipit bot temporarily deployed to nightly January 25, 2023 09:13 Inactive
if (exists) {
await tasks[0]!.task()
if (!exists) stdout.write('Installing theme dependencies...')
const usingLocalCLI2 = isTruthy(process.env.SHOPIFY_CLI_2_0_DIRECTORY)
Copy link
Contributor

@Poitrin Poitrin Jan 26, 2023

Choose a reason for hiding this comment

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

isTruthy returns ['1', 'true', 'TRUE', 'yes', 'YES'].includes(variable)
but SHOPIFY_CLI_2_0_DIRECTORY is e.g."/Users/poitrin/src/github.com/Shopify/shopify-cli"
Therefore, this can't work :-(

Boolean('x') returns true, which is okay.

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