Skip to content
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

chore: Upgrades private_link_endpoint resource to auto-generated SDK. #1901

Merged
merged 7 commits into from
Feb 2, 2024

Conversation

marcosuma
Copy link
Collaborator

@marcosuma marcosuma commented Feb 1, 2024

Description

Upgrades private_link_endpoint resource to auto-generated SDK.

Migration tests created.

Link to any related issue(s): CLOUDP-227301

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contribution guidelines
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • If changes include deprecations or removals, I defined an isolated PR with a relevant title as it will be used in the auto-generated changelog.
  • If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document.

Further comments

@marcosuma marcosuma marked this pull request as ready for review February 1, 2024 18:38
@marcosuma marcosuma requested a review from a team as a code owner February 1, 2024 18:38
"github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/mig"
)

func TestAccMigrationPrivateLinkEndpoint_basic(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not being run in CI

Copy link
Member

@lantoli lantoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great job!

Copy link
Member

@AgustinBettati AgustinBettati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one doubt

Comment on lines +319 to +321
if _, ok := p.GetStatusOk(); ok {
status = p.GetStatus()
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: why was this if added? Can see the possibility of non Ok status resulting in a "" status while this was not the case before, so just making sure no change in behavior here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we return an error if the status is not ok?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AgustinBettati this was added because of a fmt check error:

Formatting go files
==> Fixing linters errors...
fieldalignment -json -fix ./...
{}
golangci-lint run --fix
internal/service/privatelinkendpoint/resource_privatelink_endpoint.go:322:13: evalOrder: may want to evaluate p.GetStatus() before the return statement (gocritic)
                return p, p.GetStatus(), nil
                          ^
make: *** [lint-fix] Error 1

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we return an error if the status is not ok?

I think returning "" should already be enough. even if you return an error (unless you mean completely failing the whole request) will end up in a retry of the request since this code is in the refreshFunc logic.

Copy link
Collaborator

@andreaangiolillo andreaangiolillo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +319 to +321
if _, ok := p.GetStatusOk(); ok {
status = p.GetStatus()
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we return an error if the status is not ok?

@marcosuma marcosuma merged commit a974bb6 into master Feb 2, 2024
37 checks passed
@marcosuma marcosuma deleted the private-link-endpoint-sdkv2 branch February 2, 2024 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants