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

Print error and continue dev on log streaming subscription failure #4001

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

andrewhassan
Copy link
Contributor

WHY are these changes introduced?

Fixes https://github.com/Shopify/shopify-functions/issues/220

In cases where we encounter an error creating an app log streaming subscription (e.g. the user doesn't have the necessary permissions), the CLI prints the error and continues. This leads to a downstream error halting the dev process.

WHAT is this pull request doing?

This PR updates the logic such that when there is an error subscribing, the error is printed out and the dev process continues.

How to test your changes?

  • Set the SHOPIFY_CLI_ENABLE_APP_LOG_POLLING=1 and the organization beta flag off
  • Start app dev and see that an error message is printed, but dev continues

Screenshots

image

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. This link is dead 😢

@andrewhassan andrewhassan force-pushed the ah.fix-log-streaming-env-not-set branch from 1b7fbd4 to 1636ad8 Compare June 6, 2024 19:29
Copy link
Contributor

github-actions bot commented Jun 6, 2024

Thanks for your contribution!

Depending on what you are working on, you may want to request a review from a Shopify team:

  • Themes: @shopify/advanced-edits
  • UI extensions: @shopify/ui-extensions-cli
    • Checkout UI extensions: @shopify/checkout-ui-extensions-api-stewardship
  • Hydrogen: @shopify/hydrogen
  • Other: @shopify/app-management

@andrewhassan andrewhassan marked this pull request as ready for review June 6, 2024 19:30
Copy link
Contributor

github-actions bot commented Jun 6, 2024

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.

@DuncanUszkay1
Copy link
Contributor

Makes sense to me, but we should add a test to cover this

Copy link
Contributor

github-actions bot commented Jun 6, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
72.09% (+0.13% 🔼)
7281/10100
🟡 Branches
69.23% (+0.1% 🔼)
3568/5154
🟡 Functions
71.61% (+0.06% 🔼)
1942/2712
🟡 Lines
73.39% (+0.14% 🔼)
6857/9343

Test suite run success

1691 tests passing in 789 suites.

Report generated by 🧪jest coverage report action from 6dff09a

Copy link
Contributor

@DuncanUszkay1 DuncanUszkay1 left a comment

Choose a reason for hiding this comment

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

LGTM once we have test coverage

@andrewhassan andrewhassan marked this pull request as draft June 6, 2024 19:36
@andrewhassan andrewhassan force-pushed the ah.fix-log-streaming-env-not-set branch from 1636ad8 to 513cfe3 Compare June 6, 2024 20:20
@andrewhassan andrewhassan marked this pull request as ready for review June 6, 2024 20:20
Copy link
Contributor

@DuncanUszkay1 DuncanUszkay1 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 taking the time to write up the test 👍

@andrewhassan andrewhassan force-pushed the ah.fix-log-streaming-env-not-set branch from 513cfe3 to 6dff09a Compare June 6, 2024 21:04
@andrewhassan andrewhassan added this pull request to the merge queue Jun 7, 2024
Merged via the queue into main with commit c969e9d Jun 7, 2024
35 checks passed
@andrewhassan andrewhassan deleted the ah.fix-log-streaming-env-not-set branch June 7, 2024 13:45
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.

None yet

3 participants