-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
.github/workflows/editorconfig.yml: Don't use GitHub API for PR diff. #147625
Conversation
This comment has been minimized.
This comment has been minimized.
Can you list some PRs where this happened?
What about testing some large PRs? |
#147608 see https://github.com/NixOS/nixpkgs/runs/4342305588?check_suite_focus=true though we're not sure if the ratelimit is caused by the editorconfig specifically. It seems like it does quite a few requests though.
Will do when github is more responsive. Need to do this on a fork as you need the updated workflow files and it's really annoying. |
Also #146798 https://github.com/NixOS/nixpkgs/runs/4275079944?check_suite_focus=true |
mohe2015#14 is a test of a big formatting PR. I also fixed a second bug - namely that the argument list got too big (the github action environment variable actually). |
What about PRs with only deleted file(s)? The |
New tests at mohe2015#16 and mohe2015#17 and mohe2015#18 Diff between base is just the if deleted mohe2015/nixpkgs@editorconfig-prevent-ratelimits...mohe2015:editorconfig-prevent-ratelimits-base |
Should be fixed by |
So I should switch back to the "pipe a file" method? So it's And should I use a shorter input file name? Unfortunately there doesn't even seem to be any documentation which files are persisted between steps. Also I should probably use the shorthand Feel free to push that change to this branch - I will maybe be able to do this tomorrow but not sure. Also thank you for the nice reviews. |
|
This caused ratelimits for large PRs (reformatting PRs)
51fc053
to
a6e4931
Compare
@zowoq done the requested change and updated the test PRs |
Thanks @mohe2015! |
Some failures due to at least renames. Could be also reversed to exclude at least deleted and renamed: |
I was wondering how long it would take until something breaks ... |
Do we maybe have to compare the filelist of the current |
These sorts of problems is why I switched to using the simpler github API. I think if we're going to try this again it will need to be tested much more prior to merging so we don't unnecessarily annoy other contributors. |
Now I see :D
I was not awake at merge time otherwise I would've looked too. But it seems like you resolved it pretty quickly. There is really bad documentation on which of the branches is what at which time (e.g. does the base branch get updated on check run or when?) etc. I was just testing a bit and I think pretty weird shit happens additionally: The base branch of mohe2015#21 only contains mohe2015@a6e4931 but to me it seems like it cat's the changed_files file in https://github.com/mohe2015/nixpkgs/runs/4374828551?check_suite_focus=true although I only added that change in a different branch. Maybe I'm looking wrong but to me this looks incorrect. (The output is interleaved for some reason) I'm pretty sure though I found a mistake I just need to find out how to fix it. Also annoying to run the checks as you have to rebase and push and stuff. |
Ohh nice github, clicking the "View workflow file" shows a totally different workflow which doesn't contain the "-r" yet |
Yes, this time. I spent more time than I care to think about testing it and then monitoring it for months after if was merged to ensure it worked reliably. |
I appreciate that you're taking the time to try and fix this but giving how rarely the actual problem that you want to resolve occurs (API issues caused by massive PRs) another attempt is going to need to be tested very thoroughly before I would be willing to merge it. |
What is the reason we don't just fix all editorconfig issues in this repository and then just always check all files? As far as I remember there weren't too many |
The better solution is probably to add a [CI skip] check and call it a day |
Yeah, this would be easier but we don't want to start failing every PR because one bit of whitespace slipped in, e.g because it was pushed straight to master or reintroduced via a reverted PR. We may be able to do this in the future (required checks, protected branches, merge bots, etc) but I don't see that it is feasible at the moment.
This would likely be easier to do. IIRC Github handles it automatically for If you like I'm happy to do it myself but I probably won't get around to it for a few days. |
That would be great! Thanks again for all the help. |
No problem, thanks anyway for you work on this. I'll try to reuse the
As this only needs to be implemented for the Using a label may also be possible but it's probably not a good idea as it would need to be applied before the PR is opened to avoid the API issue. |
May as well do this separately in case the PR: #148099 |
I think this will likely be the easiest option: diff --git a/.github/workflows/editorconfig.yml b/.github/workflows/editorconfig.yml
index 01a6d736c13..f7c96a7dd20 100644
--- a/.github/workflows/editorconfig.yml
+++ b/.github/workflows/editorconfig.yml
@@ -11,7 +11,7 @@ on:
jobs:
tests:
runs-on: ubuntu-latest
- if: github.repository_owner == 'NixOS'
+ if: "github.repository_owner == 'NixOS' && !contains(github.event.pull_request.title, '[skip editorconfig]')"
steps:
- name: Get list of changed files from PR
env: Checking commit messages becomes complicated when there is more than one commit unless we require that the Also for git history it may be better to avoid cluttering commit messages with CI directives? |
PR: #148327 |
This caused ratelimits for large PRs (reformatting PRs)
Motivation for this change
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes