-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[stubsabot] Support diff analysis for GitLab hosted projects #14542
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
Conversation
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Thanks for the review! I've incorporated your suggestions (I re-tested the latest commit locally; |
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.
Thanks, looks mostly good, remarks below.
I definitely don't want to block this PR, especially now that you've already done the work -- but just for reference, we previously discussed doing something like this in #9792. I'm a bit wary of adding too much complexity to this script, given that it doesn't have any tests; we need to balance the benefits changes like this have with the maintenance burden of the stubsabot script itself. |
For me, the benefits of this PR greatly outweigh the maintenance burden. Whenever a Gitlab hosted package changes, I need to relearn how to do diffs in Gitlab. IIRC, the last time I even cloned the repository and then did a local diff, since this was faster than finding the relevant function in Gitlab. |
Sounds good! |
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Currently, stubsabot only does diff analysis for GitHub hosted projects. Typeshed has a few third-party stubs whose upstream projects are hosted on GitLab. It would be nice if stubsabot could do diff analysis for those too (having a "diff" URL in the PR body is especially handy).
Apparently GitLab has a REST API that works pretty similarly to GitHub's. It also doesn't appear to require an access token (at least for the
/projects/:id
endpoint, which is all this would need to use). I took a stab at updating stubsabot to use this API in a way that mirrors the current GitHub API use. It turned out to be pretty straightforward. This makes stubsabot do roughly the same diff analysis for GitLab projects that it does for GitHub projects, including adding a convenient diff URL to the PR body.I tested this locally by downgrading one of the GitLab stubs (python-crontab) and then running
python3 scripts/stubsabot.py --action-level local python-crontab
. It seems to be working well. This is the commit message was generated:[stubsabot] Bump python-crontab to 3.3.*