Dead Code Cleanup Plan -- components/shopify/ Only
Scope
This plan covers dead code, unused exports, commented-out code, and code duplication
exclusively within components/shopify/:
admin_server/admin_ui/storefront_search/extensions/e2e_tests/test/(top-level scaffold directory)ui_tests/(empty directory)
All reference checks were performed across the entire repo (not just shopify/) to
avoid removing code consumed by external components such as ecom_utils, ecom_indexer, etc.
1. Definitely Dead Code (High Confidence -- Zero Callers Anywhere)
1.1 admin_server/models/configuration_settings.py -- Entire File Dead
This file defines FilterMode, ConfigurationOption, ConfigurationSettings, and
get_default_configuration(). None of these symbols are imported by any file in the
entire repo. The file was likely intended for a configuration management feature that
was never wired up. The concepts it models (filter mode, debug mode, feature flags) are
handled differently in the actual codebase.
| File | Lines | Notes |
|---|---|---|
admin_server/models/configuration_settings.py | 1-118 | Entire file. Zero imports anywhere. |
Confidence: Definitely dead.
1.2 admin_ui/src/types/uiTypes.ts -- Entire File Dead
This file defines a rich type system for UI components (TemplateUIComponent,
ConfigUIComponent, StyleUIComponent, discriminated unions, type guards, factory
functions, a migration helper, and a ConfigurationSettings interface). None of
these types or functions are imported anywhere -- not in admin_ui/src/, not in
tests, not anywhere in the repo.
The actual UI code uses the simpler types from apiTypes.ts instead.
| File | Lines | Notes |
|---|---|---|
admin_ui/src/types/uiTypes.ts | 1-194 | Entire file. Zero imports anywhere. |
Confidence: Definitely dead.
1.3 admin_ui/src/hooks/useProducts.ts -- Dead Hook
useGenerateProduct is defined and re-exported via useApi.ts but never called by any
page or component. The only reference outside its own file is in tests that mock it but
don't meaningfully test it. The related ProductGenerationResult type in apiTypes.ts is
also only consumed by this dead hook (the same-named class in api_requests.py on the
backend IS used by settings_routes.py).
| File | Lines | Dead content |
|---|---|---|
admin_ui/src/hooks/useProducts.ts | 1-13 | Entire file. useGenerateProduct never called from UI. |
admin_ui/src/hooks/useApi.ts | 17 | Re-export line: export { useGenerateProduct } from "./useProducts" |
admin_ui/src/types/apiTypes.ts | 29-52 | ProductGenerationResult type -- only used by dead useProducts.ts |
Confidence: Definitely dead in frontend. Note: the backend endpoint /api/generate-product
and its ProductGenerationResult model in api_requests.py are still in use.
1.4 admin_ui/entry.server.ts -- Dead Remix Artifact
This file imports @remix-run/architect and references ./build/server/index.js. The app
was migrated from Remix to Vite SPA but this entry point was never cleaned up. It is not
referenced by any config, script, or other file.
| File | Lines | Notes |
|---|---|---|
admin_ui/entry.server.ts | 1-4 | Remix server entry point; app uses Vite now. |
Confidence: Definitely dead.
1.5 admin_ui/env.d.ts -- Stale Remix Type Reference
Contains /// <reference types="@remix-run/architect" /> alongside the Vite reference.
The Remix reference is dead since the app no longer uses Remix.
| File | Lines | Dead content |
|---|---|---|
admin_ui/env.d.ts | 2 | /// <reference types="@remix-run/architect" /> |
Confidence: Definitely dead (the Vite reference on line 1 should remain).
1.6 admin_ui/tailwind.config.js and postcss.config.js -- Dead Tailwind Setup
The Tailwind configuration points at ./app/**/*.tsx (Remix convention), but the source
is in ./src/. No CSS file contains @tailwind directives. The admin_ui uses Shopify
Polaris, not Tailwind. The @tailwindcss/typography dependency in package.json is also
dead.
| File | Lines | Notes |
|---|---|---|
admin_ui/tailwind.config.js | 1-8 | Unused; references non-existent ./app/ directory. |
admin_ui/postcss.config.js | 1-6 | Only configures tailwindcss + autoprefixer; dead if tailwind removed. |
Confidence: Definitely dead. Zero Tailwind usage in any source or CSS file.
1.7 admin_ui/test-route.js -- One-Off Debug Script
A standalone script that parses a hardcoded path string to demonstrate route generation logic. Not referenced by any config or npm script. Not a test file (no test framework assertions).
| File | Lines | Notes |
|---|---|---|
admin_ui/test-route.js | 1-12 | One-off utility script, never run by anything. |
Confidence: Definitely dead.
1.8 admin_server/utils/cursor_utils.py -- Never Imported
Defines encode_dynamodb_cursor and decode_dynamodb_cursor. Duplicated from
admin_lambda/utils/cursor_utils.py. Zero imports within admin_server or anywhere
in the repo (the admin_lambda copy is used by admin_lambda itself).
| File | Lines | Notes |
|---|---|---|
admin_server/utils/cursor_utils.py | 1-31 | Zero imports. Duplicate of admin_lambda version. |
Confidence: Definitely dead.
1.9 admin_server/utils/error_handlers.py -- SettingsErrorHandler Class Dead
The SettingsErrorHandler class (lines 20-133) is marked TODO and never called. The
InputValidator class (lines 135-184) in the same file IS actively used by
settings_routes.py and storefront_routes.py -- do NOT remove it.
| File | Lines | Dead content |
|---|---|---|
admin_server/utils/error_handlers.py | 5-13 | Imports of CriticalSettingsError, ExternalServiceError, RecoverableSettingsError, ValidationError (only used by dead SettingsErrorHandler) |
admin_server/utils/error_handlers.py | 20-133 | SettingsErrorHandler class -- three methods, zero callers |
Confidence: Definitely dead.
1.10 admin_server/exceptions/settings_exceptions.py -- Most Classes Dead
The exception hierarchy is only imported by error_handlers.py for the dead
SettingsErrorHandler. Once that class is removed, the only remaining consumer
disappears. The base SettingsError class is not used directly either.
| File | Lines | Dead content |
|---|---|---|
admin_server/exceptions/settings_exceptions.py | 12-69 | SettingsError, CriticalSettingsError, RecoverableSettingsError, ValidationError, ExternalServiceError -- zero direct callers |
Note: CLAUDE.md references this exception pattern as aspirational documentation. Plans 03/04/05 propose adding new exception classes here. Recommendation: Keep the file but annotate it as "currently unused -- planned for adoption" OR remove it and recreate when actually needed.
Confidence: Definitely dead today. Probably intended for future use.
1.11 admin_server/models/enums.py -- Duplicate Enum Definitions
Five enum classes duplicate ecom_utils/models/enums.py and are never imported from
this file. Only DocumentErrorType (lines 52-57) is actually used.
| Enum | Lines | Notes |
|---|---|---|
ApiKeyStatus | 11-16 | Duplicate, never imported from this file |
JobType | 19-24 | Duplicate, never imported |
SyncOperation | 27-32 | Duplicate, never imported |
JobStatus | 35-42 | Duplicate, also missing CONFLICT value vs ecom_utils |
MarqoModel | 45-49 | Duplicate, never imported |
Confidence: Definitely dead. All callers use ecom_utils.models.enums.
1.12 admin_server/constants/sync.py -- Dead Demo Constants
Three demo timing constants are never referenced anywhere:
| Constant | Line | Notes |
|---|---|---|
SyncProcessing.DEMO_PENDING_TO_PROGRESS_DELAY | 32 | Zero references |
SyncProcessing.DEMO_PROGRESS_TO_COMPLETE_DELAY | 33 | Zero references |
SyncProcessing.DEMO_CHUNK_PROCESSING_DELAY | 34 | Zero references |
Confidence: Definitely dead.
1.13 admin_server/models/api_requests.py -- ProductCreateInput Dead
The ProductCreateInput Pydantic model (lines 56-60) is defined but never imported. The
string "ProductCreateInput" appears in GraphQL mutations and docstrings but those are
Shopify API references, not Python imports.
| File | Lines | Dead content |
|---|---|---|
admin_server/models/api_requests.py | 56-60 | ProductCreateInput class -- zero imports |
Confidence: Definitely dead.
1.14 admin_server/graphql/queries/product_queries.py -- Unused Query Constants
Two GraphQL query constants are defined but never imported:
| Constant | Lines | Notes |
|---|---|---|
LIST_PRODUCTS | 5-29 | Exported via __init__.py, zero imports outside graphql package |
GET_VARIANT_INVENTORY_LEVELS | 263-287 | Not exported via __init__.py, zero imports anywhere |
Confidence: Definitely dead.
1.15 admin_server/graphql/queries/collection_queries.py -- Unused Query Constants
Three GraphQL query constants are exported but never imported outside the graphql package:
| Constant | Lines | Notes |
|---|---|---|
GET_COLLECTION_BY_ID | 5-32 | Exported, zero imports from services/handlers/routes |
GET_COLLECTION_BASIC | 34-46 | Exported, zero imports |
LIST_COLLECTIONS | 48-70 | Exported, zero imports |
Note: GET_COLLECTION_PRODUCTS in the same file IS used by collection_webhook_handler.py.
Confidence: Definitely dead.
1.16 admin_server/graphql/mutations/product_mutations.py -- Unused Mutations
Five of seven mutation constants are never imported outside the graphql package:
| Constant | Lines | Notes |
|---|---|---|
UPDATE_PRODUCT | 32-53 | Zero imports (only CREATE_PRODUCT and UPDATE_PRODUCT_VARIANTS_BULK are used) |
DELETE_PRODUCT | 55-65 | Zero imports |
CREATE_PRODUCT_VARIANT | 84-112 | Zero imports |
UPDATE_PRODUCT_VARIANT | 114-142 | Zero imports |
DELETE_PRODUCT_VARIANT | 144-155 | Zero imports |
Confidence: Definitely dead. These are valid Shopify GraphQL mutations that could be useful for ad-hoc work, but they have zero programmatic callers.
1.17 admin_server/graphql/utils/query_builders.py -- Partially Dead
Several functions/classes are never called outside their own file:
| Symbol | Lines | Notes |
|---|---|---|
build_pagination_variables() | 52-81 | Only called by GraphQLVariableBuilder (itself dead) |
build_metafield_variables() | 84-106 | Only called by GraphQLVariableBuilder (itself dead) |
build_search_query() | 109-158 | Zero callers |
GraphQLVariableBuilder class | 161-205 | Zero callers outside file |
variables() factory | 209-211 | Zero callers |
The following ARE used: build_graphql_id, build_product_id, build_variant_id,
build_collection_id, extract_numeric_id.
Confidence: Definitely dead.
1.18 e2e_tests/e2e_tests/marqo/marqo_client_2.py -- Entire File Dead
Self-described as a "hack for a simpler API" with a TODO to replace. Zero imports anywhere.
| File | Lines | Notes |
|---|---|---|
e2e_tests/e2e_tests/marqo/marqo_client_2.py | 1-56 | Never imported. Self-described hack. |
Confidence: Definitely dead.
1.19 e2e_tests/e2e_tests/util/shared_helpers.py -- Re-export With Active Callers
Line 13 re-exports INDEX_READY_TIMEOUT_S "for backwards compatibility". Three test
files still import it from shared_helpers rather than from e2e_tests.config.timeouts:
e2e_tests/e2e_tests/tests/ecom_onboarding_test.py(line 31)e2e_tests/e2e_tests/tests/ecom_aliasing_test.py(line 35)e2e_tests/e2e_tests/util/e2e_test_helpers_test.py(line 4)
| File | Lines | Content |
|---|---|---|
e2e_tests/e2e_tests/util/shared_helpers.py | 13 | INDEX_READY_TIMEOUT_S = INDEX_READY_TIMEOUT_S re-export |
Confidence: The re-export IS live today. It becomes dead only after the 3 callers are migrated. A prerequisite migration step is included in Phase 2 (step 17a).
1.20 test/ Directory -- Entire Scaffold Dead
The components/shopify/test/ directory is a Shopify CLI boilerplate app scaffold
(Express backend, React frontend with product counter, etc.). It is not referenced by
the parent package.json workspaces, no npm scripts reference it, and no code imports
from it. It appears to be a tutorial/template that was generated during initial app
scaffolding and never cleaned up.
| Directory | Files | Notes |
|---|---|---|
components/shopify/test/ | ~30+ files | Full Shopify CLI scaffold app, zero references from actual codebase |
Confidence: Definitely dead.
1.21 ui_tests/ Directory -- Empty
Contains only a .DS_Store file. No test files, configs, or meaningful content.
| Directory | Files | Notes |
|---|---|---|
components/shopify/ui_tests/ | 1 (.DS_Store only) | Empty directory |
Confidence: Definitely dead.
2. Probably Dead Code (Medium Confidence -- Needs Discussion)
2.1 admin_server/app_lifecycle.py -- requires_scopes Decorator (Placeholder)
Lines 112-131 define a no-op decorator that is never applied to any route. It has a TODO for implementing scope checking.
Confidence: Probably dead. This is intentionally a placeholder for future work. If scope checking is not planned soon, it adds confusion.
2.2 admin_server/services/resource_provisioning_service.py -- Disabled S3 Methods
_add_s3_notification_for_shop(lines 421-514): Only call site is commented out (line 124)_grant_s3_permission_to_sqs(lines 516-557): Only called by the above
Both are fully implemented but disabled. Comment says "S3 notifications temporarily disabled to prevent duplicate SQS messages."
Confidence: Probably dead. Intentionally preserved for future re-enablement. Recommend annotating with a clear "DISABLED" marker rather than removing.
2.3 admin_server/handlers/webhook_handler.py -- AppLifecycleWebhookHandler Stubs
Methods _handle_app_uninstall (lines 185-194) and _handle_scopes_update (lines
196-201) only log and return. They have TODOs for implementing actual cleanup and
scope tracking logic.
Confidence: Not truly dead (they are registered and called), but they are no-ops. These are stubs awaiting implementation, not dead code to remove.
2.4 storefront_search/src/constants.ts -- API_PATHS.SEARCH and API_PATHS.COLLECTIONS
API_PATHS is imported in search-state.ts but only API_PATHS.UI_SEARCH is accessed.
The API_PATHS.SEARCH ("/apps/marqo/search") and API_PATHS.COLLECTIONS
("/apps/marqo/collections") are the old App Proxy paths replaced by DIRECT_API_PATHS.
| Constant | Notes |
|---|---|
API_PATHS.SEARCH | Old app proxy path, unused. Only UI_SEARCH is accessed. |
API_PATHS.COLLECTIONS | Old app proxy path, unused. |
Confidence: Probably dead. The paths might be kept for reference but serve no runtime purpose.
2.5 storefront_search/src/constants.ts -- UIComponentKeyType Type Alias
Line 439: export type UIComponentKeyType = keyof typeof UIComponentKey; is exported
but never imported anywhere.
Confidence: Probably dead. The UIComponentKey enum itself IS used.
3. Commented-Out Code Blocks
3.1 storefront_search/src/search-api.ts -- Lines 18-29
The old callAppProxy function is fully commented out (12 lines) with a note saying
"using direct API route." This was replaced by callSearchProxy.
3.2 admin_server/handlers/test_bulk_sync_product_aware.py -- Lines 644-654
Two test stubs are fully commented out with TODO notes about fixing async context manager mocking.
3.3 admin_server/graphql/types/shopify_models.py -- Lines 386-387
Two lines of variant serialization are commented out with a TODO.
3.4 admin_server/handlers/webhook_handler.py -- Lines 199-200
Scopes update code is commented out within the _handle_scopes_update stub.
4. Code Duplication Within components/shopify/
4.1 extract_numeric_id vs extract_numeric_id_from_graphql_id
Two implementations of the same logic exist:
graphql/utils/query_builders.py:39--extract_numeric_id(graphql_id): Simplersplit("/", 1)[-1], returns empty string on bad inputtransformers/product_transformer.py:37--extract_numeric_id_from_graphql_id(graphql_id): Validatesgid://shopify/prefix, raisesValueErroron bad input
Both are actively used by different callers:
query_builders.extract_numeric_id: used bycollection_webhook_handler.pyproduct_transformer.extract_numeric_id_from_graphql_id: used byproduct_webhook_handler.pyandcollection_webhook_handler.py
Recommendation: Consolidate into one function (preferably the validating version)
in a shared location (e.g., query_builders.py) and update all callers.
4.2 cursor_utils.py Duplication (admin_server vs admin_lambda)
The admin_server copy is dead (1.8 above) and the admin_lambda copy is the active one. If cursor utils are ever needed in admin_server, they should import from a shared location.
5. TODO/FIXME Inventory (Within components/shopify/ Scope)
These are not dead code but represent tracked tech debt:
| Location | TODO | Category |
|---|---|---|
admin_server/dependencies.py:345 | Follow DI convention like injector | Architecture |
admin_server/dependencies.py:527,635 | Remove once ShopifySettings backfilled | Migration |
admin_server/main.py:91 | Remove legacy analytics route prefix | Migration |
admin_server/main.py:112 | Serve marketing page at root | Enhancement |
admin_server/app_lifecycle.py:84 | Move get_index_html to static_assets.py | Refactoring |
admin_server/services/resource_provisioning_service.py:119 | S3 notifications disabled | Feature toggle |
admin_server/services/resource_provisioning_service.py:203 | Implement resource destruction | Missing feature |
admin_server/handlers/webhook_handler.py:187 | Implement uninstall cleanup | Missing feature |
admin_server/handlers/webhook_handler.py:198 | Update stored scopes | Missing feature |
admin_server/routes/sync_routes.py:50 | Improve time estimation | Enhancement |
admin_server/exceptions/settings_exceptions.py:11 | Use these in settings routes | Adoption |
admin_server/utils/error_handlers.py:19 | Use these in settings routes | Adoption |
admin_server/models/marqo_documents.py:118 | Move to ecom_utils | Refactoring |
admin_server/graphql/types/shopify_models.py:389 | Remove duplicate option builder | Cleanup |
admin_server/transformers/product_transformer.py:495 | Other images for variant | Enhancement |
admin_server/transformers/product_transformer.py:881 | Make configurable | Enhancement |
admin_server/transformers/product_transformer.py:975 | Recheck media/collections transform | Verification |
admin_server/handlers/collection_webhook_handler.py:403 | Get product ID from Marqo doc | Enhancement |
admin_server/conftest.py:415 | Verify path proxy format | Verification |
admin_server/services/index_settings_initialization_service.py:85,287,335,343,436,444,483 | Various config TODOs | Enhancement |
admin_ui/src/pages/index.tsx:40 | Fix loading state race condition | Bug |
storefront_search/src/filter-manager.ts:59,211 | Clean up filter removal and param schema | Refactoring |
storefront_search/src/types.d.ts:95 | Remove variant fields after migration | Migration |
storefront_search/src/vue/ProductCard.ts:386 | Laura Geller-specific badge logic | Customer-specific |
e2e_tests (various) | Multiple TODOs for test improvements | Test quality |
6. Proposed Removal Order (Safest First)
Phase 1: Dead Files and Directories (Zero Risk -- No Callers)
- Delete
admin_server/models/configuration_settings.py-- zero imports 1a. Updateadmin_server/CLAUDE.md-- Remove the reference tomodels/configuration_settings.pyon line 117 under the "Settings" section. The line reads- **[models/configuration_settings.py](https://github.com/marqo-ai/cloud_control_plane/blob/445728d0a3ede69aeb9fa75d585b6d2547a443f9/docs/plans/...)** - Selector component configurationand will be stale after the file is deleted. - Delete
admin_ui/src/types/uiTypes.ts-- zero imports - Delete
admin_ui/src/hooks/useProducts.ts-- zero callers - Delete
admin_ui/entry.server.ts-- Remix artifact - Delete
admin_ui/test-route.js-- one-off debug script - Delete
admin_server/utils/cursor_utils.py-- zero imports - Delete
e2e_tests/e2e_tests/marqo/marqo_client_2.py-- zero imports - Delete
test/directory -- unused scaffold (entire directory tree) - Delete
ui_tests/directory -- empty
Phase 2: Dead Code in Active Files (Low Risk)
- Remove re-export line from
admin_ui/src/hooks/useApi.ts(line 17:useGenerateProduct) 10a. RemoveuseGenerateProductmock fromadmin_ui/tests/pages/index.test.tsx-- Remove the import ofuseGenerateProduct(line 7), theuseGenerateProduct: vi.fn()mock (line 18), and the(useGenerateProduct as any).mockReturnValue(...)setup (lines 85-86) from thevi.mock("../../src/hooks/useApi", ...)block. The mock exists but exercises dead code; removing it alongside the hook prevents test breakage. - Remove
ProductGenerationResulttype fromadmin_ui/src/types/apiTypes.ts(lines 29-52) - Remove
ProductCreateInputfromadmin_server/models/api_requests.py(lines 56-60) - Remove Remix reference from
admin_ui/env.d.ts(line 2) - Remove dead Tailwind setup: delete
admin_ui/tailwind.config.js,admin_ui/postcss.config.js, and remove@tailwindcss/typographyfromadmin_ui/package.json - Remove duplicate enums from
admin_server/models/enums.py(lines 11-49, keepDocumentErrorType) - Remove
DEMO_*constants fromadmin_server/constants/sync.py(lines 32-34) 17a. MigrateINDEX_READY_TIMEOUT_Simports (prerequisite for 17b) -- Update the following 3 files to importINDEX_READY_TIMEOUT_Sfrome2e_tests.config.timeoutsinstead ofe2e_tests.util.shared_helpers:e2e_tests/e2e_tests/tests/ecom_onboarding_test.py(line 31)e2e_tests/e2e_tests/tests/ecom_aliasing_test.py(line 35)e2e_tests/e2e_tests/util/e2e_test_helpers_test.py(line 4) 17b. RemoveINDEX_READY_TIMEOUT_Sre-export frome2e_tests/util/shared_helpers.py(line 13) -- Safe only after 17a is complete.
Phase 3: Dead Classes/Functions in Active Files
-
Remove
SettingsErrorHandlerclass fromadmin_server/utils/error_handlers.py(lines 20-133) and its exception imports (lines 5-13, keeping onlyloggingandHTTPExceptionif needed) -
Evaluate
admin_server/exceptions/settings_exceptions.py: Remove if no adoption is planned, or annotate with "PLANNED: not yet adopted" comment -
Remove unused query constants from
graphql/queries/__init__.py: Remove exports forLIST_PRODUCTS,GET_COLLECTION_BY_ID,GET_COLLECTION_BASIC,LIST_COLLECTIONSWARNING --
GET_COLLECTION_BASICbranch dependency: The live worktree branchworktree-feat+cognito-loginhas ametaobject_webhook_handler.pythat importsGET_COLLECTION_BASIC. If that branch merges before this cleanup runs, deleting the query will break it. Action: Before removingGET_COLLECTION_BASIC, check whetherfeat+cognito-loginhas merged. If it has merged, coordinate with the author to remove or migrate the import. If it has NOT merged, skip removingGET_COLLECTION_BASICfrom this step and revisit after the branch state is resolved. -
Remove unused mutation constants from
graphql/mutations/__init__.py: Remove exports forUPDATE_PRODUCT,DELETE_PRODUCT,CREATE_PRODUCT_VARIANT,UPDATE_PRODUCT_VARIANT,DELETE_PRODUCT_VARIANT(keep definitions in module file for ad-hoc use) -
Remove
GET_VARIANT_INVENTORY_LEVELSfromproduct_queries.py(lines 263-287) -
Remove dead functions from
graphql/utils/query_builders.py:build_pagination_variables,build_metafield_variables,build_search_query,GraphQLVariableBuilderclass,variables() -
Remove
requires_scopesdecorator fromadmin_server/app_lifecycle.py(lines 112-131)
Phase 4: Commented-Out Code Cleanup
- Remove commented-out
callAppProxyfromstorefront_search/src/search-api.ts(lines 18-29) - Remove commented-out test stubs from
admin_server/handlers/test_bulk_sync_product_aware.py(lines 644-654) - Remove commented-out variant serialization from
graphql/types/shopify_models.py(lines 386-387) - Remove dead
API_PATHS.SEARCHandAPI_PATHS.COLLECTIONSfromstorefront_search/src/constants.ts - Remove unused
UIComponentKeyTypetype fromstorefront_search/src/constants.ts(line 439)
Phase 5: Code Duplication Consolidation
- Consolidate
extract_numeric_idandextract_numeric_id_from_graphql_idinto a single function. Move the validating version toquery_builders.py(or create a sharedgraphql_utils.pymodule) and update all callers inproduct_webhook_handler.py,collection_webhook_handler.py, andproduct_transformer.py.
7. Testing Strategy
Before Any Changes
# Baseline: run full test suites for all affected components
pants test //components/shopify/admin_server::
pants test //components/shopify/e2e_tests/e2e_tests::
# TypeScript tests
cd components/shopify/storefront_search && npm test
cd components/shopify/admin_ui && npm test
Record baseline test results (counts, which pass).
After Phase 1 (File/Directory Deletions)
pants test //components/shopify/admin_server::
pants test //components/shopify/e2e_tests/e2e_tests::
Since these files have zero importers, deletion should not affect any test. If a test fails, it reveals an import we missed -- investigate before proceeding.
After Phase 2 (Dead Code in Active Files)
pants test //components/shopify/admin_server::
cd components/shopify/admin_ui && npm test
Pay special attention to:
admin_ui/tests/pages/index.test.tsx-- theuseGenerateProductmock must be removed per step 10a; verify tests still pass after removaladmin_server/routes/settings_routes_test.py-- usesInputValidatorfromerror_handlers.py(do NOT break this when removingSettingsErrorHandlerfrom the same file)
After Phase 3 (Class/Function Removals)
pants test //components/shopify/admin_server::
ruff check components/shopify/admin_server/
Ruff will catch any broken imports or unused import warnings introduced by the removals.
After Phase 4 (Comment Cleanup)
# Minimal verification
pants test //components/shopify/admin_server::
cd components/shopify/storefront_search && npm test
After Phase 5 (Duplication Consolidation)
pants test //components/shopify/admin_server::
Focus on tests in:
admin_server/handlers/test_product_webhook_handler.pyadmin_server/handlers/test_collection_webhook_handler.pyadmin_server/transformers/test_product_transformer.py
General Guidance
- Make one commit per phase (or per sub-item for additional safety)
- Run
ruffafter each Python change to catch import issues - Run TypeScript compilation (
npx tsc --noEmit) after each TypeScript change - If a test references a deleted symbol, update the test to remove the reference
- Do NOT run E2E tests locally -- those run in CI
8. Summary Statistics
| Category | Items | Est. Lines |
|---|---|---|
| Dead files to delete | 9 files + 2 directories | ~500+ lines |
| Dead code in active files | 15 items | ~400 lines |
| Commented-out code blocks | 5 blocks | ~30 lines |
| Dead constants/exports | 14 constants | ~150 lines |
| Code duplication to consolidate | 2 instances | ~30 lines net reduction |
| Total estimated removal | ~1100+ lines |