Skip to content

Conversation

lantoli
Copy link
Member

@lantoli lantoli commented Mar 28, 2025

Proposed changes

Upgrades golangci-lint to v2 using the migration guide, follow example in: mongodb/openapi#616

Jira ticket: CLOUDP-#

Please include a summary of the fix/feature/change, including any relevant motivation and context.

Link to any related issue(s):

Type of change:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as
    expected)
  • This change requires a documentation update
  • 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.

Manual QA performed:

  • cfn invoke for each of CRUDL/cfn test
  • Updated resource in example
  • Published to AWS private registry
  • Used the template in example to create and update a stack in AWS
  • Deleted stack to ensure resources are deleted
  • Created multiple resources in same stack
  • Validated in Atlas UI
  • Included screenshots

Required Checklist:

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • For CFN Resources: I have released by changes in the private registry and proved by change
    works in Atlas

Further comments

hwSpecJSON, err := json.Marshal(hardwareSpec)
require.NoError(t, err)
assert.Equal(t, tc.expected, string(hwSpecJSON))
assert.JSONEq(t, tc.expected, string(hwSpecJSON))
Copy link
Member Author

Choose a reason for hiding this comment

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

fixes: encoded-compare: use assert.JSONEq (testifylint)

hwSpec := config.GetElectableSpecs()
a.Equal(nodeCount, hwSpec.GetNodeCount())
}
if i == 0 {
Copy link
Member Author

Choose a reason for hiding this comment

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

fixes: QF1003: could use tagged switch on i (staticcheck)

}

func integrationToModel(currentModel Model, integration *admin.ThridPartyIntegration) Model {
enabled := false
Copy link
Member Author

Choose a reason for hiding this comment

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

fixes: QF1007: could merge conditional assignment into variable declaration (staticcheck)

@lantoli lantoli marked this pull request as ready for review March 28, 2025 10:23
@lantoli lantoli requested a review from a team as a code owner March 28, 2025 10:23
if currentModel.Enabled != nil {
enabled = true
}
enabled := currentModel.Enabled != nil
Copy link
Contributor

Choose a reason for hiding this comment

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

This can never be false?

Copy link
Member Author

Choose a reason for hiding this comment

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

can be false if currentModel.Enabled == nil

@lantoli lantoli added this pull request to the merge queue Mar 28, 2025
Merged via the queue into master with commit 2c001ab Mar 28, 2025
42 checks passed
@lantoli lantoli deleted the go_lint_v2 branch March 28, 2025 10:59
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.

3 participants