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

Use source api endpoint in gitlab client for using self host gitlab #555

Merged
merged 1 commit into from
Jun 27, 2018

Conversation

codisart
Copy link
Contributor

@codisart codisart commented Jun 27, 2018

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.

@codisart codisart force-pushed the gitlab-alternative-hostname branch from f24c3d9 to 811a717 Compare June 27, 2018 11:48
@@ -344,7 +344,7 @@ def gitlab_client

@gitlab_client ||=
Gitlab.client(
endpoint: "https://gitlab.com/api/v4",
endpoint: source.api_endpoint,
Copy link
Contributor

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.

Copy link
Contributor Author

@codisart codisart Jun 27, 2018

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 ?

Copy link
Contributor

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.

Copy link
Contributor Author

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 ?

Copy link
Contributor

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,
Copy link
Contributor

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,
Copy link
Contributor

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.

@greysteil
Copy link
Contributor

👍 after the changes to the metadata classes. Thanks for this, and apologies you had trouble getting the script running!

@greysteil
Copy link
Contributor

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?

@codisart
Copy link
Contributor Author

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 ! 😄
For the username, I will try something before the end the week .

@codisart codisart force-pushed the gitlab-alternative-hostname branch from 811a717 to 7630287 Compare June 27, 2018 13:46
@greysteil
Copy link
Contributor

👍 👍. Failing spec is because I've got the wrong default for the GitLab API URL - will get this merged and fix that on master. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants