Conversation
WalkthroughThis update changes hardcoded URLs in three files to reference new commit hashes for remote resources on GitHub. Only the commit hashes in the URLs were modified; no other logic, structure, or functionality was altered in the affected files. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
npm error Exit handler never called! Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
tauri-app/src/lib/services/loadRemoteSettings.ts (1)
1-3: See earlier DRY note – same URL/commit duplication applies here
Re-use a shared constant instead of embedding the literal.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
packages/webapp/src/lib/constants.ts(1 hunks)packages/webapp/src/routes/+layout.ts(1 hunks)tauri-app/src/lib/services/loadRemoteSettings.ts(1 hunks)
| @@ -1,2 +1,2 @@ | |||
| export const REGISTRY_URL = | |||
| 'https://raw.githubusercontent.com/rainlanguage/rain.strategies/2a82d8f65144508aa803a1b738cec18365ca5f24/registry'; | |||
| 'https://raw.githubusercontent.com/rainlanguage/rain.strategies/929a06c00fe482d39c094ba0359a09cf10a6844d/registry'; | |||
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Hard-coded commit hash invites maintenance pain – centralize or parametrize
Pinning the commit inside each URL guarantees determinism, but scattering the literal throughout the codebase means every update requires multiple edits and risks drift.
Prefer exposing a single STRATEGIES_COMMIT_SHA (env variable, build-time config, or dedicated constants module) and compose the URL from it.
-export const REGISTRY_URL =
- 'https://raw.githubusercontent.com/rainlanguage/rain.strategies/929a06c00fe482d39c094ba0359a09cf10a6844d/registry';
+import { STRATEGIES_COMMIT_SHA } from './remoteVersions';
+
+export const REGISTRY_URL = `https://raw.githubusercontent.com/rainlanguage/rain.strategies/${STRATEGIES_COMMIT_SHA}/registry`;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| 'https://raw.githubusercontent.com/rainlanguage/rain.strategies/929a06c00fe482d39c094ba0359a09cf10a6844d/registry'; | |
| import { STRATEGIES_COMMIT_SHA } from './remoteVersions'; | |
| export const REGISTRY_URL = `https://raw.githubusercontent.com/rainlanguage/rain.strategies/${STRATEGIES_COMMIT_SHA}/registry`; |
🤖 Prompt for AI Agents
In packages/webapp/src/lib/constants.ts at line 2, the URL contains a hard-coded
commit hash which makes maintenance difficult. Refactor by defining a single
constant STRATEGIES_COMMIT_SHA to hold the commit hash value, then construct the
URL dynamically using this constant. This centralizes the commit hash, making
future updates easier and reducing the risk of inconsistencies.
| const REMOTE_SETTINGS_URL = | ||
| 'https://raw.githubusercontent.com/rainlanguage/rain.strategies/3ef26d1cc2a127cd7c096299d6f852af966285a5/settings.yaml'; | ||
| 'https://raw.githubusercontent.com/rainlanguage/rain.strategies/929a06c00fe482d39c094ba0359a09cf10a6844d/settings.yaml'; | ||
|
|
There was a problem hiding this comment.
🛠️ Refactor suggestion
Duplicate REMOTE_SETTINGS_URL literal – pull from shared constant to keep DRY
This exact URL string (including the commit SHA) now exists in at least two modules (+layout.ts here and loadRemoteSettings.ts in the Tauri app). Centralising it in a shared constants file (or re-exporting the constant from @rainlanguage/shared-config) avoids silent mismatches when the next commit bump happens.
-import { RaindexClient, type AccountCfg, type Address, type Hex } from '@rainlanguage/orderbook';
+import {
+ RaindexClient,
+ type AccountCfg,
+ type Address,
+ type Hex,
+ REMOTE_SETTINGS_URL
+} from '@rainlanguage/shared-config';
-
-const REMOTE_SETTINGS_URL =
- 'https://raw.githubusercontent.com/rainlanguage/rain.strategies/929a06c00fe482d39c094ba0359a09cf10a6844d/settings.yaml';📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const REMOTE_SETTINGS_URL = | |
| 'https://raw.githubusercontent.com/rainlanguage/rain.strategies/3ef26d1cc2a127cd7c096299d6f852af966285a5/settings.yaml'; | |
| 'https://raw.githubusercontent.com/rainlanguage/rain.strategies/929a06c00fe482d39c094ba0359a09cf10a6844d/settings.yaml'; | |
| -import { RaindexClient, type AccountCfg, type Address, type Hex } from '@rainlanguage/orderbook'; | |
| +import { | |
| + RaindexClient, | |
| + type AccountCfg, | |
| + type Address, | |
| + type Hex, | |
| + REMOTE_SETTINGS_URL | |
| +} from '@rainlanguage/shared-config'; | |
| -const REMOTE_SETTINGS_URL = | |
| - 'https://raw.githubusercontent.com/rainlanguage/rain.strategies/929a06c00fe482d39c094ba0359a09cf10a6844d/settings.yaml'; |
🤖 Prompt for AI Agents
In packages/webapp/src/routes/+layout.ts around lines 13 to 15, the
REMOTE_SETTINGS_URL string is duplicated and should be centralized. Remove the
hardcoded URL and instead import the REMOTE_SETTINGS_URL constant from the
shared constants file or from @rainlanguage/shared-config to ensure consistency
and avoid mismatches when updating the commit SHA.
Motivation
Update settings
Checks
By submitting this for review, I'm confirming I've done the following:
Summary by CodeRabbit