-
-
Notifications
You must be signed in to change notification settings - Fork 395
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
Don't require a deep fetch for forks #2847
Comments
I was just searching through this repo briefly and I wonder if this comment is related? |
Hi @infinisil
I think you might be right. It seems to be working now without doing the fetch with Thank you for pointing it out! I'll release a fix for this. |
Released as Thank you! |
@infinisil Just saw your comment here: #2849 (comment) This fix did actually address your original issue, but now the problem has shifted to the later I have an idea to fix it. I'll experiment with it next week. |
@infinisil, would you be willing to test a new version of the action before I release it? It's not easy for me to test this with a real-world case like yours. I've made a change to limit the fetch depth when fetching the pull request branch. You can try the new version like this: uses: peter-evans/create-pull-request@branch-fetch-depth |
Sure! Just did, and it seems to work: https://github.com/NixOS/nixpkgs-check-by-name/actions/runs/8707862728/job/23883876037 ✨ (tweag/nixpkgs#91, this is a PR from a fork to another fork, but I don't think that would influence the result) |
Thanks for testing, but this isn't doing the same as your original run here: https://github.com/NixOS/nixpkgs-check-by-name/actions/runs/8633608062/job/23667098826 The PR branch needs to exist before the action runs. Otherwise the fetch just fails and it creates a new branch. The perf problem comes when the branch exists and the fetch pulls all the history for the PR branch. So please keep |
Ah good point, I now updated the fork to PR against and reran the action, looks like that also works: https://github.com/NixOS/nixpkgs-check-by-name/actions/runs/8707862728/job/23892105339 |
Looks good! Down to 15 seconds from 10 minutes. Thank you for testing it. I'm slightly nervous about releasing this because there is a possibility that someone is using the action in a way that I've not anticipated and this update clobbers their workflow. So just be aware that I might need to roll this back if it causes some issue for a lot of users. I think it will be a rare edge case if it causes any problem at all. |
Released as |
Sounds good, no worries, thanks a lot for the quick fix! |
Subject of the issue
Currently this action always performs a deep fetch of the repository, but that doesn't seem to be required, at least anymore (could a GitHub server update make this be possible suddenly?).
Here's a demo where I clone shallowly from the original repo (https://github.com/nixos/nixpkgs/ in this case, which is pretty big), make a commit, and push the result to my fork at https://github.com/infinisil/nixpkgs (which exists already, but it's not up-to-date with the original repo), which takes only a couple seconds:
Not doing this leads to having to wait 10 minutes for the action to complete in this case, e.g. https://github.com/NixOS/nixpkgs-check-by-name/actions/runs/8633608062/job/23667098826. And pushing to a fork is required in this case.
Related issues:
shallow update not allowed
#1303The text was updated successfully, but these errors were encountered: