Skip to content

fix(node): send core versions with a v prefix to node-serviced - #977

Merged
T3ST3ST3R0N merged 1 commit into
devfrom
fix/core-version-v-prefix
Oct 8, 2026
Merged

T3ST3ST3R0N merged 1 commit into
devfrom
fix/core-version-v-prefix

Conversation

@T3ST3ST3R0N

@T3ST3ST3R0N T3ST3ST3R0N commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

NodeCoreUpdate accepts core_version values with or without a leading v (pattern ^(latest|v?\d+\.\d+\.\d+)$) and forwarded them unchanged.

node-serviced and pg-node core-update look versions up by Xray release tag, which always starts with v. So a request like this failed with a 400 from node-serviced:

POST /api/node/{node_id}/core_update
{"core_version": "25.8.31"}

The dashboard is not affected; update-core-modal.tsx already adds the prefix.

Change

  • NodeCoreUpdate.add_v_prefix turns 25.8.31 into v25.8.31. latest and v25.8.31 are unchanged.
  • It is an after-validator, so the existing pattern still rejects invalid input first.
  • The OpenAPI schema is identical, so no make gen-api is needed.
  • This works with every node-serviced version, including ones already deployed.

The default "latest" is still rejected by node-serviced until PasarGuard/node-serviced#1 is released and installed on the node hosts.

Tests

  • New tests/test_node_core_update_model.py (8 cases: prefixing, pass-through, default, rejections).
  • tests/api/test_node.py passes.
  • ruff check and ruff format --check are clean.

Summary by CodeRabbit

  • Enhancements
    • Core version values without a leading v are now normalized to include one. The latest value remains unchanged.
  • Tests
    • Added coverage for version normalization, accepted formats, defaults, and invalid values.

NodeCoreUpdate accepted "X.Y.Z" but node-serviced and pg-node look versions up by release tag ("vX.Y.Z"), so a bare version sent through the API failed with 400. The model now adds the missing prefix; "latest" is unchanged.
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2d37cbd1-55f1-4034-838d-69888d4e2061
📥 Commits

Reviewing files that changed from the base of the PR and between 6372404 and 9866707.

📒 Files selected for processing (2)
  • app/models/node.py
  • tests/test_node_core_update_model.py

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.


Walkthrough

NodeCoreUpdate now prefixes unprefixed core versions with "v", except for "latest". Tests cover serialization, the default version, and invalid formats.

Changes

Core version validation

Layer / File(s) Summary
Normalize and validate core versions
app/models/node.py, tests/test_node_core_update_model.py
NodeCoreUpdate prefixes "v" to non-"latest" values that do not already start with "v". Tests cover accepted values, the "latest" default, and invalid formats.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: m03ed

Merge Risk: ⚪ Minimal · up to 98667

Bare release versions are normalized while “latest” remains unchanged. The known limitation for “latest” is outside this change; no introduced merge-blocking risk is evidenced.

🚥 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. 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 clearly and concisely describes the main change: adding a v prefix to core versions sent to node-serviced.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit checks the version string,
Adds a “v” before the spring.
“Latest” hops along unchanged,
Tests keep each format arranged.
The core version’s neat and clear,
The rabbit nibbles, pleased to cheer.

Comment @coderabbitai help to get the list of available commands.

@ImMohammad20000

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@T3ST3ST3R0N
T3ST3ST3R0N merged commit 6a090d6 into dev Oct 8, 2026
18 checks passed
@T3ST3ST3R0N
T3ST3ST3R0N deleted the fix/core-version-v-prefix branch October 22, 2026 12:34
Free-Guy-IR added a commit to Free-Guy-IR/panel that referenced this pull request Nov 2, 2026
… to ff6e596

Every Port queue line in the panel and side-repository ledgers now says
`security: yes` or `security: no`. Security: c9b445a (passkey client rename),
eb50bfd, PasarGuard#938, PasarGuard#940, PasarGuard#942, the cryptography 50.0.2 security release, and the ten
commits of upstream's PasarGuard#979 permission-leak batch (user list scopes, API-key
permissions, HWID visibility, users.read, the Telegram inline search), which no
branch ports yet.

Checked with git ls-remote on 2026-10-09: upstream dev moved to ff6e596. The
PasarGuard#979 batch, the node RPC fixes (PasarGuard#977, PasarGuard#978), the core-deletion restart (PasarGuard#934),
dashboard fixes (PasarGuard#852, PasarGuard#907, PasarGuard#949, PasarGuard#952), performance changes (PasarGuard#945, PasarGuard#853, PasarGuard#855) and
the merged dependabot bumps (ruff, uvloop, fastapi) join the queue; the ruff and
uvloop conditional waivers ended when upstream merged them. Waived: PasarGuard#980 and its
branch commit (the Telegram notifier workflow the fork deleted) and the superseded
fastapi dependabot head b021d6f. The refs snapshot records the five new heads.
Fork core-kit main 90701408 now contains upstream d2ecb5bd, so that ledger is empty.
No side repository gained an upstream commit since 2026-10-07.
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