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

Enable collaborators #20353

Merged
merged 9 commits into from
Nov 22, 2024
Merged

Enable collaborators #20353

merged 9 commits into from
Nov 22, 2024

Conversation

filiptronicek
Copy link
Member

@filiptronicek filiptronicek commented Nov 8, 2024

Description

Makes the following changes to the Collaborator role:

  1. Allows Collaborators to read environment variables of a project
  2. Allows Collaborators to read prebuilds of a project
  3. Allows Collaborators to start a project (this is necessary for the two new capabilities above), but just by starting a workspace on the same repo that an existing project exists on. Any details, including project name, will not be shown.

Important

Heads up! This also enables collaborators to trigger prebuilds via our standard activity-based prebuilds trigger mechanism.

To be merged sometime around November 25th to give users a heads-up.

Related Issue(s)

Fixes CLC-815

How to test

  1. Join my org, you'll become a collaborator to it
  2. Try starting any repo, it should not let you.
  3. Try starting https://github.com/gitpod-samples/spring-petclinic, it should have environment variables (check for HELLO_VARIABLES) and it should be prebuilt.

Documentation

This does require documentation changes. I will work on those as we get closer to the merge date

@@ -128,15 +128,12 @@ export function deduplicateAndFilterRepositories(
if (results.length === 0) {
// If the searchString is a URL, and it's not present in the proposed results, "artificially" add it here.
if (isValidGitUrl(searchString)) {
console.log("It's valid man");
Copy link
Member Author

Choose a reason for hiding this comment

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

These super rad debug logs I accidentally left in with #20287. Yikes!

);
// todo(ft): solve for this case with collaborators who can't select projects directly
Copy link
Member Author

Choose a reason for hiding this comment

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

I'd love ideas around this: how can we not block collaborators if a repo they're working on gets imported twice? Or, in the very least, how do we educate members and owners about this possibility?

It's admittedly a case on the edge™, but IMO worth considering.

Copy link
Member Author

Choose a reason for hiding this comment

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

todo: file an issue for this

Copy link
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the meta: stale This issue/PR is stale and will be closed soon label Nov 21, 2024
@filiptronicek
Copy link
Member Author

filiptronicek commented Nov 22, 2024

It looks like activity-triggered prebuilds get into some weird state when triggered by collaborators. I'm investigating this

Copy link
Member

@geropl geropl left a comment

Choose a reason for hiding this comment

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

Concept and code LGTM ✔️

@roboquat roboquat merged commit e389b85 into main Nov 22, 2024
21 checks passed
@roboquat roboquat deleted the ft/collaborator-role-superpowers branch November 22, 2024 14:14
@@ -88,7 +88,7 @@ export const sortSuggestedRepositories = (repos: SuggestedRepositoryWithSorting[
uniqueRepositories = uniqueRepositories.map((repo) => {
if (repo.projectId && !repo.projectName) {
delete repo.projectId;
delete projectURLs[projectURLs.indexOf(repo.url)];
projectURLs = projectURLs.filter((url) => url !== repo.url);
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 deletion would not work properly when you had two repos with the same project URL. Because we're iterating over the unique repos, it would clean up only the first occurrence of the project URL, instead of cleaning up all of them, leaving an incorrect state in projectURLs.

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.

3 participants