feat: extract nats cluster config lookup from manager#149
Open
thobiaskarlsson wants to merge 1 commit intomainfrom
Open
feat: extract nats cluster config lookup from manager#149thobiaskarlsson wants to merge 1 commit intomainfrom
thobiaskarlsson wants to merge 1 commit intomainfrom
Conversation
be428aa to
70adaa7
Compare
d859e19 to
cad6926
Compare
thobiaskarlsson
commented
Mar 4, 2026
| } | ||
| return account | ||
| } | ||
| // FIXME: Re-write all Account Manager test cases |
Collaborator
Author
There was a problem hiding this comment.
note: After refactoring into interfaces the original Account Manager tests are not working at all. To re-write them would be horribly with the current account secrets handling we have nested within this manager. The plan is to rely on the E2E tests for now, extract the Account Secrets management to it's own testable interface + impl to ensure that Account Manager unit tests focuses on the actual business flow instead of a X^n amount of secret lookup permutations.
cad6926 to
74df9da
Compare
Today we are resolving the cluster specific details within the Account Manager, -Factory and even the NATS client (implementation). With the introduction of `NatsClusterRef` this quickly turns into spaghetti code. A `NatsCluster` resource defaults to the Account namespace if absent, while legacy secrets lookup (System Account Admin creds & Operator Signing Key) defaults to the NAuth Operator namespace. Due to this it's close to impossible to understand what "default-"/"nauth-"/"operator-"/(simply) namespace relates to. Short answer is that it depends on the context, becoming extremely error-prone. Extracting the lookup of cluster details into a separate, testable port ensures separation of concerns and more focused unit tests, not at least for the (business related) account management flows. Signed-off-by: Thobias Karlsson <thobias.karlsson@gmail.com>
74df9da to
0a47bf1
Compare
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.
Today we are resolving the cluster specific details within the Account Manager, -Factory and even the NATS client (implementation). With the introduction of
NatsClusterRefthis quickly turns into spaghetti code. ANatsClusterresource defaults to the Account namespace if absent, while legacy secrets lookup (System Account Admin creds & Operator Signing Key) defaults to the NAuth Operator namespace. Due to this it's close to impossible to understand what "default-"/"nauth-"/"operator-"/(simply) namespace relates to. Short answer is that it depends on the context, becoming extremely error-prone. Extracting the lookup of cluster details into a separate, testable port ensures separation of concerns and more focused unit tests, not at least for the (business related) account management flows.