-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SLVS-1399 Implement IServerConnectionRepository #5663
SLVS-1399 Implement IServerConnectionRepository #5663
Conversation
{ | ||
lock (LockObject) | ||
{ | ||
try |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think try catch is needed here. Read... already does logging, mapper should not throw normally and TryWrite does not throw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's exactly the mapper that can throw, more exactly: GetServerConnectionsListJsonModel and, more specifically, the GetServerConnectionJsonModel
97ee856
to
2b76ed8
Compare
@@ -35,7 +35,7 @@ internal class ServerConnectionsRepositoryAdapter(IServerConnectionsRepository s | |||
{ | |||
public List<Connection> GetAllConnections() | |||
{ | |||
var connections = serverConnectionsRepository.GetAll(); | |||
serverConnectionsRepository.TryGetAll(out var connections); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the return value should not be ignored
Quality Gate passedIssues Measures |
c36a36d
into
feature/new-connected-mode
SLVS-1399
This PR targets this PR, because it depends on it for the implementation.
The server connections could be tested with the UI: if the file exists, the connections are shown in the manage binding dialog and manage connections dialog. Adding a connection with the UI is not implemented yet.
Example of a valid json:
{
"serverConnections": [
{
"id": "https://sonarcloud.io/organizations/myOrg",
"setting": {
"IsSmartNotificationsEnabled": false
},
"organizationKey": "mya",
"serverUri": null
}
]
}