Skip to content

Added registryAuths copy to WithoutRegistries() + test cases #816

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

Merged
merged 6 commits into from
Jun 12, 2025

Conversation

shuaiscott
Copy link
Contributor

Fixes #815

There is a bug where when the Maven Client is being reset to remove custom registries that were added from processing the pom.xml. The authentication configuration that was added when the client was first created with NewMavenRegistryAPIClient was forgotten to be copied in the WithoutRegistries function.

Also added test case for regression testing and also validate functionality before and after changes.

@oliverchang oliverchang requested a review from cuixq June 9, 2025 05:57
@shuaiscott
Copy link
Contributor Author

@cuixq I fixed the lint issues and ran golangci-lint manually. There's a conflict with the rules for the trailing whitespace. If I remove that trailing whitespace, then golangci-lint complains about it not being formatted with gofmt. If I format with gofmt, then golangci-lint complains that there's trailing whitespace.

@cuixq
Copy link
Collaborator

cuixq commented Jun 10, 2025

hmmm weird - usually the linter is happy with what is formatted by gofmt

@shuaiscott
Copy link
Contributor Author

@cuixq Figured it out. It was the line above the last one that was trailing. 🤦

@shuaiscott
Copy link
Contributor Author

@cuixq Fixed the unsafe usage as suggested. Could you please review?

Copy link
Collaborator

@cuixq cuixq left a comment

Choose a reason for hiding this comment

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

LGTM thanks! (I was OOO - sorry for the delay.)

@copybara-service copybara-service bot merged commit c2761b1 into google:main Jun 12, 2025
12 checks passed
@shuaiscott
Copy link
Contributor Author

@cuixq Thanks so much for the help!!

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.

MavenClient's "WithoutRegistries" method removes authentication data from client
2 participants