-
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
Fetching GitLab repo contents correctly uses the ref argument #7351
Fetching GitLab repo contents correctly uses the ref argument #7351
Conversation
a07f879
to
a35fd73
Compare
Mind having a look into this? |
The change looks good to me, we have some internal stability work that the team is prioritizing so I'll need to hold off merging this for a bit. One thing that I would love to see is some sort of test that would catch this in the future. |
a35fd73
to
df059fb
Compare
Will try to have a look into adding tests, Im not really proficient with ruby |
df059fb
to
4a49493
Compare
4a49493
to
8062d1e
Compare
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.
While a test would be nice, I'm personally okay shipping this as-is w/o any tests because the impact of a regression is relatively small:
- Won't impact our cloud service at GitHub at all
- Impact for GitLab users is primarily when their testing on a branch other than
main
- It clearly hasn't been a blocker for folks so far, so it's more of a nice-to-have
- The Gitlab PR creator is very much community maintained.
- Long term, we may eventually move away from Ruby-based PR creators to instead doing something with the CLI where it takes job output and has pluggable PR creators... that's a ways off, but it seems reasonable this code may not live forever.
Anyway, all that to say, I think this is fine to ship. If a teammate comes along and feels differently, then I can try to add a test if needed.
Thanks for tracking it down.
…ot#7351) Dependabot can't properly list GitLab repo contents on a given branch/commit. This is problematic when you are, for example, testing dependabot config and the requirements files are not present on the main repository branch, but on the changed branch only. In such case, dependabot won't see expected requirements, resulting in `Dependabot::DependencyFileNotFound`. # Context According to the GitLab API (https://docs.gitlab.com/ee/api/repositories.html#list-repository-tree), you have to use the `ref` argument to list the repository at a given commit/branch. The GitLab client blindly passes all the arguments to the API itself, including the `ref_name` argument. GitLab ignores extra GET parameters, thus it wasn't erroring out.
Dependabot can properly list GitLab repo contents on a given branch/commit.
This is problematic when you are, for example, testing dependabot config and the requirements files are not present on the main repository branch, but on the changed branch only. In such case, dependabot won't see expected requirements, resulting in
Dependabot::DependencyFileNotFound
.Context
According to the GitLab API (https://docs.gitlab.com/ee/api/repositories.html#list-repository-tree), you have to use the
ref
argument to list the repository at a given commit/branch.The GitLab client blindly passes all the arguments to the API itself, including the
ref_name
argument. GitLab ignores extra GET parameters, thus it wasn't erroring out.