v5 base#2195
Conversation
WalkthroughAdded a top-level Changes
Sequence Diagram(s)sequenceDiagram
participant Webapp
participant Tauri
participant Subgraph
participant FloatModule
rect #f0f8ff
Webapp->>Webapp: read REGISTRY_URL & REMOTE_SETTINGS_URL
Webapp->>Tauri: request remote settings
end
rect #f7fff0
Tauri->>Tauri: loadRemoteSettings(REMOTE_SETTINGS_URL)
Tauri-->>Tauri: fetch -> validate response.ok -> return text
end
rect #fff7f0
Subgraph->>FloatModule: getDecimalFloatAddress("base")
FloatModule-->>Subgraph: return 0x2F665E... (updated)
Subgraph->>Subgraph: read `OrderBook` address from `networks.json` (0x52CEB8...)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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: 1
♻️ Duplicate comments (1)
tauri-app/src/lib/services/loadRemoteSettings.ts (1)
1-2: URL update verified; note duplication concern.The URL update is correct and consistent with the webapp changes. However, this constant is duplicated in
packages/webapp/src/routes/+layout.ts(line 15).As noted in the review of
packages/webapp/src/routes/+layout.ts, consider extracting REMOTE_SETTINGS_URL to a shared constants file to maintain a single source of truth across the webapp and tauri-app.
📜 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)
🧰 Additional context used
📓 Path-based instructions (4)
packages/webapp/**/*.{svelte,ts}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Webapp must pass Svelte lint/format checks (npm run svelte-lint-format-check -w @rainlanguage/webapp)
Files:
packages/webapp/src/lib/constants.tspackages/webapp/src/routes/+layout.ts
packages/{webapp,ui-components}/**/*.{svelte,ts}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
If you modify frontend code, you must include a screenshot of the built webapp reflecting the change
Files:
packages/webapp/src/lib/constants.tspackages/webapp/src/routes/+layout.ts
packages/**
📄 CodeRabbit inference engine (AGENTS.md)
JavaScript/Svelte projects live under packages/* (webapp, ui-components, orderbook)
Files:
packages/webapp/src/lib/constants.tspackages/webapp/src/routes/+layout.ts
tauri-app/**
📄 CodeRabbit inference engine (AGENTS.md)
Desktop app code is in tauri-app (Rust + Svelte); src-tauri is not part of the Cargo workspace
Files:
tauri-app/src/lib/services/loadRemoteSettings.ts
⏰ 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). (17)
- GitHub Check: test
- GitHub Check: standard-tests (ubuntu-latest, test-js-bindings)
- GitHub Check: standard-tests (ubuntu-latest, rainix-wasm-test)
- GitHub Check: standard-tests (ubuntu-latest, rainix-sol-legal)
- GitHub Check: standard-tests (ubuntu-latest, rainix-wasm-artifacts)
- GitHub Check: standard-tests (ubuntu-latest, ob-rs-test, true)
- GitHub Check: standard-tests (ubuntu-latest, rainix-sol-artifacts)
- GitHub Check: standard-tests (ubuntu-latest, rainix-rs-static)
- GitHub Check: standard-tests (ubuntu-latest, rainix-sol-test)
- GitHub Check: standard-tests (ubuntu-latest, rainix-sol-static)
- GitHub Check: standard-tests (ubuntu-latest, rainix-rs-artifacts, true)
- GitHub Check: test
- GitHub Check: Deploy-Docs-Preview
- GitHub Check: Deploy-Preview-Push
- GitHub Check: build-tauri (ubuntu-22.04, true)
- GitHub Check: git-clean
- GitHub Check: test
🔇 Additional comments (2)
packages/webapp/src/routes/+layout.ts (1)
14-15: Remote settings URL verified. Commit c60b0d7e3ff41207eac83968e0b74c715f6ea1a4 exists and settings.yaml is accessible (HTTP 200).packages/webapp/src/lib/constants.ts (1)
1-2: Commit and registry path verified
Commit c60b0d7e3ff41207eac83968e0b74c715f6ea1a4 exists in rain.strategies and the/registrypath is accessible (HTTP 200).
| const REMOTE_SETTINGS_URL = | ||
| 'https://raw.githubusercontent.com/rainlanguage/rain.strategies/e5fb0899864c9a2b084dd97312f78ccac1444cab/settings.yaml'; | ||
| 'https://raw.githubusercontent.com/rainlanguage/rain.strategies/c60b0d7e3ff41207eac83968e0b74c715f6ea1a4/settings.yaml'; |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Consider extracting REMOTE_SETTINGS_URL to a shared constant.
The same URL constant is duplicated in tauri-app/src/lib/services/loadRemoteSettings.ts (line 2). This violates the DRY principle and can lead to inconsistencies if one location is updated but not the other.
Consider extracting this constant to a shared location, such as a common constants file that both the webapp and tauri-app can import. This ensures a single source of truth for the remote settings URL.
🤖 Prompt for AI Agents
In packages/webapp/src/routes/+layout.ts around lines 14-15 the
REMOTE_SETTINGS_URL is hardcoded and duplicated in
tauri-app/src/lib/services/loadRemoteSettings.ts; extract this value into a
shared constants module (e.g., packages/shared/src/constants.ts or
packages/common/constants.ts), export REMOTE_SETTINGS_URL from there, update
both packages to depend on that shared package (or add a path alias) and replace
the local hardcoded constants with imports from the shared module, then remove
the duplicate literal and ensure TypeScript build/config (tsconfig paths or
workspace package.json) allows both webapp and tauri-app to resolve the new
shared module.
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
packages/webapp/src/routes/+layout.ts (1)
14-15: Duplication issue persists: REMOTE_SETTINGS_URL duplicated across webapp and tauri-app.This constant remains duplicated in
tauri-app/src/lib/services/loadRemoteSettings.ts(line 2), which was previously flagged. The duplication creates a maintenance burden and risk of inconsistency. Additionally, the commit hashc7dbf55fa24d42863b173e39bcd8d67a092dfbfcnow appears in three locations across the codebase (this file, tauri-app, andpackages/webapp/src/lib/constants.ts).Consider extracting both the commit hash and the full URLs to a shared constants module to establish a single source of truth. Based on coding guidelines, the webapp and UI components live under
packages/*, so a shared package would be appropriate.</thinking_end -->
📜 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)
🧰 Additional context used
📓 Path-based instructions (4)
packages/webapp/**/*.{svelte,ts}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Webapp must pass Svelte lint/format checks (npm run svelte-lint-format-check -w @rainlanguage/webapp)
Files:
packages/webapp/src/routes/+layout.tspackages/webapp/src/lib/constants.ts
packages/{webapp,ui-components}/**/*.{svelte,ts}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
If you modify frontend code, you must include a screenshot of the built webapp reflecting the change
Files:
packages/webapp/src/routes/+layout.tspackages/webapp/src/lib/constants.ts
packages/**
📄 CodeRabbit inference engine (AGENTS.md)
JavaScript/Svelte projects live under packages/* (webapp, ui-components, orderbook)
Files:
packages/webapp/src/routes/+layout.tspackages/webapp/src/lib/constants.ts
tauri-app/**
📄 CodeRabbit inference engine (AGENTS.md)
Desktop app code is in tauri-app (Rust + Svelte); src-tauri is not part of the Cargo workspace
Files:
tauri-app/src/lib/services/loadRemoteSettings.ts
⏰ 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). (17)
- GitHub Check: test
- GitHub Check: standard-tests (ubuntu-latest, rainix-wasm-test)
- GitHub Check: standard-tests (ubuntu-latest, rainix-sol-legal)
- GitHub Check: standard-tests (ubuntu-latest, test-js-bindings)
- GitHub Check: standard-tests (ubuntu-latest, rainix-rs-static)
- GitHub Check: standard-tests (ubuntu-latest, rainix-sol-artifacts)
- GitHub Check: standard-tests (ubuntu-latest, rainix-wasm-artifacts)
- GitHub Check: standard-tests (ubuntu-latest, rainix-rs-artifacts, true)
- GitHub Check: standard-tests (ubuntu-latest, rainix-sol-static)
- GitHub Check: standard-tests (ubuntu-latest, rainix-sol-test)
- GitHub Check: standard-tests (ubuntu-latest, ob-rs-test, true)
- GitHub Check: build-tauri (ubuntu-22.04, true)
- GitHub Check: test
- GitHub Check: test
- GitHub Check: git-clean
- GitHub Check: Deploy-Preview-Push
- GitHub Check: Deploy-Docs-Preview
🔇 Additional comments (1)
packages/webapp/src/routes/+layout.ts (1)
14-15: Remote settings URL is valid
Commitc7dbf55fa24d42863b173e39bcd8d67a092dfbfcexists,settings.yamlis present at that ref, and the URL returns HTTP 200.
| export const REGISTRY_URL = | ||
| 'https://raw.githubusercontent.com/rainlanguage/rain.strategies/e5fb0899864c9a2b084dd97312f78ccac1444cab/registry'; | ||
| 'https://raw.githubusercontent.com/rainlanguage/rain.strategies/c7dbf55fa24d42863b173e39bcd8d67a092dfbfc/registry'; |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
🧩 Analysis chain
Verify the registry URL accessibility.
Ensure that:
- The
registryfile exists at the specified commit path - The URL is publicly accessible
Also note that the commit hash c7dbf55fa24d42863b173e39bcd8d67a092dfbfc is now duplicated across three files. Consider extracting it as a base constant (e.g., RAIN_STRATEGIES_COMMIT) and composing the URLs from it.
Run the following script to verify:
🏁 Script executed:
#!/bin/bash
# Verify the registry URL is valid and accessible
COMMIT="c7dbf55fa24d42863b173e39bcd8d67a092dfbfc"
REPO="rainlanguage/rain.strategies"
# Check if registry file exists at this commit
echo "Checking if registry file exists..."
gh api repos/$REPO/contents/registry?ref=$COMMIT --jq '.name' 2>&1
# Verify URL accessibility
echo -e "\nVerifying registry URL accessibility..."
curl -I -s "https://raw.githubusercontent.com/$REPO/$COMMIT/registry" | head -n 1Length of output: 97
🏁 Script executed:
#!/bin/bash
rg -n "c7dbf55fa24d42863b173e39bcd8d67a092dfbfc"Length of output: 492
Centralize the shared commit hash
The hash c7dbf55fa24d42863b173e39bcd8d67a092dfbfc appears in three places (packages/webapp/src/lib/constants.ts, src/routes/+layout.ts, and tauri-app/src/lib/services/loadRemoteSettings.ts). Extract it as a single RAIN_STRATEGIES_COMMIT constant and build each URL from that.
🤖 Prompt for AI Agents
In packages/webapp/src/lib/constants.ts lines 1-2, extract the hardcoded commit
hash c7dbf55fa24d42863b173e39bcd8d67a092dfbfc into a new exported constant
RAIN_STRATEGIES_COMMIT and redefine REGISTRY_URL by composing the base path with
that constant; then update the other two files (src/routes/+layout.ts and
tauri-app/src/lib/services/loadRemoteSettings.ts) to import
RAIN_STRATEGIES_COMMIT from this module and build their URLs from it so the
commit hash is centralized and reused.
Motivation
v5 base
Checks
By submitting this for review, I'm confirming I've done the following:
Summary by CodeRabbit
New Features
Chores