Skip to content

Project URL is not slugified for GitLab repos #5847

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

Closed
bigint opened this issue Sep 24, 2021 · 11 comments · Fixed by #6376
Closed

Project URL is not slugified for GitLab repos #5847

bigint opened this issue Sep 24, 2021 · 11 comments · Fixed by #6376
Assignees
Labels
component: dashboard feature: teams and projects [DEPRECATED] Please, use feature: organizations or feature: projects labels instead. groundwork: in progress team: webapp Issue belongs to the WebApp team type: improvement Improves an existing feature or existing code

Comments

@bigint
Copy link

bigint commented Sep 24, 2021

Bug description

image

Here is how the URL looks like https://gitpod.io/projects/Timesheet%20Remainder

Steps to reproduce

  • Create new GitLab Repo with the name Gitpod Test
  • Connect it to Gitpod projects
  • Open the project and check the URL

Expected behavior

https://gitpod.io/projects/timesheet-remainder

It should take the GitLab repo slug instead of the name

@bigint
Copy link
Author

bigint commented Sep 24, 2021

/cc @gtsiolis the GitLab expert 😄

@gtsiolis gtsiolis added component: dashboard feature: teams and projects [DEPRECATED] Please, use feature: organizations or feature: projects labels instead. team: webapp Issue belongs to the WebApp team type: improvement Improves an existing feature or existing code labels Sep 28, 2021
@gtsiolis
Copy link
Contributor

Thanks for bringing this up @bigint! This makes sense!

Looping in @jankeromnes and @AlexTugarev who also brought up this issue in a recent discussion (internal).

@jankeromnes
Copy link
Contributor

jankeromnes commented Sep 28, 2021

Nice catch! Thanks for reporting this @bigint (and thanks @gtsiolis for pointing me to it when I also complained about this 😁).

I believe the current situation is:

  • There is only project.name, which is used in URLs and displayed in the UI
  • For GitHub projects, we import the slug as project.name
  • For GitLab projects, we import the full-text name as project.name

Instead, it would be better to:

  • Have a (new) specific project.slug property for URLs (similar to team.slug) in addition to the existing project.name (which can be all nice with capital letters, spaces, varied characters, etc)
  • For GitHub projects, import both the slug and the full-text name
  • Same as above for GitLab

@JanKoehnlein
Copy link
Contributor

I think this is not needed for the launch. Let's bring this up later

@JanKoehnlein
Copy link
Contributor

/schedule

@roboquat
Copy link
Contributor

@JanKoehnlein: Issue scheduled in the meta team (WIP: 0)

In response to this:

/schedule

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.

@laushinka
Copy link
Contributor

/assign

@laushinka
Copy link
Contributor

Have to /unassign for now to prioritize another ticket

@laushinka
Copy link
Contributor

/assign

@laushinka
Copy link
Contributor

laushinka commented Oct 24, 2021

The associated PR makes use of the path attribute provided by the GitLab API, where it gets added to the new slug column during project creation. For GitHub projects, the slug column is populated according to the name column, since it is already slugified.

However, the solution does not tackle existing GitLab projects. There are three options I can think of:

  1. Import it from GitLab and populate the slug column (I don't know whether this is possible or how)
  2. Populate the slug column by running a migration to replace the special characters. I'm not sure this would be a good solution, but maybe not a bad one either since essentially we're replacing spaces with dashes. Probably something like REGEXP_REPLACE(" ", "-")?
  3. Leave the existing projects be. In the PR, existing GitLab projects will have NULL in the slug column, and the name column will be used instead, which is the current situation.

The reason why the string replacement can't happen in the frontend is because the Project page looks up the project repo using the url path, to find the matching project.

Thoughts?

@gtsiolis gtsiolis moved this to Next iteration 🛹 in 🍊 Feature: Teams & Projects Oct 26, 2021
laushinka pushed a commit that referenced this issue Nov 1, 2021
laushinka pushed a commit that referenced this issue Nov 1, 2021
roboquat pushed a commit that referenced this issue Nov 2, 2021
@jldec jldec moved this to In Groundwork in 🍎 WebApp Team Nov 4, 2021
@jldec
Copy link
Contributor

jldec commented Nov 7, 2021

see #6376 (comment) regarding why we are not fixing the slugs for existing GitLab repos at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: dashboard feature: teams and projects [DEPRECATED] Please, use feature: organizations or feature: projects labels instead. groundwork: in progress team: webapp Issue belongs to the WebApp team type: improvement Improves an existing feature or existing code
Projects
Archived in project
Status: Next iteration 🛹
Development

Successfully merging a pull request may close this issue.

7 participants