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

APP-3604 build endpoints for external oauth and repos #544

Merged
merged 13 commits into from
Aug 14, 2024
Merged

Conversation

abe-winter
Copy link
Member

What changed

  • build service endpoints for:
    • external oauth app links
    • and for module-to-repo links

Why

Linking our build service to source control / CI is currently bad; it's super unintuitive and doesn't work with private repos. These endpoints let us use native oauth tools provided by git hosts for something closer to one-click setup. (no more yamls! no need to set up viam credentials).

Note the new endpoints are experimental (the entire build service is still marked as 'subject to change'). They don't work yet and should only be hit by the viam CLI, not external users.

@github-actions github-actions bot added the safe to test committer is a member of this org label Aug 13, 2024
@abe-winter abe-winter changed the title APP-3604 APP-3604 build endpoints for external oauth and repos Aug 13, 2024
@abe-winter abe-winter added the ready-for-protos add this when you want protos to compile on every commit label Aug 13, 2024
@abe-winter abe-winter removed the ready-for-protos add this when you want protos to compile on every commit label Aug 13, 2024
// git repo in owner/repository form
string repo = 5;
// email of the viam user who created this
string viam_user = 6;
Copy link
Member

Choose a reason for hiding this comment

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

Will it be an issue if the viam user is deleted?

Copy link
Member Author

Choose a reason for hiding this comment

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

this is just for tracking history; the authorization is done through the OAuth app link, which is permissioned per viam org

@@ -83,3 +99,74 @@ message ListJobsResponse {
// jobs is ordered by (build start time, alphabetical platform).
repeated JobInfo jobs = 1;
}

message RepoLink {
string app_link_id = 1;
Copy link
Member

Choose a reason for hiding this comment

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

Is this an Id from GH?

Copy link
Member

Choose a reason for hiding this comment

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

if it is, can we call oauth_app_link id or something? so it's a bit more clear where it comes from

Copy link
Member Author

Choose a reason for hiding this comment

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

yup way clearer, done in 33c41a0

@abe-winter abe-winter added the ready-for-protos add this when you want protos to compile on every commit label Aug 14, 2024
Copy link
Member

@ale7714 ale7714 left a comment

Choose a reason for hiding this comment

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

🚀

Copy link
Member

@zaporter-work zaporter-work left a comment

Choose a reason for hiding this comment

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

I have low context, but in isolation, these seem good

proto/viam/app/build/v1/build.proto Outdated Show resolved Hide resolved
proto/viam/app/build/v1/build.proto Show resolved Hide resolved
Comment on lines +148 to +149
// list of org public namespace (where available) or org UUIDs attached to the external app
repeated string org_id_or_ns = 4;
Copy link
Member

Choose a reason for hiding this comment

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

To support one user attaching multiple orgs to the same app?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes -- main motivation for this was our internal use pattern

Comment on lines 108 to 109
// public namespace of the module
optional string namespace = 3;
Copy link
Member

Choose a reason for hiding this comment

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

[probably worth discussing] Why is associating the namespace necessary for this message (same for AppLink)?

I worry that this will mean that will add a lot more logic & edge cases for module transfers from org to org.

Copy link
Member Author

Choose a reason for hiding this comment

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

this is populated in the downstream direction so that CLI output is user-readable; it's not stored in the DB and it's not used in the request. I'll edit the docstring to say this

Copy link
Member

Choose a reason for hiding this comment

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

SGTM

@abe-winter abe-winter removed the ready-for-protos add this when you want protos to compile on every commit label Aug 14, 2024
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Pranav Puranam <pranav.puranam@gmail.com>
@abe-winter abe-winter added protos-compiled ready-for-protos add this when you want protos to compile on every commit labels Aug 14, 2024
@abe-winter abe-winter removed the ready-for-protos add this when you want protos to compile on every commit label Aug 14, 2024
@abe-winter abe-winter added the ready-for-protos add this when you want protos to compile on every commit label Aug 14, 2024
@abe-winter abe-winter removed the ready-for-protos add this when you want protos to compile on every commit label Aug 14, 2024
@abe-winter abe-winter merged commit 13d2817 into main Aug 14, 2024
3 checks passed
@abe-winter abe-winter deleted the app-repo-links branch August 14, 2024 20:45
maxhorowitz added a commit that referenced this pull request Sep 16, 2024
* main: (22 commits)
  DATA-3094: Add CLI args to SubmitCustomTrainingJobRequest (#550)
  bump min golang version (#548)
  DATA-3054: Added UpdateBoundingBox (#547)
  RSDK-8595 update docs with new behavior (#546)
  APP-3604 build endpoints for external oauth and repos (#544)
  add last updated to fragment proto (#540)
  APP-5851: Add optional visibility field to `CreateFragmentRequest` (#543)
  APP-5314 - add dates and limit to GetRobotPartLogsRequest (#538)
  RSDK-7903 Add unhealthy state and error field (#539)
  RSDK-8381 add viam server version to API (#537)
  [APP-5417]: Undo APP-5417 (#536)
  [APP-5417]: Accommodate pagination for GetRobotPartHistory in api (#535)
  Data 2816/get training job logs (#534)
  DATA-2792 - Add URL to UpdateRegistryItemRequest, but make it optional (#532)
  RSDK-8228 Add config status to machine status API (#531)
  Add revision field to config (#530)
  [APP-5420] Add ListMachineFragments request and response (#525)
  [APP-5400]: Add GetFragmentHistory proto (#524)
  RSDK-7899 Add MachineStatus to RobotService (#527)
  RSDK-8083: add LogPatternConfig field to RobotConfig API (#526)
  ...
maxhorowitz added a commit that referenced this pull request Sep 16, 2024
* main: (22 commits)
  DATA-3094: Add CLI args to SubmitCustomTrainingJobRequest (#550)
  bump min golang version (#548)
  DATA-3054: Added UpdateBoundingBox (#547)
  RSDK-8595 update docs with new behavior (#546)
  APP-3604 build endpoints for external oauth and repos (#544)
  add last updated to fragment proto (#540)
  APP-5851: Add optional visibility field to `CreateFragmentRequest` (#543)
  APP-5314 - add dates and limit to GetRobotPartLogsRequest (#538)
  RSDK-7903 Add unhealthy state and error field (#539)
  RSDK-8381 add viam server version to API (#537)
  [APP-5417]: Undo APP-5417 (#536)
  [APP-5417]: Accommodate pagination for GetRobotPartHistory in api (#535)
  Data 2816/get training job logs (#534)
  DATA-2792 - Add URL to UpdateRegistryItemRequest, but make it optional (#532)
  RSDK-8228 Add config status to machine status API (#531)
  Add revision field to config (#530)
  [APP-5420] Add ListMachineFragments request and response (#525)
  [APP-5400]: Add GetFragmentHistory proto (#524)
  RSDK-7899 Add MachineStatus to RobotService (#527)
  RSDK-8083: add LogPatternConfig field to RobotConfig API (#526)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
protos-compiled safe to test committer is a member of this org
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants