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

Mention username who added project in a team #5128

Merged
merged 1 commit into from
Dec 20, 2021

Conversation

gtsiolis
Copy link
Contributor

@gtsiolis gtsiolis commented Aug 9, 2021

What does this PR do?

This is using the existing structure for indicating already imported projects instead of the tooltip shown in the issue description, see #5119.

  1. Change the repository name color when it's not available to import.
  2. Add a placeholder for inserting the user who already added a project.

Fix #5119.

BEFORE AFTER
Screenshot 2021-08-10 at 12 39 36 AM Screenshot 2021-08-10 at 12 24 46 AM

@gtsiolis gtsiolis removed the request for review from svenefftinge August 9, 2021 21:32
@roboquat roboquat added size/M and removed size/XS labels Aug 11, 2021
@svenefftinge svenefftinge force-pushed the gt/mention-user-who-added-project branch from 4120068 to 96d2ae2 Compare August 11, 2021 12:56
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.

Many thanks! This looks like a good first pass to me 👍 I'm just a little worried about how convoluted our initial Teams & Projects code already is (re: multiple components variously enriching data one after the other).

I think a good approach to fix this would be to introduce good profiling, then identify which Teams & Projects features have the worst performance/UX impact (e.g. "fetching the list of repos is too slow"), and optimize these code paths in priority.

components/dashboard/src/projects/NewProject.tsx Outdated Show resolved Hide resolved
components/gitpod-protocol/src/gitpod-service.ts Outdated Show resolved Hide resolved
components/server/ee/src/workspace/gitpod-server-impl.ts Outdated Show resolved Hide resolved
Comment on lines 1474 to 1454
const owner = await this.userDB.findUserById(ownerId);
if (owner) {
repo.inUse = {
userId : owner.id,
userName: owner?.name || owner?.fullName || 'somebody'
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This entire for loop seems to add a few more DB queries to a code path that is already super slow (we already make users wait long seconds before showing anything in the UI).

I think this could possibly be optimized by refactoring projectsService.getProjectsByCloneUrls (only used here I believe), and making that method fetch & process everything required in one go, as opposed to multiple components variously enriching data one after the other.

However, please feel free to add this as a TODO comment in the code.

Copy link
Member

Choose a reason for hiding this comment

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

fully agree to this argument. it should be feasible to compute in db query.

@roboquat
Copy link
Contributor

LGTM label has been added.

Git tree hash: 298a3f517afcec1020e90c337f1a359fdbfd3fb4

@gtsiolis
Copy link
Contributor Author

gtsiolis commented Aug 12, 2021

Adding a few comments using github.dev.

Copy link
Contributor Author

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

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

Adding a few comments using github.dev.

components/dashboard/src/projects/NewProject.tsx Outdated Show resolved Hide resolved
components/gitpod-protocol/src/gitpod-service.ts Outdated Show resolved Hide resolved
@jankeromnes jankeromnes removed their assignment Sep 1, 2021
@gtsiolis gtsiolis added feature: teams and projects [DEPRECATED] Please, use feature: organizations or feature: projects labels instead. and removed 🧑‍🚀 crew: teams and projects labels Sep 14, 2021
@stale
Copy link

stale bot commented Sep 28, 2021

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.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label Sep 28, 2021
@stale stale bot closed this Oct 3, 2021
@gtsiolis
Copy link
Contributor Author

Re-opening for now as it could be still relevant. Cc @jldec

@gtsiolis gtsiolis reopened this Oct 20, 2021
@stale stale bot removed the meta: stale This issue/PR is stale and will be closed soon label Oct 20, 2021
@roboquat roboquat added the team: webapp Issue belongs to the WebApp team label Oct 20, 2021
@stale
Copy link

stale bot commented Oct 30, 2021

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.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label Oct 30, 2021
@JanKoehnlein JanKoehnlein removed the meta: stale This issue/PR is stale and will be closed soon label Nov 2, 2021
@AlexTugarev
Copy link
Member

AlexTugarev commented Dec 17, 2021

/werft run

👍 started the job as gitpod-build-gt-mention-user-who-added-project.13

@AlexTugarev AlexTugarev force-pushed the gt/mention-user-who-added-project branch from e4b4d6f to 0c39e4b Compare December 17, 2021 13:25
@AlexTugarev
Copy link
Member

AlexTugarev commented Dec 17, 2021

Thanks @laushinka for catching issue and helping testing!
We've just updated to fix an issue with project created in personal accounts. It should work now 👍🏻

@laushinka
Copy link
Contributor

/assign

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.

Looks good - thank you @AlexTugarev @laushinka @gtsiolis and team.

{!r.inUse ? (
<button className="primary" onClick={() => setSelectedRepo(r)}>Select</button>
) : (
<p className="my-auto">already taken</p>
<p className="text-gray-500 font-medium">
@{r.inUse.userName} already<br/>added this repo
Copy link
Contributor

Choose a reason for hiding this comment

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

Mentioning here for reference - No need to implement before merging this PR:
While I was testing today, I discovered a stronger reason for doing as @gtsiolis suggested. 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.

@roboquat
Copy link
Contributor

LGTM label has been added.

Git tree hash: 52f8e2bd42b68b02c09ae92dc38aa3580046d699

@laushinka
Copy link
Contributor

laushinka commented Dec 17, 2021

/werft run

👍 started the job as gitpod-build-gt-mention-user-who-added-project.16

@laushinka
Copy link
Contributor

laushinka commented Dec 19, 2021

/werft run

👍 started the job as gitpod-build-gt-mention-user-who-added-project.17

Co-authored-by: George Tsiolis <tsiolis.g@gmail.com>
Co-authored-by: Laurie T. Malau <laurie@gitpod.io>
Co-authored-by: Alex Tugarev <alex.tugarev@typefox.io>
@laushinka laushinka force-pushed the gt/mention-user-who-added-project branch from 04033cb to ed54059 Compare December 19, 2021 10:14
@roboquat roboquat removed the lgtm label Dec 19, 2021
@laushinka
Copy link
Contributor

laushinka commented Dec 19, 2021

/werft run with-clean-slate-deployment

👍 started the job as gitpod-build-gt-mention-user-who-added-project.19

@laushinka
Copy link
Contributor

laushinka commented Dec 19, 2021

@jldec The builds were failing but turns out with-clean-slate-deployment did the trick. You can lgtm again 🙏🏽 The push I did was just a rebase.

@jldec
Copy link
Contributor

jldec commented Dec 20, 2021

/lgtm

@roboquat roboquat added the lgtm label Dec 20, 2021
@roboquat
Copy link
Contributor

LGTM label has been added.

Git tree hash: 8e0fa246a36ccfc39e1d4c55f2c727a050a282ab

@roboquat
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Foge9627, jankeromnes, jldec

Associated issue: #5119

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 556c03c into main Dec 20, 2021
@roboquat roboquat deleted the gt/mention-user-who-added-project branch December 20, 2021 08:16
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved component: dashboard deployed: webapp Meta team change is running in production deployed Change is completely running in production feature: teams and projects [DEPRECATED] Please, use feature: organizations or feature: projects labels instead. meta: never-stale This issue can never become stale size/M team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mention the user who already imported the repository as a project
9 participants