feat: regenerate asset data 09/18/2025#10577
Conversation
📝 WalkthroughWalkthroughAdds new token color entries to scripts/generateAssetData/color-map.json, refreshes the asset relationship dataset in src/lib/asset-service/service/encodedRelatedAssetIndex.json, and appends a new migration entry (188 → clearAssets) to src/state/migrations/index.ts. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant App
participant MigrationRunner
participant clearAssets as clearAssets()
participant StateStore
User->>App: Launch
App->>MigrationRunner: Run pending migrations
MigrationRunner->>MigrationRunner: Detect version 188
MigrationRunner->>clearAssets: Invoke
clearAssets->>StateStore: Clear asset-related state
clearAssets-->>MigrationRunner: Done
MigrationRunner-->>App: Migrations complete
App-->>User: Continue startup
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/lib/asset-service/service/encodedRelatedAssetIndex.json (1)
1-1: Filename isn’t kebab-case (guideline).Current: encodedRelatedAssetIndex.json. Guideline suggests kebab-case; consider aligning in a future, repo-wide codemod (low priority).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (14)
packages/caip/src/adapters/coincap/generated/eip155_1/adapter.jsonis excluded by!**/generated/**packages/caip/src/adapters/coincap/generated/eip155_137/adapter.jsonis excluded by!**/generated/**packages/caip/src/adapters/coincap/generated/eip155_42161/adapter.jsonis excluded by!**/generated/**packages/caip/src/adapters/coincap/generated/eip155_43114/adapter.jsonis excluded by!**/generated/**packages/caip/src/adapters/coincap/generated/eip155_56/adapter.jsonis excluded by!**/generated/**packages/caip/src/adapters/coincap/generated/eip155_8453/adapter.jsonis excluded by!**/generated/**packages/caip/src/adapters/coincap/generated/solana_5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/adapter.jsonis excluded by!**/generated/**packages/caip/src/adapters/coingecko/generated/eip155_1/adapter.jsonis excluded by!**/generated/**packages/caip/src/adapters/coingecko/generated/eip155_137/adapter.jsonis excluded by!**/generated/**packages/caip/src/adapters/coingecko/generated/eip155_42161/adapter.jsonis excluded by!**/generated/**packages/caip/src/adapters/coingecko/generated/eip155_43114/adapter.jsonis excluded by!**/generated/**packages/caip/src/adapters/coingecko/generated/eip155_56/adapter.jsonis excluded by!**/generated/**packages/caip/src/adapters/coingecko/generated/eip155_8453/adapter.jsonis excluded by!**/generated/**packages/caip/src/adapters/coingecko/generated/solana_5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/adapter.jsonis excluded by!**/generated/**
📒 Files selected for processing (3)
scripts/generateAssetData/color-map.json(27 hunks)src/lib/asset-service/service/encodedRelatedAssetIndex.json(1 hunks)src/state/migrations/index.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/error-handling.mdc)
**/*.{ts,tsx}: ALWAYS use Result<T, E> pattern for error handling in swappers and APIs
ALWAYS use Ok() and Err() from @sniptt/monads for monadic error handling
ALWAYS use custom error classes from @shapeshiftoss/errors
ALWAYS provide meaningful error codes for internationalization
ALWAYS include relevant details in error objects
ALWAYS wrap async operations in try-catch blocks
ALWAYS use AsyncResultOf utility for converting promises to Results
ALWAYS provide fallback error handling
ALWAYS use timeoutMonadic for API calls
ALWAYS provide appropriate timeout values for API calls
ALWAYS handle timeout errors gracefully
ALWAYS validate inputs before processing
ALWAYS provide clear validation error messages
ALWAYS use early returns for validation failures
ALWAYS log errors for debugging
ALWAYS use structured logging for errors
ALWAYS include relevant context in error logs
Throwing errors instead of using monadic patterns is an anti-pattern
Missing try-catch blocks for async operations is an anti-pattern
Generic error messages without context are an anti-pattern
Not handling specific error types is an anti-pattern
Missing timeout handling is an anti-pattern
No input validation is an anti-pattern
Poor error logging is an anti-pattern
Using any for error types is an anti-pattern
Missing error codes for internationalization is an anti-pattern
No fallback error handling is an anti-pattern
Console.error without structured logging is an anti-pattern
**/*.{ts,tsx}: ALWAYS use camelCase for variables, functions, and methods
ALWAYS use descriptive names that explain the purpose for variables and functions
ALWAYS use verb prefixes for functions that perform actions
ALWAYS use PascalCase for types, interfaces, and enums
ALWAYS use descriptive names that indicate the structure for types, interfaces, and enums
ALWAYS use suffixes like Props, State, Config, Type when appropriate for types and interfaces
ALWAYS use UPPER_SNAKE_CASE for constants and configuration values
ALWAYS use d...
Files:
src/state/migrations/index.ts
**/*
📄 CodeRabbit inference engine (.cursor/rules/naming-conventions.mdc)
**/*: ALWAYS use appropriate file extensions
Flag files without kebab-case
Files:
src/state/migrations/index.tssrc/lib/asset-service/service/encodedRelatedAssetIndex.jsonscripts/generateAssetData/color-map.json
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursor/rules/react-best-practices.mdc)
USE Redux only for global state shared across multiple places
Files:
src/state/migrations/index.ts
🧠 Learnings (2)
📓 Common learnings
Learnt from: NeOMakinG
PR: shapeshift/web#10136
File: src/lib/asset-service/service/encodedRelatedAssetIndex.json:1-1
Timestamp: 2025-07-29T10:22:27.037Z
Learning: PRs with titles starting with "feat: regenerate asset data" are routine daily asset updates that don't need detailed code analysis. Users prefer to skip automated reviews for these maintenance PRs using coderabbitai ignore.
📚 Learning: 2025-08-27T13:49:48.668Z
Learnt from: NeOMakinG
PR: shapeshift/web#10375
File: src/state/migrations/index.ts:214-215
Timestamp: 2025-08-27T13:49:48.668Z
Learning: The clearAssetsMigrations system in the ShapeShift web app works independently of the root persistConfig version. Migration numbers (like 171) don't need to match the root persistConfig version field, and the system has been functioning correctly for months/years without manual version bumps.
Applied to files:
src/state/migrations/index.ts
🧬 Code graph analysis (1)
src/state/migrations/index.ts (1)
src/state/migrations/clearAssets.ts (1)
clearAssets(6-8)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Install and Cache
🔇 Additional comments (3)
src/state/migrations/index.ts (1)
231-231: LGTM: appended 188 → clearAssets; consistent with established pattern.Matches the ongoing clearAssetsMigrations sequence. Per prior learnings, this system is independent of the root persistConfig version, so no version bump is required.
scripts/generateAssetData/color-map.json (1)
936-936: Routine asset data regen — quick validation failed: 15 BAD_KEYSValidation of scripts/generateAssetData/color-map.json reported 15 keys that do not match the expected pattern (eip155:/(erc20|bep20):0x...).
Offending keys:
- bip122:000000000000000000651ef99cb9fcbe/slip44:145
- bip122:000000000019d6689c085ae165831e93/slip44:0
- bip122:00000000001a91e3dace36e2be3bf030/slip44:3
- bip122:12a765e31ffd4059bada1e25190f6e98/slip44:2
- cosmos:cosmoshub-4/slip44:118
- cosmos:mayachain-mainnet-v1/slip44:931
- cosmos:thorchain-1/slip44:931
- eip155:1/slip44:60
- eip155:10/slip44:60
- eip155:100/slip44:60
- eip155:137/slip44:60
- eip155:42161/slip44:60
- eip155:42170/slip44:60
- eip155:56/slip44:60
- eip155:8453/slip44:60
Action: either convert these entries to the token-address format expected by the validator or broaden the validator to allow chain/slip44 keys (add bip122:, cosmos:, and eip155:.../slip44: patterns), then re-run the quick checks.
src/lib/asset-service/service/encodedRelatedAssetIndex.json (1)
1-1: Routine asset-data refresh — schema validated; LGTM.Used retrieved learnings (daily asset-data updates). Validation run returned "Schema OK". Fixed the earlier awk bug — optional quick-check script:
#!/bin/bash set -euo pipefail f="src/lib/asset-service/service/encodedRelatedAssetIndex.json" # 1) Well-formed and schema jq -e 'type=="object" and (to_entries | all(.value | type=="array" and (length>0) and (all(.[]; type=="number")) and (length == (unique|length)) ))' "$f" >/dev/null && echo "Schema OK" # 2) Keys are numeric strings (informational) jq -e 'keys | map(test("^[0-9]+$")) | all(.)' "$f" >/dev/null \ && echo "All keys numeric" \ || { jq -r 'keys[] | select(test("^[0-9]+$")|not) | "Non-numeric key: \(. )"' "$f" >&2; exit 1; }
Generated from CI.
Summary by CodeRabbit