mergeable
mergeable copied to clipboard
Github API error occurring
I'm in the middle of configuring mergeable for our whole organization when I realized something interesting happening:
Every once in a while mergeable fails to fetch the already existing mergeable.yml file and reports it as a Github API error.
When this happens it does not try to fetch the mergeable file again. Then it start working again on the following pull requests after one randomly fails.
this is what it reports back:
this makes mergeable behave unreliably at times when it encounters that Github API error there is nothing you can do to make it re-try to fetch that file. I was wondering if a "retry on Github API error" method you guys could implement to fix this?
in contrast to when it actually cant find the file because it doesn't exist it repots back this error
might be related to this: https://github.com/mergeability/mergeable/pull/213 I see a new error message created for this problem but nothing indicating a re-try if this error occurred
A fetch retry is a potential solution.
However, a 404 from GH API may also be a permission problem
Would like to better understand the situation:
- Is this happening in private or public repos?
- Do the PR that is failing contain a mergeable.yml as part of it's modifications?
Thanks in advance.
So I ran into this today which might shine some light onto the issue, let me know if you want me to open my own issue.
In my scenario, we are running v2.5.0, the .github
directory didn't exist in the project (private repo), however the thought was it would inherit the mergeable config from the organization. When it tried to run, I got the above invalid configuration issue.
My workaround was to add the .github
directory to the 30 or so repos using a .keep file in it to be able to push it. I'm not sure if this is intended behavior as the .mergeable.yml
file still doesn't actually exist. Ideally a 404 on this would allow it to continue processing using the rules that came from the organization level.
@wwsean08 I don't think the root of this issue is as you described. The current priority of which the config file to use is PR (if it is in the modified file list) -> Repo -> Org. Most of the time, we have seen this to work properly. On rare occasion, we get this type of error and we had a hard time replicating it. Were you able to replicate the error? If so, can you let us know the steps to replicate it?
I personally think the problem could be this line https://github.com/mergeability/mergeable/blob/f7f037b3a104b955c6d09e7bae7f72374e727679/lib/configuration/configuration.js#L143
QQ: does this happened when you had mergeable.yml in the PR?
I can try and replicate the error tomorrow, but the repo did not have a mergeable.yml
in either the PR when it was opened or the repo itself. We never added a mergeable.yml
to the PR because it seemed to work once we added a .github
directory to the PR on a wild guess given that we have many repos that don't have mergeable.yml
files that are working fine inheriting the config from the organization.
It could have been a one-off fluke as we were just enabling that repo to use mergeable for all I know, but that's just how we saw it work, PR opened that didn't contain a .github
directory at all, we get the error in the screenshot above, add a .github
directory even without the mergeable.yml
and it ran the validators from the organization.
I'll work to create a public reproduction seeing as it was done on a private repo I can't really show it.
Ok turns out you were right, adding a .github
directory didn't fix it, it was just a fluke, and that on change it caused the app to run again and just not hit this issue.
So looking at the code a bit, I don't think that the line you outlined is the problem we are hitting (though it certainly could be for others) in that the mergeable.yml
file is not in the change set, so it shouldn't enter that if statement (assuming Configuration.FILE_NAME
is the mergeable config file like I assume).
Most likely we are hitting it at line 170, https://github.com/mergeability/mergeable/blob/f7f037b3a104b955c6d09e7bae7f72374e727679/lib/configuration/configuration.js#L170 given we would be running against the org level config if there is no mergeable config in the repo (like there wasn't in our case). Given the difficulty in reproducing this I am going to try to setup a proxy where I can control the responses from github and induce the errors to validate my theory as that's the best idea I have to reproduce this issue.
This is happening with our private Repos as well and is happening more often these days
We have been using Mergeable for over a year now.
we also just got this error, didn't change anything in .yml file
UPDATE: It was due to title being a bit large for mergeable, although it wasn't that large.
This just happened here: https://github.com/deltachat/deltachat-core-rust/pull/3026/checks?check_run_id=4990928812
It's a public repository, branch is named clippy-cast_lossless
, maybe -
or _
is the issue.
PR https://github.com/deltachat/deltachat-core-rust/pull/3026/ does not change Mergeable configuration and configuration is already there on the underlying branch.