gccrs icon indicating copy to clipboard operation
gccrs copied to clipboard

Issues with the GNU Commit Format Checker

Open tschwinge opened this issue 2 years ago • 4 comments

With https://github.com/Rust-GCC/gccrs/pull/1850 (but not specific to that one, I would assume) I've observed some issues with the "GNU Commit Format Checker": https://github.com/Rust-GCC/gccrs/actions/runs/4164987612/usage.

The check-changelogs and check-commit-signoff jobs take more than seven minutes, each. That seems a very long time (for what they're doing)? Most of the time is spent in Run actions/checkout@v3. Is that normal?

The check-gccrs-prefix job very quick to execute, but just prints: fatal: not a git repository (or any of the parent directories): .git (but still exits successfully?), so something's wrong there, too.

tschwinge avatar Feb 13 '23 15:02 tschwinge

It looks like the github checkout action doesn't support checking out a dynamic range of comments - just all/n comments deep. Ideally, we would perform a shallow checkout of all comments not reachable from master. Not sure what's up with check-gccrs-prefix though.

powerboat9 avatar Feb 13 '23 23:02 powerboat9

@tschwinge the checkout action does take a lot of time and I'm not sure why. We do the following:

      - uses: actions/checkout@v3
        with:
          ref: ${{ github.event.pull_request.head.sha }}
          fetch-depth: 0

instead of simply

    steps:
    - uses: actions/checkout@v3

as we do in the other workflows. I'm not sure why haha.

Regarding the check-gccrs-prefix, yes it's broken. It doesn't run on PRs to master, just on PRs to gcc-patch-dev. I assumed the check for the gcc-patch-dev branch during checkout would stop the entire job, but apparently it just stops one step:

      - uses: actions/checkout@v3
        if: ${{ github.base_ref == 'gcc-patch-dev' }} # master commits don't need the gccrs prefix

then, in the following step, it sets the retval to 0, tries to loop over commits, fails to get commits, and then exit retval. Which is also why I didn't notice it was broken in the first place :D

The list of things to do is thus as follows:

  • [ ] Investigate using simply actions/checkout@v3 without the extra ref as I'm not sure it does what we need
  • [ ] Add proper handling for PRs to gcc-patch-dev in the check-gccrs-prefix job

CohenArthur avatar Feb 14 '23 10:02 CohenArthur

fetch-depth defaults to 1, which would only fetch the most recent comment. That works well for build tests, since only the most recent comment has to be checked, but doesn't work well when we need all comments in a pull request. It looks like we could do something involving partial clones:

https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ https://git-scm.com/docs/partial-clone

It looks like the github checkout action doesn't support it yet:

https://github.com/actions/checkout/issues/1152

powerboat9 avatar Feb 14 '23 20:02 powerboat9

https://github.com/actions/checkout/pull/680

powerboat9 avatar Feb 14 '23 20:02 powerboat9