Add the username of the current user to the HTTP(S) clone URL
What does this MR do?
Adds the Username portion to the HTTP(S) clone url of a Project.
Are there points in the code the reviewer needs to double check?
Why was this MR needed?
See #1937 (closed)
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
Changelog entry added -
Documentation created/updated -
API support added - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if it does - rebase it please) -
Squashed related commits together
What are the relevant issue numbers?
Closes #1937 (closed)
Merge request reports
Activity
added 1 commit
- 3f99cd42 - Add the username of the current user to the HTTP(S) clone URL
added 1 commit
- 995e66e6 - Add the username of the current user to the HTTP(S) clone URL
added 1 commit
- 1f1aed2b - Add the username of the current user to the HTTP(S) clone URL
marked the task Conform by the merge request performance guides as completed
marked the task Conform by the style guides as completed
marked the task Squashed related commits together as completed
- Resolved by Jan Christophersen
- Resolved by Jan Christophersen
- Resolved by Jan Christophersen
- Resolved by Rémy Coutable
@Rukenshia Thanks, I had a few suggestions, and I think we should actually change
Project#http_url_to_repo
to accept an optionaluser
.assigned to @Rukenshia
marked the task Changelog entry added as completed
added 1 commit
- 57d1ae12 - Add the username of the current user to the HTTP(S) clone URL
@rymai I changed all the points you mentioned. Please take another look :)
- Resolved by Jan Christophersen
- Resolved by Jan Christophersen
- Resolved by Jan Christophersen
- Resolved by Jan Christophersen
- Resolved by Rémy Coutable
- Resolved by Jan Christophersen
@rymai Thanks! I had a few more remarks!
added 1 commit
- 8580957e - Add the username of the current user to the HTTP(S) clone URL
assigned to @rymai
- Resolved by Jan Christophersen
- Resolved by Rémy Coutable
@Rukenshia Thanks, I had a few remarks.
assigned to @Rukenshia
fixed, @rymai.
added 1 commit
- 9c6943bb - Add the username of the current user to the HTTP(S) clone URL
changed milestone to %9.0
assigned to @rymai
enabled an automatic merge when the pipeline for 9c6943bb succeeds
@Rukenshia Thanks, looks good to me!
not sure why the build is failing @rymai, I already retried the two failing ones.
@Rukenshia I think the downtime check one should be solved by rebasing. For the spinach one, you should probably increase the CI timeout to 80 minutes (https://gitlab.com/Rukenshia/gitlab-ce/settings/ci_cd).
added 543 commits
-
9c6943bb...3589cc06 - 542 commits from branch
gitlab-org:master
- 150c3637 - Add the username of the current user to the HTTP(S) clone URL
-
9c6943bb...3589cc06 - 542 commits from branch
@rymai rebasing and increasing the timeout seems to have worked - thanks!
@Rukenshia Thanks!
mentioned in commit c425f366
Our usernames are mailadresses and with this merge request, the resulting url would be: https://username@mail.com@...
This is not a valid https/git url so please make it configurable if the username should be added to the clone url.
Thanks Jens
@rymai @jens.goldhammer would just escaping be an option? What other characters are allowed in GitLab usernames that could potentially cause an invalid url? I'd be happy to open a MR for this after we clarified this. Hiding the username would probably be better in that case I guess.
Edited by Jan Christophersen@jens.goldhammer I just tried it locally again and get the following error message when trying to create a User with '@' in his name:
@jens.goldhammer That's weird because we do clean usernames here: https://gitlab.com/gitlab-org/gitlab-ce/blob/e5bafed83714d2e96476446b9b2ebdebe3dffe35/lib/gitlab/o_auth/user.rb#L171
For instance:
[1] pry(main)> Namespace.clean_path('username@mail.com') Namespace Load (3.8ms) SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."deleted_at" IS NULL AND (lower(path) = 'username' OR lower(name) = 'username') ORDER BY "namespaces"."id" DESC LIMIT 1 => "username"
and we do save OAuth/LDAP users using
save!
(https://gitlab.com/gitlab-org/gitlab-ce/blob/e5bafed83714d2e96476446b9b2ebdebe3dffe35/lib/gitlab/o_auth/user.rb#L34) which means that validations are enforced and that characters such as@
would not be allowed anyway...@dblessing Since you have more knowledge about LDAP/AD than me, do you confirm it's not possible to have email-like usernames even when using Active Directory?
Maybe I am wrong. Our Login is the Mail adress, but username is without a Domain.
Example: Hallo.mueller@company.com for Login Hallo.mueller is username in gitlab...
For weblogin and git commands I have to use Hallo.mueller@company.com because Hallo.mueller dies not Work...
mentioned in issue #29685 (closed)
This seems to have unintended effects: https://gitlab.com/gitlab-org/gitlab-ce/issues/29856
mentioned in issue #30174 (closed)
mentioned in issue #30410 (closed)
mentioned in merge request !11792 (merged)