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

Branch force-pushes confuse dependabot #107

Closed
crepererum opened this issue Apr 17, 2024 · 2 comments
Closed

Branch force-pushes confuse dependabot #107

crepererum opened this issue Apr 17, 2024 · 2 comments

Comments

@crepererum
Copy link

It's good practice to pin GitHub action via commits instead of tags or branch names.

Dependabot supports this as well.

However, if the commit that a GitHub action refers to is gone due to a force push, it trips over it. E.g. when dependabot checks for updates for this file, it errors:

...
updater | 2024/04/17 01:39:15 ERROR <job_815812220> Error processing dtolnay/rust-toolchain (Dependabot::SharedHelpers::HelperSubprocessFailed)
updater | 2024/04/17 01:39:15 ERROR <job_815812220> error: no such commit d0592fe69e35bc8f12e3dbaf9ad2694d976cb8e3
...

updater | 2024/04/17 01:39:15 INFO Results:
updater | Dependabot encountered '1' error(s) during execution, please check the logs for more details.
updater | +----------------------------------------+
updater | |     Dependencies failed to update      |
updater | +------------------------+---------------+
updater | | dtolnay/rust-toolchain | unknown_error |
updater | +------------------------+---------------+
updater | time="2024-04-17T01:39:15Z" level=info msg="task complete" container_id=job-815812220-updater exit_code=0 job_id=815812220 step=updater

One could argue that dependabot shouldn't trip and just pick a new commit, but I think force-pushing to the branch leaves the pinned commit dangling and subject to garbage collection, which would break CI pipelines. So I think my ask is to NOT force push branches at all. This also makes reasoning about changes a bit easier when you look at the Git history.

PS: Other than that the rust-toolchain action works super well. Thank you very much! ❤️

@dtolnay
Copy link
Owner

dtolnay commented Apr 17, 2024

The master branch is never force pushed. This is enforced by a branch protection rule.

There should be no reason for you to be using a pinned sha1 on anything other than the master branch; that makes no sense.

@crepererum
Copy link
Author

OK, pinning the master branch and specifying toolchain: stable (instead of using the stable branch) works.

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

No branches or pull requests

2 participants