Skip to content

feat: regenerate asset data 09/18/2025#10577

Merged
gomesalexandre merged 2 commits intodevelopfrom
feat_regenerate_asset_data
Sep 18, 2025
Merged

feat: regenerate asset data 09/18/2025#10577
gomesalexandre merged 2 commits intodevelopfrom
feat_regenerate_asset_data

Conversation

@0xean
Copy link
Contributor

@0xean 0xean commented Sep 18, 2025

Generated from CI.

Summary by CodeRabbit

  • Chores
    • Expanded token color palette across multiple networks to improve visual differentiation in the UI.
    • Refreshed related asset index data to enhance accuracy of asset relationships and discovery.
    • Added a migration to clear cached assets, ensuring data consistency after updating to the latest version.

@0xean 0xean requested a review from a team as a code owner September 18, 2025 09:08
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 18, 2025

📝 Walkthrough

Walkthrough

Adds 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

Cohort / File(s) Summary of Changes
Asset color map updates
scripts/generateAssetData/color-map.json
Appends multiple token address → hex color mappings across networks; data-only additions.
Related asset index refresh
src/lib/asset-service/service/encodedRelatedAssetIndex.json
Replaces the encoded mapping dataset with updated numeric arrays; structure unchanged; adds new keys and updates many values.
State migration manifest
src/state/migrations/index.ts
Adds entry 188: clearAssets to exported clearAssetsMigrations map.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • 0xApotheosis
  • NeOMakinG

Poem

I thump my paws, I map my hues,
New colors bloom for tokens’ queues.
Indices shuffled, neat and tight,
A tidy warren for data’s light.
Version 188, sweep and clear—
Hop on, fresh state, the path is clear! 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "feat: regenerate asset data 09/18/2025" clearly describes the primary change — regenerating asset data — which aligns with the updated files (color-map.json, encodedRelatedAssetIndex.json and the added migration entry); it is concise and developer-focused. The conventional "feat:" prefix and included date make the intent and timing explicit for reviewers. Therefore the title meets the criteria for a passing PR title.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat_regenerate_asset_data

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.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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.

📥 Commits

Reviewing files that changed from the base of the PR and between 3f34f27 and 09db940.

⛔ Files ignored due to path filters (14)
  • packages/caip/src/adapters/coincap/generated/eip155_1/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coincap/generated/eip155_137/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coincap/generated/eip155_42161/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coincap/generated/eip155_43114/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coincap/generated/eip155_56/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coincap/generated/eip155_8453/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coincap/generated/solana_5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coingecko/generated/eip155_1/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coingecko/generated/eip155_137/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coingecko/generated/eip155_42161/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coingecko/generated/eip155_43114/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coingecko/generated/eip155_56/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coingecko/generated/eip155_8453/adapter.json is excluded by !**/generated/**
  • packages/caip/src/adapters/coingecko/generated/solana_5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/adapter.json is 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.ts
  • src/lib/asset-service/service/encodedRelatedAssetIndex.json
  • scripts/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_KEYS

Validation 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; }

Copy link
Contributor

@gomesalexandre gomesalexandre left a comment

Choose a reason for hiding this comment

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

@gomesalexandre gomesalexandre enabled auto-merge (squash) September 18, 2025 10:21
@gomesalexandre gomesalexandre merged commit 84ac884 into develop Sep 18, 2025
4 checks passed
@gomesalexandre gomesalexandre deleted the feat_regenerate_asset_data branch September 18, 2025 10:29
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.

3 participants