Skip to content

Conversation

@blva
Copy link
Collaborator

@blva blva commented May 26, 2025

Proposed changes

Jira ticket: CLOUDP-320359

Snapshot test:

=== RUN   TestLinkToken/Create
    atlas_e2e_test_generator.go:776: reading snapshot from "/home/runner/work/mongodb-atlas-cli/mongodb-atlas-cli/test/e2e/testdata/.snapshots/TestIdentityProviders/Describe_OIDC_IdP_WORKFORCE#01/GET__api_atlas_v2_federationSettings_656e4d8e91cb7d26db1bc9c6_identityProviders_6821824f9a8a55500612096d_1.snaphost"
=== RUN   TestIdentityProviders/Revoke_JWK_from_OIDC_IdP_WORKFORCE
    atlas_e2e_test_generator.go:776: reading snapshot from "/home/runner/work/mongodb-atlas-cli/mongodb-atlas-cli/test/e2e/testdata/.snapshots/TestLinkToken/Create/POST__api_atlas_v2_orgs_a0123456789abcdef012345a_liveMigrations_linkTokens_1.snaphost"
=== RUN   TestLinkToken/Delete
    atlas_e2e_test_generator.go:776: reading snapshot from "/home/runner/work/mongodb-atlas-cli/mongodb-atlas-cli/test/e2e/testdata/.snapshots/TestIdentityProviders/DELETE__api_atlas_v2_federationSettings_656e4d8e91cb7d26db1bc9c6_identityProviders_6821824f9a8a55500612096d_jwks_1.snaphost"
=== RUN   TestIdentityProviders/Delete_OIDC_IdP_WORKFORCE
    atlas_e2e_test_generator.go:776: reading snapshot from "/home/runner/work/mongodb-atlas-cli/mongodb-atlas-cli/test/e2e/testdata/.snapshots/TestLinkToken/Delete/DELETE__api_atlas_v2_orgs_a0123456789abcdef012345a_liveMigrations_linkTokens_1.snaphost"
--- PASS: TestLinkToken (0.42s)
    --- PASS: TestLinkToken/Create (0.15s)
    --- PASS: TestLinkToken/Delete (0.13s)
PASS
ok  	github.com/mongodb/mongodb-atlas-cli/atlascli/test/e2e/livemigrations	0.422s
  • Next: re-generate snapshots once this is merged

Checklist

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works
  • I have added any necessary documentation in document requirements section listed in CONTRIBUTING.md (if appropriate)
  • I have addressed the @mongodb/docs-cloud-team comments (if appropriate)
  • I have updated test/README.md (if an e2e test has been added)
  • I have run make fmt and formatted my code

Further comments

@blva blva marked this pull request as ready for review May 26, 2025 16:02
@blva blva requested a review from a team as a code owner May 26, 2025 16:02
@fmenezes
Copy link
Collaborator

Can you update the snapshots and rerun test?

@blva
Copy link
Collaborator Author

blva commented May 27, 2025

Can you update the snapshots and rerun test?

I was planning on doing it after, but we just got a snapshot update PR that's broken, I'll check that

@blva
Copy link
Collaborator Author

blva commented May 27, 2025

@fmenezes should we consider merging this as I'm still working on fixing the snapshot other issues? at least we'd have redacted data here

@blva blva requested a review from fmenezes May 27, 2025 10:37
@fmenezes
Copy link
Collaborator

looks like the test TestLinkToken/Create is still failing, I think we need to understand the test to make it work

X-Mongodb-Service-Version: gitHash=b4fa165bfbcb725abc0816ef770e5f595c0528ce; versionString=master
X-Permitted-Cross-Domain-Policies: none

{"linkToken":"[REDACTED]"}
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can do that or set the content length

Copy link
Collaborator

Choose a reason for hiding this comment

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

to be honest I think content length will be variable so I think you should most likely update it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, i decided to keep the expected length so that we don't need to update/intercept more items than needed

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think if you move your code to maskString it will automatically adjust content length

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

cool didn't know about maskString, let me try

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated!

@github-actions
Copy link
Contributor

Coverage Report 📈

Branch Commit Coverage
master 35c23ab 25.1%
CLOUDP-320359 d4bc064 25.1%
Difference 0%

@blva blva requested a review from fmenezes May 27, 2025 14:35
@blva blva enabled auto-merge (squash) May 27, 2025 14:45
Copy link
Collaborator

@fmenezes fmenezes left a comment

Choose a reason for hiding this comment

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

🎉

@blva blva merged commit ec31e07 into master May 27, 2025
21 of 22 checks passed
@blva blva deleted the CLOUDP-320359 branch May 27, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants