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

Improve UI when displaying multiple errors returned from dev-update/create #5232

Conversation

isaacroldan
Copy link
Contributor

@isaacroldan isaacroldan commented Jan 17, 2025

WHY are these changes introduced?

Using the printMultipleErrors added in this same stack, we want to improve how errors received from the API are displayed.

WHAT is this pull request doing?

When receiving errors from the API tied to specific extensions, display those errors using the printMultipleErrors function.

How to test your changes?

  1. Have an app with two extensions (admin-action and admin-block for instance)
  2. Run dev
  3. Modify the toml of BOTH extensions to have an invalid api-version: 2023-10
  4. See that the errors are shown grouped together in the dev log

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

github-actions bot commented Jan 17, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
75.25% (+0.07% 🔼)
8901/11828
🟡 Branches
70.44% (+0.01% 🔼)
4334/6153
🟡 Functions
75.08% (+0.07% 🔼)
2338/3114
🟡 Lines
75.82% (+0.07% 🔼)
8412/11095
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🔴
... / extension.ts
57.14% (+1% 🔼)
57.69% (-2.31% 🔻)
50% 58.18%

Test suite run success

2004 tests passing in 905 suites.

Report generated by 🧪jest coverage report action from 2ff0b81

@isaacroldan isaacroldan marked this pull request as ready for review January 17, 2025 16:43
@isaacroldan isaacroldan requested a review from a team as a code owner January 17, 2025 16:43
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.

@isaacroldan isaacroldan force-pushed the 01-17-rethrow_functions_esbuild_errors branch from 23d656e to a1b5698 Compare January 17, 2025 17:15
@isaacroldan isaacroldan force-pushed the 01-17-improve_ui_when_displaying_multiple_errors_returned_from_dev-update_create branch from 0620b6a to 612ffc6 Compare January 17, 2025 17:15
@isaacroldan isaacroldan force-pushed the 01-17-improve_ui_when_displaying_multiple_errors_returned_from_dev-update_create branch from 612ffc6 to 2ff0b81 Compare January 20, 2025 17:03
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/common/version.d.ts
@@ -1 +1 @@
-export declare const CLI_KIT_VERSION = "3.74.0";
\ No newline at end of file
+export declare const CLI_KIT_VERSION = "3.73.0";
\ No newline at end of file
packages/cli-kit/dist/public/node/notifications-system.d.ts
@@ -166,11 +166,25 @@ export type Notifications = zod.infer<typeof NotificationsSchema>;
  */
 export declare function showNotificationsIfNeeded(currentSurfaces?: string[], environment?: NodeJS.ProcessEnv): Promise<void>;
 /**
- * Get notifications list from cache (refreshed every hour) or fetch it if not present.
+ * Get notifications list from cache, that is updated in the background from bin/fetch-notifications.json.
  *
  * @returns A Notifications object.
  */
 export declare function getNotifications(): Promise<Notifications>;
+/**
+ * Fetch notifications from the CDN and chache them.
+ *
+ * @returns A string with the notifications.
+ */
+export declare function fetchNotifications(): Promise<Notifications>;
+/**
+ * Fetch notifications in background as a detached process.
+ *
+ * @param currentCommand - The current Shopify command being run.
+ * @param argv - The arguments passed to the current process.
+ * @param environment - Process environment variables.
+ */
+export declare function fetchNotificationsInBackground(currentCommand: string, argv?: string[], environment?: NodeJS.ProcessEnv): void;
 /**
  * Filters notifications based on the version of the CLI.
  *
packages/cli-kit/dist/public/node/system.d.ts
@@ -12,6 +12,7 @@ export interface ExecOptions {
     input?: string;
     signal?: AbortSignal;
     externalErrorHandler?: (error: unknown) => Promise<void>;
+    background?: boolean;
 }
 /**
  * Opens a URL in the user's default browser.

Base automatically changed from 01-17-rethrow_functions_esbuild_errors to main January 21, 2025 12:28
@isaacroldan isaacroldan added this pull request to the merge queue Jan 21, 2025
Merged via the queue into main with commit f2bfe68 Jan 21, 2025
28 checks passed
@isaacroldan isaacroldan deleted the 01-17-improve_ui_when_displaying_multiple_errors_returned_from_dev-update_create branch January 21, 2025 12:34
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.

2 participants