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

Issues with the GNU Commit Format Checker #1853

Open
tschwinge opened this issue Feb 13, 2023 · 4 comments
Open

Issues with the GNU Commit Format Checker #1853

tschwinge opened this issue Feb 13, 2023 · 4 comments
Labels
changelog Issue regarding GCC ChangeLog entries CI upstream Issue regarding upstreaming gccrs into GCC

Comments

@tschwinge
Copy link
Member

With #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.

@powerboat9
Copy link
Contributor

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.

@CohenArthur
Copy link
Member

@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 CohenArthur added CI upstream Issue regarding upstreaming gccrs into GCC changelog Issue regarding GCC ChangeLog entries labels Feb 14, 2023
@powerboat9
Copy link
Contributor

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:

actions/checkout#1152

@powerboat9
Copy link
Contributor

actions/checkout#680

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog Issue regarding GCC ChangeLog entries CI upstream Issue regarding upstreaming gccrs into GCC
Projects
Status: Todo
Development

No branches or pull requests

3 participants