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
refactor: Uses mocks on admin.APIClient instead of custom ClusterService #2056
refactor: Uses mocks on admin.APIClient instead of custom ClusterService #2056
Conversation
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.
LGTM
// Code generated by mockery. DO NOT EDIT. | ||
|
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.
should we also adjust the mockery configuration? surprised our CI check "Mock generation" did not catch this, but maybe it is because the interface has been removed.
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 think so, that file doesn't exist any more
GroupId: projectID, | ||
} | ||
clusters, resp, err := client.List(ctx, params) | ||
clusters, resp, err := client.ListClusters(ctx, projectID).Execute() |
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.
what is the difference beetween List and ListClusters? do they return the same thing just passing the params differently?
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.
func (a *ClusterServiceFromClient) List(ctx context.Context, options *admin.ListClustersApiParams) (*admin.PaginatedAdvancedClusterDescription, *http.Response, error) {
return a.client.ClustersApi.ListClustersWithParams(ctx, options).Execute()
👆 This was the old code in the service_advanced_cluster.go
. (only named List
)
I preferred using ListClusters
instead of ListClustersWithParams
since the ListClustersApiParams
only used GroupId
in the admin.ListClustersApiParams
…ted (#2052) * schedule compatibility matrix first day of month * WIP: test if status can be retrieved * test * test echo job status * change * Revert "change" This reverts commit 4b0e49e. * Revert "test echo job status" This reverts commit 4a83862. * test getting outputs of matrix * result * send slack * checkout step * fix name * correct json * formating * Revert "formating" This reverts commit f584822. * format * try * Revert "try" This reverts commit 7029f54. * use cat * Revert "use cat" This reverts commit 9503cd2. * remove unnecesary double quote * try cat * Revert "try cat" This reverts commit a2df8ff. * return json * unify json * fix * enrich message * TEMP: tag oncall on success * chore: Updates Atlas Go SDK (#2044) * build(deps): bump go.mongodb.org/atlas-sdk * fix tags * undo changes to admin20231001002 * API breaking change fixes --------- Co-authored-by: lantoli <430982+lantoli@users.noreply.github.com> * chore: Follow-up to Atlas SDK upgrade (#2051) * remove unused NewGroup * unify List call thanks to new API * refactor: Uses mocks on admin.APIClient for Project+Teams+ClustersAPIs instead of custom service (#2045) * refactor: Uses mocks on admin.APIClient instead of custom ClusterService (#2056) * fix: Fixes `network_container` resource update (#2055) * failing test * recreate resource if provider_name changes * fix update * allow update in place when provider_name changes * fix regions error handling * refactor tests checks * refactor checks in mig tests as well * fix change check * use MONGODB_ATLAS_PROJECT_ID (#2060) * chore: Removes old service from mockery (#2063) * feat: Allows user to specify to use an existing tag for release (#2053) * remove TEMP oncall tag on success * initialize oncall_tag * send notification when test suite fails * revert back testing change * remove temporary trigger of action * use oncall tag from secrets * Revert "use oncall tag from secrets" This reverts commit 5a7944f. * use SHA * new line * make oncall tag a secret --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: lantoli <430982+lantoli@users.noreply.github.com> Co-authored-by: Espen Albert <EspenAlbert@users.noreply.github.com> Co-authored-by: maastha <122359335+maastha@users.noreply.github.com>
Description
Uses mocks on admin.APIClient instead of custom ClusterService
Link to any related issue(s): CLOUDP-237016
Type of change:
Required Checklist:
Further comments