Skip to content
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

Deep fetch results in massive download #2579

Closed
stephen-strava opened this issue Nov 29, 2023 · 2 comments · Fixed by #2717
Closed

Deep fetch results in massive download #2579

stephen-strava opened this issue Nov 29, 2023 · 2 comments · Fixed by #2717

Comments

@stephen-strava
Copy link

Subject of the issue

My workflow is straightforward, containing this step:

      - name: Open PR
        uses: peter-evans/create-pull-request@v5
        with:
          branch: <branch>
          committer: <comiter>
          commit-message: <message>
          title: <title>
          body: <body>
          token: <token>

This workflow can run multiple times and force pushes; so it may update an existing branch/pr. When run, I see this line executed:

/usr/bin/git -c protocol.version=2 fetch --no-tags --progress --no-recurse-submodules --unshallow --force origin <my-repo>

After which a very large remote pull takes place, sometimes. This can lead to the run taking 2 minutes at the short version and up to 40 minutes in our case for the complete pull.

The thought is that perhaps this should be using --depth=1 in some cases (rather than --unshallow)

Looking at

args.push('--unshallow')

Which is called from
https://github.com/peter-evans/create-pull-request/blob/main/src/create-or-update-branch.ts#L189

The code in there is nuanced enough that it's not clear why we need to do a full fetch in the case that we are pushing to an existing PR.

Steps to reproduce

@peter-evans
Copy link
Owner

Hi @stephen-strava

I think I might have been using --unshallow unnecessarily for some fetches. I've made change and added it to the v6 release candidate. Please give it a try and let me know if it's an improvement. You can use it like this:

      - uses: peter-evans/create-pull-request@v6-rc

I'll be releasing v6 at some point in the near future.

@peter-evans
Copy link
Owner

I've now released v6. Thanks for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants