Skip to content

Implement searchRepos for Bitbucket #18856

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

Conversation

selfcontained
Copy link
Contributor

@selfcontained selfcontained commented Oct 2, 2023

Description

Implements the searchRepos function for our Bitbucket & Bitbucket Server repository providers. This is used on the create workspace page as you search for repositories. Gitlab will be added in a followup PR.

You can see results from bitbucket cloud/server & github in this screenshot
image

Summary generated by Copilot

🤖 Generated by Copilot at e13f258

Implemented repository search for Bitbucket integration. Added searchRepos method to BitbucketRepositoryProvider class in bitbucket-repository-provider.ts.

Related Issue(s)

Fixes EXP-749 & EXP-751

How to test

  • You'll need to connect your account with Bitbucket cloud, and then with Bitbucket Server.
  • I've setup an org w/ our test Bitbucket Server instance and you can use this invite to join.
  • Go to your User Settings => Git Providers and connect both of the Bitbucket providers (cloud and server).
  • Go to the New Workspace page and search for repositories.
  • You may need to create a few test repositories if you don't have any already.
  • Bitbucket Server search is limited to prefix-search only, so keep that in mind when searching for repositories there.

Documentation

Preview status

Gitpod was successfully deployed to your preview environment.

Build Options

Build
  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer
  • analytics=segment
  • with-dedicated-emulation
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

@roboquat roboquat added size/L and removed size/M labels Oct 2, 2023
@roboquat roboquat added size/M and removed size/L labels Oct 2, 2023
public async searchRepos(user: User, searchString: string): Promise<RepositoryInfo[]> {
return [];
// Only load 1 page of 10 results for our searchString
const results = await this.api.getRepos(user, { maxPages: 1, limit: 10, searchString });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Bitbucket Server search is limited to prefix searching only, so the name must match from the beginning. For example:

test would match test-repo but would not match repo-test

@socket-security
Copy link

New dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
async-batch 1.1.2 None +0 7.69 kB sergelerator

@selfcontained selfcontained changed the title implementing searchRepositories Implement searchRepos for Bitbucket Oct 2, 2023
Copy link
Member

@filiptronicek filiptronicek left a comment

Choose a reason for hiding this comment

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

Testing with both Cloud and our Datacenter, everything looks good! :shipit:

@selfcontained
Copy link
Contributor Author

/unhold

@roboquat roboquat merged commit def4633 into main Oct 3, 2023
@roboquat roboquat deleted the brad/exp-749-implement-searchrepositories-for-bitbucket-cloud branch October 3, 2023 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants