Skip to content

fix(unified-index): Use F idx in case of U servers#6296

Open
Aradhya-Tripathi wants to merge 2 commits into
developfrom
unified-index-fix
Open

fix(unified-index): Use F idx in case of U servers#6296
Aradhya-Tripathi wants to merge 2 commits into
developfrom
unified-index-fix

Conversation

@Aradhya-Tripathi
Copy link
Copy Markdown
Contributor

No description provided.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 29, 2026

Greptile Summary

This one-line fix changes autoname() so that u-series VirtualMachine records draw their sequential index from the f-series naming counter instead of their own isolated u counter. This ensures that a u VM and an f VM can never receive the same numeric index, preventing name collisions when unified servers spin up app-server resources that share the f-series namespace.

Confidence Score: 5/5

Safe to merge — minimal targeted change with clear intent and no logic issues identified.

The change is a single conditional in autoname(). It correctly redirects the naming-series counter for u VMs to the f counter while keeping the final self.name prefixed with the original self.series (u). No edge cases, security concerns, or regressions were found.

No files require special attention.

Important Files Changed

Filename Overview
press/press/doctype/virtual_machine/virtual_machine.py Single-line fix in autoname(): 'u' series VMs now draw their index from the 'f' naming-series counter instead of their own 'u' counter, preventing index collisions between 'u' and 'f' VMs.

Sequence Diagram

sequenceDiagram
    participant C as Caller
    participant VM as VirtualMachine.autoname()
    participant AN as make_autoname()
    participant DB as Frappe Series Counter (DB)

    C->>VM: create VirtualMachine(series="u", cluster="...")
    VM->>VM: series != "u" ? use self.series : use "f"
    Note over VM: series = "f-{cluster}.#####"
    VM->>AN: make_autoname("f-{cluster}.#####")
    AN->>DB: increment & fetch "f-{cluster}" counter
    DB-->>AN: e.g. 00051
    AN-->>VM: "f-{cluster}-00051"
    VM->>VM: self.index = 51
    VM->>VM: self.name = "u51-{cluster}.{domain}"
    VM-->>C: name = "u51-{cluster}.{domain}"
Loading

Reviews (1): Last reviewed commit: "Merge branch 'develop' into unified-inde..." | Re-trigger Greptile

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.72%. Comparing base (05332c5) to head (ede4978).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6296      +/-   ##
===========================================
- Coverage    56.41%   49.72%   -6.70%     
===========================================
  Files          936      936              
  Lines        77911    77911              
  Branches       525      353     -172     
===========================================
- Hits         43953    38739    -5214     
- Misses       33930    39148    +5218     
+ Partials        28       24       -4     
Flag Coverage Δ
dashboard 60.74% <ø> (-30.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant