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 projects of self-managed GitLab instances #7125

Merged
merged 3 commits into from
Dec 9, 2021

Conversation

AlexTugarev
Copy link
Member

@AlexTugarev AlexTugarev commented Dec 8, 2021

This change allows to create projects based on repositories of self-managed GitLab instances.

how to test

  1. setup a team; setup an application on a self-managed GitLab (internal: gitlab.gitlab.gitpod.io); setup a Git Integration and authorize.
  2. create a new project: go to the wizard, hit Select Git Provider, select the authorized GitLab provider, choose repository (from a group, otherwise it always lands in your account, but we want to have it in the team), and create a project.

Screen Shot 2021-12-08 at 15 39 44

2. using another team member's account, navigate to the created project and see the option to authorize with the provider of the self-managed GitLab instance.

Screen Shot 2021-12-08 at 15 46 11

Resolves #5115

Enable self-managed GitLab instances for Teams & Projects

@laushinka
Copy link
Contributor

Tested it and documented in this thread. Works well! Some follow-up issues are documented in the thread too.
I will look at the code now.

@laushinka
Copy link
Contributor

This looks good to me! Approving while waiting for @gtsiolis' review.
/approve

@AlexTugarev
Copy link
Member Author

@gtsiolis, please help me with the GIt Provder selection

Screen Shot 2021-12-09 at 08 55 45

@AlexTugarev AlexTugarev marked this pull request as ready for review December 9, 2021 08:17
@laushinka
Copy link
Contributor

laushinka commented Dec 9, 2021

@AlexTugarev I added a unit test for the remoteURL parsing if that's okay with you? Sorry didn't mean to hijack, but I didn't want to take too much time from your hands. Let me know if it looks okay 🙏🏽

@gtsiolis
Copy link
Contributor

gtsiolis commented Dec 9, 2021

Looking at this now! 👀

@gtsiolis
Copy link
Contributor

gtsiolis commented Dec 9, 2021

OK, really looking at this now! 😇

Copy link
Contributor

@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.

@AlexTugarev Flawless! 🧙

issue(non-blocking): There's on more edge case when users don't have any access to the linked repository but this is certainly out of the scope of this PR and can be tackled in a future iteration. These users even after authorizing with the self hosted GitLab instance they run into empty Branches and Prebuilds page and opening a workspace leads to an error. Added #7159 to track this.

Let's merge this! 💯

import { toRemoteURL } from './render-utils'

test('parse clone URL', () => {
expect(toRemoteURL("https://gitlab.com/laushinka/my-node-project")).toEqual("gitlab.com/laushinka/my-node-project");
Copy link
Contributor

Choose a reason for hiding this comment

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

praise: Thank you for adding thesse tests here, @AlexTugarev! 🌟

return (
<div className="mt-8 border rounded-t-xl border-gray-100 dark:border-gray-800 flex-col">
<div className="p-6 p-b-0">
<div className="text-center text-gray-500">
Select a Git provider first and continue with your repositories.
</div>
<div className="mt-6 flex flex-col space-y-3 items-center pb-8">
{authProviders.map(ap => {
{filteredProviders().map(ap => {
return (
<button key={"button" + ap.host} className="btn-login flex-none w-56 h-10 p-0 inline-flex" onClick={() => selectProvider(ap)}>
Copy link
Contributor

Choose a reason for hiding this comment

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

thought: Regarding the button label mentioned in #7125 (comment), I think it's ok to ship this as is as this will probably get better also with #7061.

@@ -295,7 +300,7 @@ export default function NewProject() {
const showSearchInput = !!repoSearchFilter || filteredRepos.length > 0;

const renderRepos = () => (<>
{!isBitbucket() && <p className="text-gray-500 text-center text-base">Select a Git repository on <strong>{provider}</strong>. (<a className="gp-link cursor-pointer" onClick={() => setShowGitProviders(true)}>change</a>)</p>}
{!isBitbucket() && <p className="text-gray-500 text-center text-base">Select a Git repository on <strong>{selectedProviderHost}</strong>. (<a className="gp-link cursor-pointer" onClick={() => setShowGitProviders(true)}>change</a>)</p>}
<div className={`mt-10 border rounded-xl border-gray-100 dark:border-gray-800 flex-col`}>
<div className="px-8 pt-8 flex flex-col space-y-2" data-analytics='{"label":"Identity"}'>
<ContextMenu classes="w-full left-0 cursor-pointer" menuEntries={getDropDownEntries(accounts)}>
Copy link
Contributor

Choose a reason for hiding this comment

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

issue(non-blockIng): Cross-posting #5330 for the missing group avatars for visibility which is certainly out of the scope of this PR. Cc @laushinka @jldec

@roboquat
Copy link
Contributor

roboquat commented Dec 9, 2021

LGTM label has been added.

Git tree hash: 317494af9fd1d479afc83c23dbcc15d6965c03a7

@roboquat
Copy link
Contributor

roboquat commented Dec 9, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gtsiolis, laushinka

Associated issue: #5115

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 d5020bc into main Dec 9, 2021
@roboquat roboquat deleted the at/gitlab-self-hosted branch December 9, 2021 20:10
@roboquat roboquat added the deployed: webapp Meta team change is running in production label Dec 14, 2021
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/M team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow users to add projects in teams from self hosted GitLab providers
4 participants