fix: Adjust relationship between ServerGroup and Server/SharedServer#10076
fix: Adjust relationship between ServerGroup and Server/SharedServer#10076lkmatsumura wants to merge 1 commit into
Conversation
- Adjusting relationship - ServerGroup has many Servers - ServerGroup has many SharedServers - Server has one ServerGroup not servers - SharedServer has one ServerGroup not servers - Using back_populates instead of backref for better control - Adjusted references to ServerGroup in server (was server.serves): server.servergroup.name instead server.servers.name - Not find references to ServerGroup in SharedServer (sharedServer.servers)
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ 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 Tip Flake8 can be used to improve the quality of Python code reviews.Flake8 is a Python linter that wraps PyFlakes, pycodestyle and Ned Batchelder's McCabe script. To configure Flake8, add a '.flake8' or 'setup.cfg' file to your project root. See Flake8 Documentation for more details. |
dpage
left a comment
There was a problem hiding this comment.
This is a reasonable readability cleanup — the Server.servers relationship was confusingly named (it pointed to the one ServerGroup), so Server.servergroup / ServerGroup.servers + back_populates reads much better.
I checked the rest of the tree: the three call sites you updated (schema_diff ×3, sqleditor ×1) are the only real users of the old server.servers attribute, and nothing references the old auto-generated backref names (servergroup.server / .sharedserver), so dropping them is safe. The cascade is correctly carried over onto the new ServerGroup.servers/sharedservers relationships, and the FK columns are unchanged — so no schema/migration impact.
Two things before merge:
- No changelog entry — this still wants a one-line "Housekeeping" entry in the current
docs/en_US/release_notes_*.rst. - It's a pure rename with no functional change and no test; that's fine for a cleanup, but worth confirming the relationship rename doesn't disturb any serialization that relied on the attribute name.
Adjusting relationship
Adjusted references to ServerGroup in server (was server.serves): server.servergroup.name instead server.servers.name
Not find references to ServerGroup in SharedServer (sharedServer.servers)
Summary by CodeRabbit