Skip to content
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

[papi] Add proto for SCMService #19075

Merged
merged 2 commits into from
Nov 21, 2023
Merged

[papi] Add proto for SCMService #19075

merged 2 commits into from
Nov 21, 2023

Conversation

AlexTugarev
Copy link
Member

@AlexTugarev AlexTugarev commented Nov 15, 2023

Description

This PR adds just the proto definition for the SCM service to be implemented by server in follow-up PRs.

Summary generated by Copilot

🤖 Generated by Copilot at c6877d7

This pull request adds a new public API service for SCM integration. It defines the SCMService in the scm.proto file and generates the code for the service in Go and TypeScript using different plugins. The service allows clients to get tokens, check scopes, search repositories, and list suggested repositories from SCM providers.

Related Issue(s)

Fixes #

How to test

Documentation

Preview status

gitpod:summary

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

message SearchRepositoriesRequest {
string organization_id = 1;
string search_string = 2;
int32 limit = 3;
Copy link
Member

Choose a reason for hiding this comment

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

it should be pagination request

Copy link
Member Author

Choose a reason for hiding this comment

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

See, the search is delegating to 3rd party services, where at most we can limit the results by number. We need to abstract over several APIs actually, and implementing quirks with pagination seems to be absolutely unhelpful.


option go_package = "github.com/gitpod-io/gitpod/components/public-api/go/v1";

service SCMService {
Copy link
Member

@svenefftinge svenefftinge Nov 15, 2023

Choose a reason for hiding this comment

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

thought: For all these methods we currently imply the authorizedUser. So there will be no way to call any of these methods in the context of a third user. I think. that is fine.

Copy link
Member

Choose a reason for hiding this comment

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

Also in case we later want to allow some of these methods to be called for other users, we can introduce a userId as an optional argument.

message SuggestedRepository {
string url = 1;
string repo_name = 2;
string config_name = 3;
Copy link
Member

@svenefftinge svenefftinge Nov 15, 2023

Choose a reason for hiding this comment

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

thought: It seems incorrect that the SCMService knows anything about configurations.

Copy link
Member Author

Choose a reason for hiding this comment

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

There is one branch in getSuggestedRepositories implementation that collecting the suggested repositories from the Org.
On Dashboard, when the repository finder is rendered, it prefers the config name over the repo name.

Copy link
Member Author

Choose a reason for hiding this comment

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

We discussed it in a call with @selfcontained and it's quite crucial to have this information on the results, otherwise it's not possible to add the related metadata on FE and have a great UX.

@AlexTugarev
Copy link
Member Author

/unhold

@roboquat roboquat merged commit 41a89f3 into main Nov 21, 2023
17 checks passed
@roboquat roboquat deleted the at/scm.proto branch November 21, 2023 11:41
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.

5 participants