Skip to content

Conversation

@kernelwhisperer
Copy link
Contributor

@kernelwhisperer kernelwhisperer commented Nov 28, 2025

Summary

This change removes all references to raw.githubusercontent.com and replaces them with files.cow.fi/cow-sdk

Blocked by cowprotocol/cow-sdk#723

Testing

  • Make sure chain images are no longer fetched from gh cdn when opening the network selector
image
  • Same for token lists
  • Same for permit info
  • Same for token images

Background

This PR is part of https://linear.app/cowswap/issue/COW-136/token-lists-cdn

Moving away from our reliance on github CDN.
This is no longer viable as Github recently changed their rate limiting policy for non-logged in users.

Related PRs:
cowprotocol/cow-sdk#723
cowprotocol/cow-sdk#724

Summary by CodeRabbit

  • Chores

    • Migrated token lists, LP lists and many image/logo sources from GitHub to a CDN and updated app/config defaults to use the CDN.
    • Centralized CDN URL via a new CDN constant (read from env) and re-exported it for use across packages.
    • Updated various defaults and mock data to reference CDN-hosted assets.
  • Documentation

    • Added deprecation annotations to a couple of legacy utility functions to guide future maintenance.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Nov 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
cowfi Ready Ready Preview Dec 4, 2025 8:31am
explorer-dev Ready Ready Preview Dec 4, 2025 8:31am
swap-dev Ready Ready Preview Dec 4, 2025 8:31am
widget-configurator Ready Ready Preview Dec 4, 2025 8:31am
2 Skipped Deployments
Project Deployment Preview Updated (UTC)
cosmos Ignored Ignored Dec 4, 2025 8:31am
sdk-tools Ignored Ignored Preview Dec 4, 2025 8:31am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 28, 2025

Walkthrough

Replaced hard-coded raw.githubusercontent.com and other external URLs with a configurable COW_CDN constant across multiple libs and apps; added libs/common-const/src/cdn.ts and re-export; updated .env; and added two JSDoc deprecation annotations. No runtime logic or public API signatures were changed.

Changes

Cohort / File(s) Summary
CDN constant & exports
libs/common-const/src/cdn.ts, libs/common-const/src/index.ts
Added COW_CDN (reads REACT_APP_COW_CDN, defaults to https://files.cow.fi) and re-exported it from the barrel.
Token list data & state
libs/tokens/src/const/tokensList.json, libs/tokens/src/const/lpTokensList.json, libs/tokens/src/state/tokenLists/tokenListsStateAtom.ts
Replaced many source/provider URLs from raw.githubusercontent.com to https://files.cow.fi equivalents and updated token-list source constants to use COW_CDN. (data-only edits)
Frontend & mocks (COW_CDN usage)
apps/cowswap-frontend/src/modules/permit/const.ts, apps/cowswap-frontend/src/modules/tokensList/mocks.ts, apps/cowswap-frontend/src/modules/orderProgressBar/pure/OrderProgressBar/index.cosmos.tsx, apps/cowswap-frontend/src/tradingSdk/TestReceiverAccountBridgeProvider.ts, apps/cowswap-frontend/.env
Switched hard-coded URLs to use COW_CDN (permit file, Sepolia token list, provider logos, mocks); added REACT_APP_COW_CDN to .env.
Explorer (token lists & mocks)
apps/explorer/src/hooks/useTokenList.ts, apps/explorer/src/components/orders/OrderDetails/crossChainOrder.mock.ts, apps/explorer/src/utils/miscellaneous.ts
Switched token-list sources and mock logo URLs to use COW_CDN; added JSDoc @deprecated to getImageUrl (no behavior change).
Widget configurator defaults
apps/widget-configurator/src/app/configurator/consts.ts
Updated default token list entries to use ${COW_CDN}/... paths instead of external URLs.
Shared constants & helpers
libs/common-const/src/cowprotocolTokenLogoUrl.ts, libs/tokens/src/utils/trustTokenLogoUrl.ts
Switched internal token-logo root to use COW_CDN; added JSDoc @deprecated to trustTokenLogoUrl (no signature/behavior change).
Hook DApps registry
libs/hook-dapp-lib/src/hookDappsRegistry.ts
Replaced bridging provider image/logo URLs with files.cow.fi equivalents (data update).
Cow‑Fi service
apps/cow-fi/services/tokens/index.ts
Replaced hard-coded token-list URL with ${COW_CDN}/tokens/cowFi-tokens.json.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review focus:
    • Verify CDN paths map to actual assets and correct subpaths in tokensList.json / lpTokensList.json.
    • Confirm COW_CDN default and REACT_APP_COW_CDN override behavior in builds/environments.
    • Check for accidental structural changes in JSON files.
    • Ensure new export in libs/common-const/src/index.ts doesn't create circular dependencies.

Possibly related PRs

Suggested labels

preview-widget-cfg, Explorer

Suggested reviewers

  • shoom3301
  • alfetopito
  • elena-zh

Poem

🐇 I hopped from raw to files with cheer,
CDN paths now bright and clear,
Lists and logos hopped in line,
Small deprecations left a sign,
Carrot crumbs mark every gear 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title concisely summarizes the main change: migrating from GitHub CDN (raw.githubusercontent.com) to AWS CDN (files.cow.fi).
Description check ✅ Passed The description includes a clear summary of the change, testing procedures with a screenshot, and relevant background context linking to the Linear issue and related PRs.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/move-from-gh-cdn-to-aws

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 35c62c5 and 5b8d8fb.

📒 Files selected for processing (18)
  • apps/cow-fi/services/tokens/index.ts (1 hunks)
  • apps/cowswap-frontend/.env (1 hunks)
  • apps/cowswap-frontend/src/modules/orderProgressBar/pure/OrderProgressBar/index.cosmos.tsx (2 hunks)
  • apps/cowswap-frontend/src/modules/permit/const.ts (1 hunks)
  • apps/cowswap-frontend/src/modules/tokensList/mocks.ts (3 hunks)
  • apps/cowswap-frontend/src/tradingSdk/TestReceiverAccountBridgeProvider.ts (2 hunks)
  • apps/explorer/src/components/orders/OrderDetails/crossChainOrder.mock.ts (2 hunks)
  • apps/explorer/src/hooks/useTokenList.ts (2 hunks)
  • apps/explorer/src/utils/miscellaneous.ts (1 hunks)
  • apps/widget-configurator/src/app/configurator/consts.ts (2 hunks)
  • libs/common-const/src/cdn.ts (1 hunks)
  • libs/common-const/src/cowprotocolTokenLogoUrl.ts (1 hunks)
  • libs/common-const/src/index.ts (1 hunks)
  • libs/hook-dapp-lib/src/hookDappsRegistry.ts (2 hunks)
  • libs/tokens/src/const/lpTokensList.json (1 hunks)
  • libs/tokens/src/const/tokensList.json (11 hunks)
  • libs/tokens/src/state/tokenLists/tokenListsStateAtom.ts (2 hunks)
  • libs/tokens/src/utils/trustTokenLogoUrl.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (13)
  • apps/explorer/src/hooks/useTokenList.ts
  • apps/cowswap-frontend/src/modules/orderProgressBar/pure/OrderProgressBar/index.cosmos.tsx
  • apps/cowswap-frontend/src/modules/permit/const.ts
  • libs/tokens/src/utils/trustTokenLogoUrl.ts
  • libs/common-const/src/cdn.ts
  • libs/common-const/src/cowprotocolTokenLogoUrl.ts
  • apps/cowswap-frontend/.env
  • libs/common-const/src/index.ts
  • libs/tokens/src/state/tokenLists/tokenListsStateAtom.ts
  • apps/cowswap-frontend/src/modules/tokensList/mocks.ts
  • libs/hook-dapp-lib/src/hookDappsRegistry.ts
  • apps/explorer/src/components/orders/OrderDetails/crossChainOrder.mock.ts
  • apps/widget-configurator/src/app/configurator/consts.ts
🧰 Additional context used
🧠 Learnings (10)
📚 Learning: 2025-09-25T08:49:32.256Z
Learnt from: shoom3301
Repo: cowprotocol/cowswap PR: 6299
File: apps/cowswap-frontend/src/entities/bridgeProvider/useBridgeSupportedNetworks.test.tsx:62-67
Timestamp: 2025-09-25T08:49:32.256Z
Learning: In the cowswap-frontend codebase, when testing hooks that use multiple bridge providers, both providers are always properly mocked as complete jest.Mocked<BridgeProvider<BridgeQuoteResult>> objects with all required methods stubbed, ensuring no undefined returns that could break the hook logic.

Applied to files:

  • apps/cowswap-frontend/src/tradingSdk/TestReceiverAccountBridgeProvider.ts
📚 Learning: 2025-09-11T08:25:51.460Z
Learnt from: alfetopito
Repo: cowprotocol/cowswap PR: 6234
File: libs/tokens/src/index.ts:1-4
Timestamp: 2025-09-11T08:25:51.460Z
Learning: In the cowprotocol/cowswap project, there is currently no SSR (Server-Side Rendering) support, so localStorage access at module import time does not cause SSR-related issues.

Applied to files:

  • apps/cowswap-frontend/src/tradingSdk/TestReceiverAccountBridgeProvider.ts
  • apps/cow-fi/services/tokens/index.ts
📚 Learning: 2025-10-10T20:28:16.565Z
Learnt from: fairlighteth
Repo: cowprotocol/cowswap PR: 6347
File: apps/cowswap-frontend/src/modules/trade/pure/TradeConfirmation/index.tsx:49-49
Timestamp: 2025-10-10T20:28:16.565Z
Learning: In apps/cowswap-frontend/src/modules/trade, TradeConfirmation follows a two-layer architecture: TradeConfirmationView (pure/stateless) in pure/TradeConfirmation/index.tsx renders the UI, while TradeConfirmation (container) in containers/TradeConfirmation/index.tsx wraps it to freeze props during pending trades (via useStableTradeConfirmationProps), wire in signing state (useSigningStep), and inject trade confirmation state (useTradeConfirmState). Consuming modules should import the container TradeConfirmation from 'modules/trade' to preserve this stateful behavior.
<!-- [add_learning]
When reviewing component refactoring in apps/cowswap-frontend/src/modules/trade, recognize the pattern where a pure view component (e.g., TradeConfirmationView) is separated from a stateful container (e.g., TradeConfirmation) that wraps it. The container adds runtime state management (prop stabilization, signing state, etc.) while the view remains testable and composable. Do not flag usages that import th...

Applied to files:

  • apps/cowswap-frontend/src/tradingSdk/TestReceiverAccountBridgeProvider.ts
📚 Learning: 2025-06-10T09:57:40.679Z
Learnt from: shoom3301
Repo: cowprotocol/cowswap PR: 5787
File: apps/explorer/src/components/orders/BridgeDetailsTable/BridgeDetailsContent/index.tsx:33-40
Timestamp: 2025-06-10T09:57:40.679Z
Learning: In the bridge provider info structure (CrossChainOrder.provider.info), the `website` property is not optional and will always be present, so no conditional checking is needed when accessing `providerInfo.website`.

Applied to files:

  • apps/cowswap-frontend/src/tradingSdk/TestReceiverAccountBridgeProvider.ts
📚 Learning: 2025-08-12T06:33:19.348Z
Learnt from: shoom3301
Repo: cowprotocol/cowswap PR: 6137
File: libs/tokens/src/state/tokens/allTokensAtom.ts:34-65
Timestamp: 2025-08-12T06:33:19.348Z
Learning: In libs/tokens/src/state/tokens/allTokensAtom.ts, the parseTokenInfo() function returns a new instance of TokenInfo each time, making it safe to mutate properties like lpTokenProvider on the returned object without side effects.

Applied to files:

  • libs/tokens/src/const/lpTokensList.json
📚 Learning: 2025-08-12T06:33:19.348Z
Learnt from: shoom3301
Repo: cowprotocol/cowswap PR: 6137
File: libs/tokens/src/state/tokens/allTokensAtom.ts:34-65
Timestamp: 2025-08-12T06:33:19.348Z
Learning: In libs/tokens/src/utils/parseTokenInfo.ts, the parseTokenInfo() function returns a new instance of TokenInfo using object spread syntax ({ ...token, ... }), making it safe to mutate properties like lpTokenProvider on the returned object without side effects.

Applied to files:

  • libs/tokens/src/const/lpTokensList.json
📚 Learning: 2025-07-18T08:07:55.497Z
Learnt from: alfetopito
Repo: cowprotocol/cowswap PR: 5992
File: libs/tokens/src/const/tokensList.json:135-167
Timestamp: 2025-07-18T08:07:55.497Z
Learning: Token lists for CoW Swap are maintained in a separate repository at https://github.com/cowprotocol/token-lists, not in the main cowswap repository. Issues related to missing token lists should be tracked in the token-lists repository.

Applied to files:

  • libs/tokens/src/const/lpTokensList.json
  • libs/tokens/src/const/tokensList.json
  • apps/cow-fi/services/tokens/index.ts
📚 Learning: 2025-08-08T13:55:17.528Z
Learnt from: shoom3301
Repo: cowprotocol/cowswap PR: 6125
File: libs/tokens/src/state/tokens/allTokensAtom.ts:78-78
Timestamp: 2025-08-08T13:55:17.528Z
Learning: In libs/tokens/src/state/tokens/allTokensAtom.ts (TypeScript/Jotai), the team prefers to wait for token lists to initialize (listsStatesListAtom non-empty) before returning tokens. No fallback to favorites/user-added/native tokens should be used when listsStatesList is empty.

Applied to files:

  • libs/tokens/src/const/lpTokensList.json
📚 Learning: 2025-08-08T13:56:18.009Z
Learnt from: shoom3301
Repo: cowprotocol/cowswap PR: 6125
File: libs/tokens/src/updaters/TokensListsUpdater/index.tsx:29-31
Timestamp: 2025-08-08T13:56:18.009Z
Learning: In libs/tokens/src/updaters/TokensListsUpdater/index.tsx, the project’s current Jotai version requires using `unstable_getOnInit` (not `getOnInit`) in atomWithStorage options; keep `{ unstable_getOnInit: true }` until Jotai is upgraded.

Applied to files:

  • apps/cow-fi/services/tokens/index.ts
📚 Learning: 2025-05-26T12:39:29.009Z
Learnt from: cowdan
Repo: cowprotocol/cowswap PR: 5715
File: libs/common-const/src/tokens.ts:539-555
Timestamp: 2025-05-26T12:39:29.009Z
Learning: The team accepts using NATIVE_CURRENCY_ADDRESS as a temporary placeholder for COW token contract addresses on new networks (Polygon, Avalanche) until actual COW contracts are deployed.

Applied to files:

  • apps/cow-fi/services/tokens/index.ts
🧬 Code graph analysis (2)
apps/cowswap-frontend/src/tradingSdk/TestReceiverAccountBridgeProvider.ts (1)
libs/common-const/src/cdn.ts (1)
  • COW_CDN (1-1)
apps/cow-fi/services/tokens/index.ts (2)
apps/cow-fi/const/networkMap.ts (1)
  • Network (55-55)
libs/common-const/src/cdn.ts (1)
  • COW_CDN (1-1)
🪛 ESLint
apps/cow-fi/services/tokens/index.ts

[error] 11-11: @cowprotocol/common-const import should occur before import of exponential-backoff

(import/order)

⏰ 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). (2)
  • GitHub Check: Cypress
  • GitHub Check: Setup
🔇 Additional comments (4)
apps/cowswap-frontend/src/tradingSdk/TestReceiverAccountBridgeProvider.ts (2)

24-25: LGTM! CDN migration implemented correctly.

The logo URL now uses the configurable COW_CDN constant, which aligns with the PR objectives to migrate from GitHub CDN to AWS. The template literal construction is clean and maintainable.

Note that this test provider now depends on the external CDN for the logo. While this is consistent with the migration, be aware that CDN availability could affect test reliability if the logo loading is verified in tests.


1-1: No changes needed. The import of COW_CDN from @cowprotocol/common-const is correct and follows the established pattern used throughout the codebase. In this monorepo setup, workspace packages like @cowprotocol/common-const are available through workspace resolution even without explicit declaration in apps/cowswap-frontend/package.json. Hundreds of other files in apps/cowswap-frontend successfully use this same import pattern.

libs/tokens/src/const/lpTokensList.json (1)

4-31: LP token list sources correctly moved to files.cow.fi

All six LP token source URLs now point at https://files.cow.fi/token-lists/lp-tokens/*.json while keeping priorities and providers unchanged. This is a clean data-only switch away from GitHub and matches the PR goal.

libs/tokens/src/const/tokensList.json (1)

6-195: Token list sources consistently switched to CoW CDN-backed URLs

The updated "source" fields now use https://files.cow.fi/token-lists/... for the CoW/CoinGecko/Uniswap lists across all chain IDs, while leaving third‑party lists (Curve, Honeyswap, Optimism, Balancer, ondoprotocol) unchanged. This keeps priorities and enabledByDefault semantics intact and routes CoW‑controlled lists through the new CDN as intended.

Given that token lists are maintained in the dedicated cowprotocol/token-lists repo, centralizing them behind files.cow.fi is consistent with the existing separation of concerns. Based on learnings, ...


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.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 28, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@kernelwhisperer
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

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 (3)
apps/explorer/src/utils/miscellaneous.ts (1)

43-55: Make deprecation message point to the intended replacement

Marking getImageUrl as deprecated is good, but @deprecated TODO5(daniel) doesn’t tell callers what to use instead. Consider changing it to something like @deprecated Use <new util> from <package> instead once the new logo URL helper is finalized, so migration is straightforward.

libs/tokens/src/utils/trustTokenLogoUrl.ts (1)

17-28: Clarify what should replace trustTokenLogoUrl

The deprecation marker is helpful, but @deprecated TODO5(daniel) is vague. To ease future cleanup, consider updating it to reference the concrete replacement (for example, a CowFi-based logo helper) once agreed, so callers know what to migrate to.

apps/explorer/src/hooks/useTokenList.ts (1)

32-38: Sepolia CowSwap list URL now matches shared token-list config

Using https://files.cow.fi/token-lists/CowSwapSepolia.json for Sepolia keeps this hook aligned with libs/tokens/src/const/tokensList.json and the tokensList mocks. As a future clean‑up, you might consider centralizing the CowSwap list URLs (main + Sepolia) in a shared constant to avoid string drift across explorer, frontend, and libs.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d54f31b and 959ab2e.

📒 Files selected for processing (10)
  • apps/cowswap-frontend/src/modules/permit/const.ts (1 hunks)
  • apps/cowswap-frontend/src/modules/tokensList/mocks.ts (2 hunks)
  • apps/explorer/src/hooks/useTokenList.ts (1 hunks)
  • apps/explorer/src/utils/miscellaneous.ts (1 hunks)
  • apps/widget-configurator/src/app/configurator/consts.ts (1 hunks)
  • libs/common-const/src/cowprotocolTokenLogoUrl.ts (1 hunks)
  • libs/tokens/src/const/lpTokensList.json (1 hunks)
  • libs/tokens/src/const/tokensList.json (11 hunks)
  • libs/tokens/src/state/tokenLists/tokenListsStateAtom.ts (1 hunks)
  • libs/tokens/src/utils/trustTokenLogoUrl.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (14)
📓 Common learnings
Learnt from: alfetopito
Repo: cowprotocol/cowswap PR: 5992
File: libs/tokens/src/const/tokensList.json:135-167
Timestamp: 2025-07-18T08:07:55.497Z
Learning: Token lists for CoW Swap are maintained in a separate repository at https://github.com/cowprotocol/token-lists, not in the main cowswap repository. Issues related to missing token lists should be tracked in the token-lists repository.
📚 Learning: 2025-09-25T08:49:32.256Z
Learnt from: shoom3301
Repo: cowprotocol/cowswap PR: 6299
File: apps/cowswap-frontend/src/entities/bridgeProvider/useBridgeSupportedNetworks.test.tsx:62-67
Timestamp: 2025-09-25T08:49:32.256Z
Learning: In the cowswap-frontend codebase, when testing hooks that use multiple bridge providers, both providers are always properly mocked as complete jest.Mocked<BridgeProvider<BridgeQuoteResult>> objects with all required methods stubbed, ensuring no undefined returns that could break the hook logic.

Applied to files:

  • apps/cowswap-frontend/src/modules/tokensList/mocks.ts
📚 Learning: 2025-07-18T08:07:55.497Z
Learnt from: alfetopito
Repo: cowprotocol/cowswap PR: 5992
File: libs/tokens/src/const/tokensList.json:135-167
Timestamp: 2025-07-18T08:07:55.497Z
Learning: Token lists for CoW Swap are maintained in a separate repository at https://github.com/cowprotocol/token-lists, not in the main cowswap repository. Issues related to missing token lists should be tracked in the token-lists repository.

Applied to files:

  • apps/cowswap-frontend/src/modules/tokensList/mocks.ts
  • apps/widget-configurator/src/app/configurator/consts.ts
  • libs/tokens/src/state/tokenLists/tokenListsStateAtom.ts
  • libs/tokens/src/const/lpTokensList.json
  • libs/common-const/src/cowprotocolTokenLogoUrl.ts
  • libs/tokens/src/const/tokensList.json
  • apps/explorer/src/hooks/useTokenList.ts
📚 Learning: 2025-02-20T15:59:33.749Z
Learnt from: shoom3301
Repo: cowprotocol/cowswap PR: 5443
File: apps/cowswap-frontend/src/modules/swap/containers/ConfirmSwapModalSetup/index.tsx:71-71
Timestamp: 2025-02-20T15:59:33.749Z
Learning: The swap module in apps/cowswap-frontend/src/modules/swap/ is marked for deletion in PR #5444 as part of the swap widget unification effort.

Applied to files:

  • apps/cowswap-frontend/src/modules/tokensList/mocks.ts
📚 Learning: 2025-09-11T08:25:51.460Z
Learnt from: alfetopito
Repo: cowprotocol/cowswap PR: 6234
File: libs/tokens/src/index.ts:1-4
Timestamp: 2025-09-11T08:25:51.460Z
Learning: In the cowprotocol/cowswap project, there is currently no SSR (Server-Side Rendering) support, so localStorage access at module import time does not cause SSR-related issues.

Applied to files:

  • apps/cowswap-frontend/src/modules/tokensList/mocks.ts
  • apps/explorer/src/hooks/useTokenList.ts
📚 Learning: 2025-07-28T16:26:08.051Z
Learnt from: cowdan
Repo: cowprotocol/cowswap PR: 6034
File: apps/cowswap-frontend-e2e/src/e2e/fiat-amounts.test.ts:44-47
Timestamp: 2025-07-28T16:26:08.051Z
Learning: In the cowswap codebase, using trivial placeholder tests like `it('should be true', () => { expect(true).to.be.true })` in e2e test files is an intentional pattern when disabling broken tests to keep CI green while maintaining build efficiency.

Applied to files:

  • apps/cowswap-frontend/src/modules/tokensList/mocks.ts
📚 Learning: 2025-09-25T08:48:53.495Z
Learnt from: shoom3301
Repo: cowprotocol/cowswap PR: 6299
File: apps/cowswap-frontend/src/entities/bridgeProvider/useBridgeSupportedNetworks.test.tsx:58-60
Timestamp: 2025-09-25T08:48:53.495Z
Learning: In the cowswap-frontend codebase, when writing SWR tests, the team prefers maximum test isolation by using `provider: () => new Map()` in SWRConfig wrappers, even if it recreates cache on every render, to ensure tests don't share any state.

Applied to files:

  • apps/cowswap-frontend/src/modules/tokensList/mocks.ts
📚 Learning: 2025-08-08T13:55:17.528Z
Learnt from: shoom3301
Repo: cowprotocol/cowswap PR: 6125
File: libs/tokens/src/state/tokens/allTokensAtom.ts:78-78
Timestamp: 2025-08-08T13:55:17.528Z
Learning: In libs/tokens/src/state/tokens/allTokensAtom.ts (TypeScript/Jotai), the team prefers to wait for token lists to initialize (listsStatesListAtom non-empty) before returning tokens. No fallback to favorites/user-added/native tokens should be used when listsStatesList is empty.

Applied to files:

  • apps/cowswap-frontend/src/modules/tokensList/mocks.ts
  • apps/widget-configurator/src/app/configurator/consts.ts
  • libs/tokens/src/state/tokenLists/tokenListsStateAtom.ts
  • libs/tokens/src/const/lpTokensList.json
  • libs/tokens/src/const/tokensList.json
  • apps/explorer/src/hooks/useTokenList.ts
📚 Learning: 2025-08-08T13:56:18.009Z
Learnt from: shoom3301
Repo: cowprotocol/cowswap PR: 6125
File: libs/tokens/src/updaters/TokensListsUpdater/index.tsx:29-31
Timestamp: 2025-08-08T13:56:18.009Z
Learning: In libs/tokens/src/updaters/TokensListsUpdater/index.tsx, the project’s current Jotai version requires using `unstable_getOnInit` (not `getOnInit`) in atomWithStorage options; keep `{ unstable_getOnInit: true }` until Jotai is upgraded.

Applied to files:

  • libs/tokens/src/state/tokenLists/tokenListsStateAtom.ts
  • apps/explorer/src/hooks/useTokenList.ts
📚 Learning: 2025-08-12T06:33:19.348Z
Learnt from: shoom3301
Repo: cowprotocol/cowswap PR: 6137
File: libs/tokens/src/state/tokens/allTokensAtom.ts:34-65
Timestamp: 2025-08-12T06:33:19.348Z
Learning: In libs/tokens/src/state/tokens/allTokensAtom.ts, the parseTokenInfo() function returns a new instance of TokenInfo each time, making it safe to mutate properties like lpTokenProvider on the returned object without side effects.

Applied to files:

  • libs/tokens/src/state/tokenLists/tokenListsStateAtom.ts
  • libs/tokens/src/const/lpTokensList.json
📚 Learning: 2025-08-12T06:33:19.348Z
Learnt from: shoom3301
Repo: cowprotocol/cowswap PR: 6137
File: libs/tokens/src/state/tokens/allTokensAtom.ts:34-65
Timestamp: 2025-08-12T06:33:19.348Z
Learning: In libs/tokens/src/utils/parseTokenInfo.ts, the parseTokenInfo() function returns a new instance of TokenInfo using object spread syntax ({ ...token, ... }), making it safe to mutate properties like lpTokenProvider on the returned object without side effects.

Applied to files:

  • libs/tokens/src/state/tokenLists/tokenListsStateAtom.ts
  • libs/tokens/src/const/lpTokensList.json
📚 Learning: 2025-08-05T14:27:05.023Z
Learnt from: alfetopito
Repo: cowprotocol/cowswap PR: 5992
File: libs/wallet/src/web3-react/utils/switchChain.ts:36-38
Timestamp: 2025-08-05T14:27:05.023Z
Learning: In libs/wallet/src/web3-react/utils/switchChain.ts, the team prefers using Record<SupportedChainId, string | null> over Partial<Record<SupportedChainId, string>> for WALLET_RPC_SUGGESTION to enforce that all supported chain IDs have explicit values set, even if some might be null. This ensures compile-time completeness checking.

Applied to files:

  • libs/tokens/src/state/tokenLists/tokenListsStateAtom.ts
📚 Learning: 2025-05-26T12:39:29.009Z
Learnt from: cowdan
Repo: cowprotocol/cowswap PR: 5715
File: libs/common-const/src/tokens.ts:539-555
Timestamp: 2025-05-26T12:39:29.009Z
Learning: The team accepts using NATIVE_CURRENCY_ADDRESS as a temporary placeholder for COW token contract addresses on new networks (Polygon, Avalanche) until actual COW contracts are deployed.

Applied to files:

  • libs/common-const/src/cowprotocolTokenLogoUrl.ts
📚 Learning: 2025-09-19T11:38:59.206Z
Learnt from: fairlighteth
Repo: cowprotocol/cowswap PR: 6232
File: apps/cowswap-frontend/src/modules/tokensList/pure/ChainsSelector/index.tsx:199-200
Timestamp: 2025-09-19T11:38:59.206Z
Learning: The makeBuildClickEvent function in apps/cowswap-frontend/src/modules/tokensList/pure/ChainsSelector/index.tsx takes five parameters: defaultChainId, contextLabel, mode, isSwapMode, and chainsCount. The chainsCount parameter is used to determine the CrossChain flag in analytics events.

Applied to files:

  • apps/explorer/src/hooks/useTokenList.ts
🔇 Additional comments (7)
apps/widget-configurator/src/app/configurator/consts.ts (1)

11-19: CoinGecko mainnet URL aligns with central token list config

The new CoinGecko.1.json URL matches the mainnet CoinGecko entry in libs/tokens/src/const/tokensList.json, so the widget’s defaults stay in sync with the shared token list config.

libs/common-const/src/cowprotocolTokenLogoUrl.ts (1)

3-6: Verify new CowFi images root matches deployed bucket structure

Switching tokenUrlRoot to https://files.cow.fi/token-lists/images keeps the same ${chainId}/${address}/logo.png pattern, which looks consistent with how token-list images are organized. Given how widely this helper is used, please double‑check that the bucket actually exposes paths in this exact form (no extra src/public segment, trailing slash differences, etc.) so logos don’t regress.

apps/cowswap-frontend/src/modules/permit/const.ts (1)

5-6: PermitInfo URL host migration looks good; confirm endpoint in runtime

Updating PRE_GENERATED_PERMIT_URL to https://files.cow.fi/token-lists/PermitInfo fits the CDN migration. Please sanity‑check in dev/staging that consumers successfully fetch from this new endpoint (status 200 + expected JSON) so we don’t break pre‑generated permit loading.

libs/tokens/src/const/tokensList.json (1)

1-195: Token-list CDN migration looks consistent; clarify remaining raw.githubusercontent.com sources

The new files.cow.fi URLs for CoinGecko/Uniswap/CowSwap lists across chains look consistent with other modules (e.g. widget configurator default lists, explorer’s useTokenList, Sepolia CowSwap list), which helps centralize everything on the same CDN. Based on learnings, this matches the dedicated token-lists repo being surfaced via CowFi.

There are still a few raw.githubusercontent.com entries here (Ondo “cowswap-global-markets-token-list” on chains 1 & 56, and Balancer’s tokenlist on Arbitrum). If the PR’s scope is only CoW‑owned lists, that’s fine; otherwise, it might be worth confirming whether these third‑party lists are expected to stay on GitHub raw or if you plan to mirror them to files.cow.fi as well to fully avoid GitHub rate‑limit issues.

apps/cowswap-frontend/src/modules/tokensList/mocks.ts (1)

101-141: Mocks now align with CowFi-hosted Sepolia list and logo

Pointing listsMock.source at the CowFi‑hosted CowSwapSepolia.json and updating importListsMock’s logo to the CowFi image keeps the mocks in sync with the production configuration without impacting runtime behavior. This should make tests and stories better reflect the real setup.

libs/tokens/src/state/tokenLists/tokenListsStateAtom.ts (1)

17-37: UNISWAP token‑list URLs correctly migrated to files.cow.fi

The per‑chain URL mappings look consistent (chain IDs match filenames, Lens keeps the CoinGecko fallback), and the change is limited to swapping the host to files.cow.fi without altering existing selection logic. From this file’s perspective, the migration is clean.

If any of these lists turn out to be missing or need content tweaks, that should be handled in the separate token-lists repo rather than here. Based on learnings, token lists are maintained externally.

libs/tokens/src/const/lpTokensList.json (1)

3-31: LP token list sources cleanly switched to files.cow.fi

All LP providers now use the new files.cow.fi/token-lists/lp-tokens/... endpoints, with priorities and provider identifiers unchanged. This is a straightforward data‑source swap and looks good.

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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
libs/hook-dapp-lib/src/hookDappsRegistry.ts (1)

12-12: Incomplete CDN migration for internal hook DApps.

The PR description states it replaces "all references to raw.githubusercontent.com" but four internal hook entries still use GitHub CDN:

  • BUILD_CUSTOM_HOOK (line 12)
  • CLAIM_GNO_FROM_VALIDATORS (line 22)
  • PERMIT_HOOK_DAPP_ID (line 36)
  • CLAIM_COW_AIRDROP (line 50)

While Bungee and Across DApps have been migrated to files.cow.fi/cow-sdk, these internal entries remain on GitHub. Migrate these image URLs to the AWS CDN or document why they're intentionally excluded from the migration.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 959ab2e and f598a67.

📒 Files selected for processing (4)
  • apps/cowswap-frontend/src/modules/orderProgressBar/pure/OrderProgressBar/index.cosmos.tsx (1 hunks)
  • apps/cowswap-frontend/src/tradingSdk/TestReceiverAccountBridgeProvider.ts (1 hunks)
  • apps/explorer/src/components/orders/OrderDetails/crossChainOrder.mock.ts (1 hunks)
  • libs/hook-dapp-lib/src/hookDappsRegistry.ts (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • apps/cowswap-frontend/src/modules/orderProgressBar/pure/OrderProgressBar/index.cosmos.tsx
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-06-10T09:57:40.679Z
Learnt from: shoom3301
Repo: cowprotocol/cowswap PR: 5787
File: apps/explorer/src/components/orders/BridgeDetailsTable/BridgeDetailsContent/index.tsx:33-40
Timestamp: 2025-06-10T09:57:40.679Z
Learning: In the bridge provider info structure (CrossChainOrder.provider.info), the `website` property is not optional and will always be present, so no conditional checking is needed when accessing `providerInfo.website`.

Applied to files:

  • apps/explorer/src/components/orders/OrderDetails/crossChainOrder.mock.ts
  • apps/cowswap-frontend/src/tradingSdk/TestReceiverAccountBridgeProvider.ts
📚 Learning: 2025-09-25T08:49:32.256Z
Learnt from: shoom3301
Repo: cowprotocol/cowswap PR: 6299
File: apps/cowswap-frontend/src/entities/bridgeProvider/useBridgeSupportedNetworks.test.tsx:62-67
Timestamp: 2025-09-25T08:49:32.256Z
Learning: In the cowswap-frontend codebase, when testing hooks that use multiple bridge providers, both providers are always properly mocked as complete jest.Mocked<BridgeProvider<BridgeQuoteResult>> objects with all required methods stubbed, ensuring no undefined returns that could break the hook logic.

Applied to files:

  • apps/cowswap-frontend/src/tradingSdk/TestReceiverAccountBridgeProvider.ts
📚 Learning: 2025-08-12T05:57:08.021Z
Learnt from: shoom3301
Repo: cowprotocol/cowswap PR: 6138
File: libs/hook-dapp-lib/src/hookDappsRegistry.ts:1-1
Timestamp: 2025-08-12T05:57:08.021Z
Learning: The matchHooksToDapps function in libs/hook-dapp-lib/src/utils.ts provides backward compatibility for permit hooks through function selector detection (EIP_2612_PERMIT_SELECTOR and DAI_PERMIT_SELECTOR) rather than dappId matching, making it robust against dappId changes.

Applied to files:

  • libs/hook-dapp-lib/src/hookDappsRegistry.ts
🔇 Additional comments (2)
apps/explorer/src/components/orders/OrderDetails/crossChainOrder.mock.ts (1)

10-13: CDN logo URL update looks correct and non‑breaking

The logoUrl now points at the files.cow.fi/cow-sdk/bridging/providers/bungee/bungee-logo.png path, which matches the new CDN convention and keeps the mock structure intact. No runtime or typing impact here.

libs/hook-dapp-lib/src/hookDappsRegistry.ts (1)

168-168: LGTM! URL migration correctly implemented.

The Bungee and Across image URLs have been successfully migrated from GitHub CDN to the AWS-backed files.cow.fi domain, following a consistent path structure.

Also applies to: 181-181

@kernelwhisperer kernelwhisperer enabled auto-merge (squash) December 4, 2025 08:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants