cache external postgres port in Branch model#674
Merged
boddumanohar merged 3 commits intodevfrom Mar 31, 2026
Merged
Conversation
76fb871 to
35de377
Compare
mxsrc
reviewed
Mar 31, 2026
Collaborator
mxsrc
left a comment
There was a problem hiding this comment.
I think a cleaner approach would be a single helper to access the port, returning the branch attribute if present, if not, looking up and persisting the port. Ideally, it'd fail when the lookup fails as well.
This would avoid the fallbacks on access, avoid having to call the _persist function in multiple places, which is a code smell, and avoid having to establish the values during the migration.
Member
Author
|
thanks, that's actually a great idea. I've implemented the changes and update the PR description with the testing results. |
mxsrc
previously approved these changes
Mar 31, 2026
mxsrc
approved these changes
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes: simplyblock/vela#181
Currently as a part of _public of branch the node_port of a service is retrieved from API server. But this port number never changes. So this can be safely stored in branch model.
testing
after migration upon calling the /branch endpoint, the DB got populated