Skip to content

Conversation

@Camila-B
Copy link
Contributor

@Camila-B Camila-B commented Oct 23, 2025

  • Creates new repos based on the test cluster name and RSync namespace and name, similar to what is done by other gitproviders
  • Removes the deletion of Bitbucket repos since they can now be reused
  • Replaces the use of curl with the http package

@google-oss-prow
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from camila-b. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Camila-B
Copy link
Contributor Author

/test all

@Camila-B
Copy link
Contributor Author

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request is a great improvement, refactoring the Bitbucket e2e test provider to reuse repositories and replacing curl commands with Go's native http package. This makes the tests more efficient and the code more robust. My review focuses on the new HTTP client usage, where I've identified a resource leak and a few areas to improve error handling for easier debugging. The suggested changes will help ensure the new implementation is solid.

@Camila-B
Copy link
Contributor Author

/retest

@Camila-B Camila-B changed the title [WIP]test: Reuse Bitbucket repos test: Reuse Bitbucket repos Oct 23, 2025
@Camila-B Camila-B marked this pull request as ready for review October 23, 2025 17:26
@google-oss-prow google-oss-prow bot requested review from mikebz and sdowell October 23, 2025 17:26
@Camila-B Camila-B requested review from tiffanny29631 and removed request for mikebz October 23, 2025 17:27
// The remote repo name is unique with a prefix of the local name.
func (b *BitbucketClient) CreateRepository(localName string) (string, error) {
u, err := uuid.NewRandom()
func (b *BitbucketClient) CreateRepository(name string) (string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest that if the method no longer creates something it's better to pick a different name than just Create. Create should probably error out if something exists.

@mikebz mikebz requested a review from Copilot October 25, 2025 02:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors Bitbucket repository management to reuse repositories across test runs instead of creating and deleting them each time. Repository names are now derived from the test cluster name and RSync namespace/name, similar to other git providers. The implementation replaces curl-based API calls with Go's native http package for improved maintainability.

Key changes:

  • Bitbucket repositories are now named deterministically and can be reused across test runs
  • Repository deletion logic removed since repos persist and are reset between runs
  • Replaced exec.Command curl calls with http.Client for better error handling

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
e2e/nomostest/gitproviders/bitbucket.go Refactored to use http package, added repository name sanitization, removed deletion logic, and implemented repository reuse
e2e/nomostest/gitproviders/util/reponame.go Added SanitizeBitbucketRepoName function with 62-char limit, extracted common sanitization logic, fixed double-dash issue
e2e/nomostest/gitproviders/util/reponame_test.go Added tests for SanitizeBitbucketRepoName and verified max length constraints
e2e/nomostest/gitproviders/git-provider.go Updated newBitbucketClient to accept clusterName parameter
e2e/nomostest/gitproviders/cloud_source_repository.go Removed duplicate "cs-e2e-" prefix when calling SanitizeRepoName

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

* Creates new repos based on the test cluster name and RSync namespace
  and name, similar to what is done by other gitproviders
* Removes the deletion of Bitbucket repos since they can now be reused
* Replaces the use of curl with the http package
@Camila-B
Copy link
Contributor Author

/retest

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.

4 participants