-
Notifications
You must be signed in to change notification settings - Fork 190
Add slice metadata to error reporting #6102
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
Conversation
We detected some changes at Caution DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release. |
- Add slice_name and slice_id fields to error metadata for better error attribution - Implement command ID-based slice detection (app:dev → app slice, theme:push → theme slice, etc.) - Store current slice in global context during command initialization - Add comprehensive tests for slice detection logic - Remove monorepo_zone field as CLI is not in the Shopify monorepo This enables proper error attribution and ownership in error analytics. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success3044 tests passing in 1319 suites. Report generated by 🧪jest coverage report action from 46531ea |
- Fix JSDoc syntax errors by using interface instead of inline type notation - Remove unnecessary try-catch block in slice detection to satisfy no-catch-all rule - Remove unused outputDebug import - Ensure proper TypeScript type definitions for SliceInfo 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Remove complex command ID parsing logic from base-command.ts - Use existing cmd_all_plugin metadata field for slice identification - Remove global context slice tracking as it's no longer needed - Implement getSliceNameAndId() function based on plugin name patterns - Remove all slice detection tests as they're no longer applicable - Match implementation pattern from prototype-slices branch This approach is more reliable as it uses metadata that's already being collected by the analytics system, rather than trying to parse command IDs. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Implement slice identification for better error attribution: - Add getSliceNameAndId function to map plugins to slices - Include slice_name and slice_id in Bugsnag metadata - Use simpler plugin-based approach from PR #6093 - Add comprehensive test coverage with DRY test structure - Fix sendErrorToBugsnag to return undefined for unhandled when not reporting 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Differences in type declarationsWe 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:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/node/custom-oclif-loader.d.ts@@ -1,6 +1,5 @@
-import { Command, Config } from '@oclif/core';
-import { Options } from '@oclif/core/interfaces';
+import { Command, Config, Interfaces } from '@oclif/core';
export declare class ShopifyConfig extends Config {
- constructor(options: Options);
+ constructor(options: Interfaces.Options);
customPriority(commands: Command.Loadable[]): Command.Loadable | undefined;
}
\ No newline at end of file
packages/cli-kit/dist/public/node/error-handler.d.ts@@ -36,4 +36,8 @@ export declare function cleanStackFrameFilePath({ currentFilePath, projectRoot,
*
*/
export declare function registerCleanBugsnagErrorsFromWithinPlugins(config: Interfaces.Config): Promise<void>;
-export declare function addBugsnagMetadata(event: any, config: Interfaces.Config): Promise<void>;
\ No newline at end of file
+export declare function addBugsnagMetadata(event: any, config: Interfaces.Config): Promise<void>;
+export declare function getSliceNameAndId(plugin: string): {
+ slice_name: string;
+ slice_id: string;
+};
\ No newline at end of file
|
Closing as slices are not going to be supported for this repo. |
Summary
This PR adds slice metadata to error reporting for better error attribution and ownership tracking.
Changes:
slice_name
andslice_id
fields to error metadataapp:dev
→ app slice,theme:push
→ theme slice)Implementation Details:
The slice detection uses a simple and reliable approach based on command ID prefixes:
app:*
andwebhook:*
commands → app slice (S-9988b6)theme:*
commands → theme slice (S-2d23f6)hydrogen:*
commands → hydrogen slice (S-156228)store:*
commands → bulk data slice (S-1bc8f5)Test plan
The tests cover all command types and verify the correct slice information is set in the global context.
🤖 Generated with Claude Code