-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Gitlab credentials are not formatted properly when "gitlab" is not part of the URL #16836
Comments
hi @svenrdz - thank you for the issue! any chance you have an MRE for this to make it easier to implement a fix? |
Hi @zzstoatzz, here is a way to reproduce the issue using a simple function that mocks gitlab's behaviour of rejecting a clone without I apologize in advance as this is probably quite far from minimal, but it reproduces the issue as I found it in a real setup. I've uploaded the files on this repo: https://github.com/svenrdz/prefect-gitlab-issue-mre
|
Bug summary
I have been using
GitlabCredentials
blocks with a git-based deployments, and that has always worked fine. Today, I ran into an error at the git_clone pull step, with a very cryptic code 128 error from git. The main difference was the gitlab instance that I tried using today, which is a self-hosted one that looks likegit.server.fr
, where previously, I was using one that looked likegitlab.server.fr
.The new one does not contain the full string "gitlab", so I believe the function
prefect.runner.storage:_format_token_from_credentials
is not prefixing my access token withoauth2:
as it should for gitlab repos.For the time being, I am simply going to prefix my gitlab tokens with
oauth2:
to be safe.It would probably make sense for
_format_token_from_credentials
to take into account the type of the block used, as it currently only guesses what to do based on thenetloc
of the Gitlab URL.Version info
Additional context
No response
The text was updated successfully, but these errors were encountered: