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

Generate schema from targets if present #2899

Merged
merged 1 commit into from
Sep 28, 2023

Conversation

andrewhassan
Copy link
Contributor

WHY are these changes introduced?

With target support, the generate schema command for functions no longer works.

Related issue: https://github.com/Shopify/script-service/issues/7327

WHAT is this pull request doing?

This PR uses a new GraphQL field to fetch the schema definition by target. The CLI uses the first target defined in a function to fetch the schema.

How to test your changes?

  1. Create a function that uses targets
  2. Run generate schema in the function directory
  3. Ensure that the schema is fetched successfully

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
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/theme-code-tools
  • UI extensions: @shopify/ui-extensions-cli
    • Checkout UI extensions: @shopify/checkout-ui-extensions-api-stewardship
  • Hydrogen: @shopify/hydrogen
  • Other: @shopify/cli-foundations

@github-actions
Copy link
Contributor

github-actions bot commented Sep 27, 2023

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
73% (-0.87% 🔻)
6067/8311
🟡 Branches
69.72% (-1.36% 🔻)
2957/4241
🟡 Functions
71.82% (-0.48% 🔻)
1547/2154
🟡 Lines
74.34% (-0.86% 🔻)
5758/7745
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / target_schema_definition.ts
100% 100% 100% 100%
🔴
... / dev2.ts
0% 0% 0% 0%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / function.ts
86.36%
85% (-1.36% 🔻)
83.33% 86.36%
🟢
... / generate-schema.ts
96.43% (-3.57% 🔻)
92.86% (-7.14% 🔻)
100%
96.43% (-3.57% 🔻)
🟢
... / link.ts
92.59% (-0.26% 🔻)
89.36% (+1.13% 🔼)
100%
92.45% (-0.27% 🔻)
🟢
... / push.ts
82.61% (-0.37% 🔻)
85.71% 66.67%
85.71% (-0.33% 🔻)
🟢
... / payload.ts
100%
92.31% (-0.55% 🔻)
100% 100%
🟡
... / utilities.ts
57.89% (-2.11% 🔻)
69.23% 33.33%
68.75% (-1.84% 🔻)
🔴
... / graphiql.ts
40% (-10% 🔻)
100% (+50% 🔼)
33.33%
40% (-10% 🔻)
🟡
... / previewable-extension.ts
75% (+4.41% 🔼)
50%
66.67% (-13.33% 🔻)
71.43% (+2.2% 🔼)
🟢
... / setup-dev-processes.ts
95.24% (-0.22% 🔻)
77.78% (+7.41% 🔼)
90%
94.59% (-0.28% 🔻)
🟢
... / extension.ts
89.25% (-1.96% 🔻)
68.52% (-5.99% 🔻)
91.67%
88.89% (-2.02% 🔻)
🟡
... / error-handler.ts
70.53% (+2.78% 🔼)
76.92% (+3.85% 🔼)
54.55% (-0.45% 🔻)
69.89% (+2.86% 🔼)

Test suite run success

1434 tests passing in 672 suites.

Report generated by 🧪jest coverage report action from 7a14e9a

@github-actions
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.

@andrewhassan
Copy link
Contributor Author

I don't think I need a changeset for this because it's a bug fix for existing functionality.

@andrewhassan andrewhassan removed the request for review from jbourassa September 27, 2023 20:58
@nickwesselman
Copy link
Contributor

We need this fix on 3.49 as well. Looks like @andrewhassan will be out today so I'll open another one.

@nickwesselman nickwesselman added this pull request to the merge queue Sep 28, 2023
Merged via the queue into main with commit 8b76499 Sep 28, 2023
1 check passed
@nickwesselman nickwesselman deleted the ah.generate-schema-targets branch September 28, 2023 14:14
@shopify-shipit shopify-shipit bot temporarily deployed to nightly September 29, 2023 13:25 Inactive
@shopify-shipit shopify-shipit bot temporarily deployed to experimental October 9, 2023 09:43 Inactive
@shopify-shipit shopify-shipit bot temporarily deployed to production October 19, 2023 13:18 Inactive
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