-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Use source api endpoint in gitlab client for using self host gitlab #555
Use source api endpoint in gitlab client for using self host gitlab #555
Conversation
f24c3d9
to
811a717
Compare
@@ -344,7 +344,7 @@ def gitlab_client | |||
|
|||
@gitlab_client ||= | |||
Gitlab.client( | |||
endpoint: "https://gitlab.com/api/v4", | |||
endpoint: source.api_endpoint, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You want to leave this one as https://gitlab.com/api/v4
- it's used for looking up the changelog of libraries from the hosted gitlab.com instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so the access token is not necessary ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for this endpoint - it's a nice to have but not required. At some point I'll add the ability for Dependabot to do metadata lookup from self-hosted sources (GitHub Enterprise as well as GitLab), but for now it just does it from the central ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok because I was thinking of adding a factory for the gitlab client to avoid "shotgun surgeries". Maybe we can add two one for the self host and one other for the gitlab.com. What do you think ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get this merged first, so that the script works with self-hosted GitLab instances at all?
After that, I'm 👍 on adding the ability to lookup changelogs, commit diffs and release notes from self-hosted GitLab instances in theory, although in practice I think it's going to be a pretty rare situation - it will only affect private libraries (anything public is likely to be hosted on a central instance), and even then the only current affect is that they won't have changelog links etc., in the PRs.
@@ -219,7 +219,7 @@ def gitlab_client | |||
|
|||
@gitlab_client ||= | |||
Gitlab.client( | |||
endpoint: "https://gitlab.com/api/v4", | |||
endpoint: source.api_endpoint, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, this one wants to stay https://gitlab.com/api/v4
.
@@ -223,7 +223,7 @@ def gitlab_client | |||
|
|||
@gitlab_client ||= | |||
Gitlab.client( | |||
endpoint: "https://gitlab.com/api/v4", | |||
endpoint: source.api_endpoint, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, this one wants to stay https://gitlab.com/api/v4.
👍 after the changes to the metadata classes. Thanks for this, and apologies you had trouble getting the script running! |
Also, to get you back on master, you should be able to use your GitLab username combined with a personal access token - can you give that a try? |
No need to apologise, I'm already amazed by the work dependabot did between our discussion in april and now. And there always need for alpha testing ! 😄 |
811a717
to
7630287
Compare
👍 👍. Failing spec is because I've got the wrong default for the GitLab API URL - will get this merged and fix that on master. 🎉 |
Hello @greysteil,
As we already discussed, we are very interested by your project.
But we use gitlab selfhosted, so we were waiting for the implementation of gitlab.
I discovered your project dependabot\dependabot-script and we tried to use it.
We got a lot of snafu but we got it at the end.
But to be able to make it work, we add to make some little changes. Here they are. Maybe it can be of some help.
You will maybe see that we didn't leave from master. There is a very good reason for that ! 😄
We working on php/composer projects and we add a fatal yesterday due to this very recent commit on master : 319b92a
Since we are on gitlab, we got no username to use for these credentials.
Maybe we can try to find a way to make it work.