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

[server] Allow team members (and everyone in legacy mode) to access prebuilds #5433

Merged
merged 3 commits into from
Aug 31, 2021

Conversation

svenefftinge
Copy link
Member

@svenefftinge svenefftinge commented Aug 30, 2021

This PR relaxes resource-access so that team members can access prebuild workspaces and workspaceinstances.
It also replaces the old access guard for headless logs that would use the git access in favor of user/team based check.
caveat: Old prebuilds that don't have a project associated, yet, are accessible from everyone (see).

fixes #5344

@roboquat roboquat added size/L and removed size/M labels Aug 30, 2021
@svenefftinge svenefftinge force-pushed the se/prebuild_admission branch 3 times, most recently from beee7e8 to c6063c0 Compare August 30, 2021 08:15
@svenefftinge svenefftinge requested review from jankeromnes and removed request for JanKoehnlein August 30, 2021 08:38
@svenefftinge svenefftinge changed the title [server] allow everyone access to prebuilds [server] Allow team members (and everyone in legacy mode) to access prebuilds Aug 30, 2021
@svenefftinge svenefftinge marked this pull request as ready for review August 30, 2021 08:44
@svenefftinge
Copy link
Member Author

I'm refactoring the change to move the team member related access into its own resource guard.

@roboquat roboquat added size/L and removed size/XL labels Aug 31, 2021
@svenefftinge svenefftinge force-pushed the se/prebuild_admission branch 3 times, most recently from 187327a to 50922e5 Compare August 31, 2021 12:26
Copy link
Contributor

@jankeromnes jankeromnes left a comment

Choose a reason for hiding this comment

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

Code looks good to me, thanks!

Left a few questions & suggestions in-line.

Haven't tested this yet (will do so now).

components/server/src/workspace/gitpod-server-impl.ts Outdated Show resolved Hide resolved
components/server/src/workspace/gitpod-server-impl.ts Outdated Show resolved Hide resolved
components/server/src/workspace/gitpod-server-impl.ts Outdated Show resolved Hide resolved
components/server/src/workspace/headless-log-controller.ts Outdated Show resolved Hide resolved
@jankeromnes
Copy link
Contributor

jankeromnes commented Aug 31, 2021

Tested, and I'm now able to see the logs of a team prebuild! 🎉 (Apparently still running after 2h 😅)

Screenshot 2021-08-31 at 16 54 47

However, I also uncovered two bugs, but they're likely unrelated to this PR:

  1. When you don't authorize GitLab (just GitHub), most Team Project pages just fail to load anything if it's a GitLab project:
Screenshot 2021-08-31 at 16 50 28 Screenshot 2021-08-31 at 16 50 45 Screenshot 2021-08-31 at 16 51 22

However, authorizing with GitLab resolves this. We should probably handle these errors better (and show a "Authorize GitLab" button)

  1. For the project gitlab-vscode-extension, I was able to see branches and prebuilds, but not for the project blubb (the pages are just empty, no errors in the console) -- could it be that, as long as we haven't seen a single prebuild, we're unable to fetch the branches in some cases? 🤔 (Note: The Configurator is able to fetch the .gitpod.yml)

@jankeromnes
Copy link
Contributor

jankeromnes commented Aug 31, 2021

/hold because of the questions & suggestions

/lgtm otherwise 🎉

@jankeromnes
Copy link
Contributor

/approve no-issue

/lgtm

@roboquat
Copy link
Contributor

LGTM label has been added.

Git tree hash: 56addfaaaf6bcd7e716c9cf3df45bea588b386cc

@svenefftinge
Copy link
Member Author

svenefftinge commented Aug 31, 2021

/lgtm

@svenefftinge
Copy link
Member Author

/lgtm

@roboquat
Copy link
Contributor

@svenefftinge: you cannot LGTM your own PR.

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@roboquat
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jankeromnes, svenefftinge

Associated issue: #5344

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

The pull request process is described 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

Co-authored-by: Jan Keromnes <jan.keromnes@typefox.io>
@roboquat roboquat removed the lgtm label Aug 31, 2021
@jankeromnes
Copy link
Contributor

/lgtm
/unhold

@roboquat
Copy link
Contributor

LGTM label has been added.

Git tree hash: 939b1f9028f6093dfd4bec9b64780f5c83e2658d

@roboquat roboquat merged commit 0cb6553 into main Aug 31, 2021
@roboquat roboquat deleted the se/prebuild_admission branch August 31, 2021 16:49
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.

[Projects] Cannot access prebuild logs if not project owner
4 participants