Skip to content

Update settings#2033

Merged
hardyjosh merged 2 commits intomainfrom
2025-07-25-settings
Jul 26, 2025
Merged

Update settings#2033
hardyjosh merged 2 commits intomainfrom
2025-07-25-settings

Conversation

@Siddharth2207
Copy link
Copy Markdown
Contributor

@Siddharth2207 Siddharth2207 commented Jul 25, 2025

Motivation

Update settings

Checks

By submitting this for review, I'm confirming I've done the following:

  • made this PR as small as possible
  • unit-tested any new functionality
  • linked any relevant issues or PRs
  • included screenshots (if this involves a front-end change)

Summary by CodeRabbit

  • Chores
    • Updated external resource URLs to reference the latest versions for improved accuracy and up-to-date content. No visible changes to app functionality.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 25, 2025

Walkthrough

This 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

File(s) Change Summary
packages/webapp/src/lib/constants.ts Updated REGISTRY_URL to use a new commit hash in the GitHub URL.
packages/webapp/src/routes/+layout.ts Updated REMOTE_SETTINGS_URL to use a new commit hash in the URL.
tauri-app/src/lib/services/loadRemoteSettings.ts Updated REMOTE_SETTINGS_URL to use a new commit hash in the URL.

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-07-25T17_13_30_425Z-debug-0.log

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 2025-07-25-settings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Siddharth2207 Siddharth2207 requested a review from hardyjosh July 25, 2025 17:12
@Siddharth2207 Siddharth2207 self-assigned this Jul 25, 2025
Copy link
Copy Markdown
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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between 0f20742 and 7094d99.

📒 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';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 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.

Suggested change
'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.

Comment on lines 13 to 15
const REMOTE_SETTINGS_URL =
'https://raw.githubusercontent.com/rainlanguage/rain.strategies/3ef26d1cc2a127cd7c096299d6f852af966285a5/settings.yaml';
'https://raw.githubusercontent.com/rainlanguage/rain.strategies/929a06c00fe482d39c094ba0359a09cf10a6844d/settings.yaml';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ 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.

Suggested change
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.

@hardyjosh hardyjosh enabled auto-merge July 26, 2025 07:29
@hardyjosh hardyjosh merged commit a6d0fb1 into main Jul 26, 2025
18 checks passed
This was referenced Sep 18, 2025
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.

2 participants