Skip to content

Require port for Monero node URLs#9387

Merged
omurovch merged 4 commits into
version/0.50from
add-node2
Jul 13, 2026
Merged

Require port for Monero node URLs#9387
omurovch merged 4 commits into
version/0.50from
add-node2

Conversation

@omurovch

@omurovch omurovch commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

#8358

Summary by CodeRabbit

  • New Features

    • Added clearer guidance for entering Monero node URLs, including an example with a required port.
    • Added a Manage Wallet label for the Accounts section.
  • Bug Fixes

    • Monero node URLs without ports are now rejected with a helpful validation message.
    • Improved duplicate-node detection for equivalent host and port combinations.
    • Standardized handling of Monero node addresses and default secure connections.
  • Chores

    • Improved the reliability of automated translation commits.

omurovch and others added 4 commits July 13, 2026 15:39
Add validation to ensure that manually entered Monero node URLs include a port number. If a port is missing, an error message is displayed to the user.

- Update `AddMoneroNodeViewModel` to validate the presence of a port in the RPC URL.
- Update `AddMoneroNodeScreen` input hint to show the expected format (e.g., `https://node.com:port`).
- Add a fallback to port 443 in `MoneroNodeManager` for nodes saved before this validation was implemented.
- Add `AddMoneroNode_Error_PortRequired` string resource.
Passing base64-encoded contents of large `strings.xml` files as command-line arguments to `jq` can exceed the kernel's 128KB per-argument limit (`MAX_ARG_STRLEN`), causing the workflow to fail.

Update the script to write encoded file contents to temporary files and use `jq`'s `--rawfile` and `--slurpfile` flags to process the data, avoiding the argument length restriction.
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Monero node URLs now require explicit ports, normalize default HTTPS ports, and use canonical duplicate detection. The translation workflow now builds GraphQL commit additions through JSONL and adds a skip-CI message body. New localization entries and URL guidance were added.

Changes

Monero node validation

Layer / File(s) Summary
Node endpoint validation and user guidance
walletkit/src/main/java/io/horizontalsystems/walletkit/core/managers/MoneroNodeManager.kt, walletkit/src/main/java/io/horizontalsystems/walletkit/modules/moneronetwork/addnode/*, walletkit/src/main/res/values/strings.xml, translation_snapshot.json
Node endpoints use an effective port, duplicate checks compare canonical host:port values, and the add-node flow rejects URLs without ports with updated guidance and localization.

Translation commit workflow

Layer / File(s) Summary
GraphQL translation commit payload
.github/workflows/translate.yml, translation_snapshot.json
Translation contents are written as JSONL and loaded with --slurpfile; the commit message includes a [skip ci] body, and the snapshot adds the Manage Wallet label.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AddMoneroNodeScreen
  participant AddMoneroNodeViewModel
  participant MoneroNodeManager
  AddMoneroNodeScreen->>AddMoneroNodeViewModel: submit node URL
  AddMoneroNodeViewModel->>MoneroNodeManager: check canonical endpoint
  MoneroNodeManager-->>AddMoneroNodeViewModel: return duplicate status
  AddMoneroNodeViewModel-->>AddMoneroNodeScreen: show validation result
Loading
sequenceDiagram
  participant TranslationWorkflow
  participant additions.jsonl
  participant GitHubGraphQL
  TranslationWorkflow->>additions.jsonl: write encoded translation files
  additions.jsonl-->>TranslationWorkflow: provide JSONL additions
  TranslationWorkflow->>GitHubGraphQL: call createCommitOnBranch
  GitHubGraphQL-->>TranslationWorkflow: return commit result
Loading

Possibly related PRs

Suggested reviewers: rafaelekol

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: Monero node URLs now must include a port.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-node2

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.

@coderabbitai coderabbitai Bot left a comment

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 comments (1)
.github/workflows/translate.yml (1)

50-60: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Simplify: use jq's @base64 filter instead of external base64 command.

The current approach base64-encodes each file with the external base64 command, writes to an intermediate temp file, then reads it back with --rawfile. This works but introduces an unnecessary temp file and a trailing newline from GNU base64 -w0 that ends up in the contents string.

jq's built-in @base64 filter can encode the raw file content directly, eliminating the intermediate file and the newline issue in one step:

♻️ Proposed refactor
          # Pass file contents to jq via --rawfile/--slurpfile, never as
          # command-line arguments: base64 of a large strings.xml exceeds
          # the kernel's 128KB per-argument limit (MAX_ARG_STRLEN).
          additions="$RUNNER_TEMP/additions.jsonl"
          : > "$additions"
          while IFS= read -r f; do
-            base64 -w0 "$f" > "$RUNNER_TEMP/file.b64"
-            jq -n --arg path "$f" --rawfile contents "$RUNNER_TEMP/file.b64" \
-              '{path: $path, contents: $contents}' >> "$additions"
+            jq -n --arg path "$f" --rawfile contents "$f" \
+              '{path: $path, contents: ($contents | `@base64`)}' >> "$additions"
          done <<< "$files"

This reads the original file once, base64-encodes inside jq (no trailing newline), and removes the file.b64 temp file entirely.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/translate.yml around lines 50 - 60, Update the loop around
the additions JSONL generation to remove the external base64 command and
RUNNER_TEMP/file.b64 intermediate file, and use jq’s `@base64` filter on each
file’s raw contents while preserving the existing path and contents fields and
record-count validation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/translate.yml:
- Around line 50-60: Update the loop around the additions JSONL generation to
remove the external base64 command and RUNNER_TEMP/file.b64 intermediate file,
and use jq’s `@base64` filter on each file’s raw contents while preserving the
existing path and contents fields and record-count validation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: cb5a633a-6a59-40d6-9419-12735cede63c

📥 Commits

Reviewing files that changed from the base of the PR and between 05a42b4 and f44bc6d.

⛔ Files ignored due to path filters (9)
  • walletkit/src/main/res/values-de/strings.xml is excluded by !**/res/values-*/strings.xml
  • walletkit/src/main/res/values-es/strings.xml is excluded by !**/res/values-*/strings.xml
  • walletkit/src/main/res/values-fa/strings.xml is excluded by !**/res/values-*/strings.xml
  • walletkit/src/main/res/values-fr/strings.xml is excluded by !**/res/values-*/strings.xml
  • walletkit/src/main/res/values-ko/strings.xml is excluded by !**/res/values-*/strings.xml
  • walletkit/src/main/res/values-pt-rBR/strings.xml is excluded by !**/res/values-*/strings.xml
  • walletkit/src/main/res/values-ru/strings.xml is excluded by !**/res/values-*/strings.xml
  • walletkit/src/main/res/values-tr/strings.xml is excluded by !**/res/values-*/strings.xml
  • walletkit/src/main/res/values-zh/strings.xml is excluded by !**/res/values-*/strings.xml
📒 Files selected for processing (6)
  • .github/workflows/translate.yml
  • translation_snapshot.json
  • walletkit/src/main/java/io/horizontalsystems/walletkit/core/managers/MoneroNodeManager.kt
  • walletkit/src/main/java/io/horizontalsystems/walletkit/modules/moneronetwork/addnode/AddMoneroNodeScreen.kt
  • walletkit/src/main/java/io/horizontalsystems/walletkit/modules/moneronetwork/addnode/AddMoneroNodeViewModel.kt
  • walletkit/src/main/res/values/strings.xml

@omurovch
omurovch merged commit f44bc6d into version/0.50 Jul 13, 2026
1 check passed
@omurovch
omurovch deleted the add-node2 branch July 13, 2026 11:32
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