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

Link to user profile #7312

Merged
merged 1 commit into from
Dec 21, 2021
Merged

Link to user profile #7312

merged 1 commit into from
Dec 21, 2021

Conversation

laushinka
Copy link
Contributor

@laushinka laushinka commented Dec 20, 2021

Description

Links the profile of the user who already added a project.
The profile provider should match the repo provider.

UPDATED
Screenshot 2021-12-20 at 15 27 03

Related Issue(s)

Fixes #7310

How to test

  1. Have two different accounts using the same Git provider.
  2. Account A create a group/org and add projects/repos, and invite account B as member with write access.
  3. Account A adds project to Gitpod.
  4. Account B tries to add the project and should be shown the username of account A. This username should link to account A's profile on the Git provider website.

Release Notes

Profile of the user who already added a project is linked.

Documentation

@laushinka
Copy link
Contributor Author

This is still a draft. @jldec Please help test using your usecase.

@laushinka
Copy link
Contributor Author

laushinka commented Dec 20, 2021

/werft run

👍 started the job as gitpod-build-laushinka-link-username-7310.4

@laushinka
Copy link
Contributor Author

laushinka commented Dec 20, 2021

/werft run

👍 started the job as gitpod-build-laushinka-link-username-7310.6

@laushinka laushinka marked this pull request as ready for review December 20, 2021 14:15
@laushinka
Copy link
Contributor Author

Ready for that review and thumbs up! @jldec

@jldec
Copy link
Contributor

jldec commented Dec 20, 2021

@laushinka I think the code is not covering the specific case with 2 integrations each using a different user-id, which was mentioned in the issue:

Users with multiple integrations will be shown using the user-id of the first signup, which is not necessarily the user-id for the integration of the repo in question. E.g I used a different username for GitHub vs. GitLab and the "already added" message is showing my GitHub userid even though the repo is on GitLab.

To reproduce:

  1. create an account with 2 integrations (first GitHub then GitLab) using different user-ids
  2. create a project with a GitLab repo
  3. try to create a 2nd project on the same GitLab repo

The message will say

@user already
added this repo

where @user is the GitHub user-id.
The link will go to a wrong (on non-existent) user on GitLab

The link should either go to the repo-owner's user-id (owner) on GitLab, or to the user-id on GitHub from integration 1.

@laushinka
Copy link
Contributor Author

laushinka commented Dec 20, 2021

The link should either go to the repo-owner's user-id (owner) on GitLab, or to the user-id on GitHub from integration 1.

@jldec I managed to reproduce! Thanks for the steps and for catching it.

@roboquat roboquat added size/S and removed size/XS labels Dec 21, 2021
@laushinka
Copy link
Contributor Author

laushinka commented Dec 21, 2021

@jldec Fixed the bug by checking that the owner provider matches the repo provider. Please test and confirm 🙏🏽

@laushinka
Copy link
Contributor Author

laushinka commented Dec 21, 2021

/werft run with-clean-slate-deployment

👍 started the job as gitpod-build-laushinka-link-username-7310.10

Copy link
Contributor

@jldec jldec left a comment

Choose a reason for hiding this comment

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

Thanks @laushinka - looks good.

@roboquat
Copy link
Contributor

LGTM label has been added.

Git tree hash: 08afda6344f79eccaca4ed0305748a64f10a716e

@roboquat
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jldec

Associated issue: #7310

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

@roboquat roboquat merged commit 254a3c4 into main Dec 21, 2021
@roboquat roboquat deleted the laushinka/link-username-7310 branch December 21, 2021 14:12
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note size/S team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Link the username that added the project
3 participants