ci: skip Github CI on branch pushes for forks #30487

pull Sjors wants to merge 1 commits into bitcoin:master from Sjors:2024/07/ci-fork-github changing 1 files +9 −1
  1. Sjors commented at 3:39 pm on July 19, 2024: member

    When a contributor maintains a fork of the repo, any pull request they make to their own fork, or to the main repository, will trigger two CI runs one for the branch push and one for the pull request.

    This was fixed for Cirrus in e9bfbb5414ab14ca14d8edcfdf77f28c9ed67c33, but it relies on setting a custom variable which Github CI lacks.

    This PR therefore disables Github CI runs on branch pushes for forks entirely.

    After this PR, pushes made to git branches inside fork repositories will no longer trigger CI runs, unless the git branches are associated with PRs in the fork repository, or the main repository.


    This was was originally part of #29274, but left out in order for that PR to be entirely about Cirrus CI. It was suggested as a followup in #29274 (comment).

    I’ve been using this commit in #29432 (on this repo) and https://github.com/Sjors/bitcoin/pull/48 (my fork).

  2. ci: skip Github CI on branch pushes for forks
    Similar to e9bfbb5414ab14ca14d8edcfdf77f28c9ed67c33 for Cirrus, but
    not opt-in, because Github CI lacks custom variables.
    3067cd55f0
  3. DrahtBot commented at 3:39 pm on July 19, 2024: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK ryanofsky

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    Conflicts

    No conflicts as of last run.

  4. DrahtBot added the label Tests on Jul 19, 2024
  5. ryanofsky commented at 3:32 pm on July 24, 2024: contributor

    Mentioning the history of this change in the PR description is helpful, but it would be clearer if it said what the change is and what effects it has.

    From code comments in this PR and #29274 (comment), it seems like the main intended effect of this change is to prevent github tasks from running twice in PRs and causing the following output:

    But in the last thread where this change was discussed (https://github.com/bitcoin/bitcoin/pull/29274#discussion_r1457587805) a potential concern was that it would cause CI not to run on branch pushes within forks like Inquisition and Knots.

    This seems like it could be a real problem, though maybe it is not a big deal for the forks to modify this file if they want CI to run on branches they are modifying anyway.

  6. DrahtBot added the label CI failed on Aug 5, 2024
  7. Sjors commented at 10:59 am on August 8, 2024: member

    @ryanofsky I updated the description.

    In the earlier issue both @luke-jr (Knots) and @ajtowns (Inquisition) seemed to indicate that the change wouldn’t be a problem for them. See #29274 (comment). Let me know if that’s incorrect or if you changed your mind.

    not a big deal for the forks to modify this file if they want CI to run on branches they are modifying anyway

    So far it seems I’m the only one using this and it’s not bothering any other project. But if we end up with some forks that need to modify this file and others that don’t, then I don’t think this PR should be merged. The extra runs are annoying, but if needed I can wait for a glorious future in which Github CI gets their act together.

  8. DrahtBot removed the label CI failed on Aug 9, 2024
  9. ryanofsky approved
  10. ryanofsky commented at 3:41 pm on August 16, 2024: contributor

    Code review ACK 3067cd55f0fc79a7fa6342ca0600472cabcf2690.

    Thanks for the explanation, that all sounds good to me.

    The new description is definitely better than the original but it is not actually saying what behavior will be after this PR. Would be helpful to say something like “After this PR, pushes made to git branches inside fork repositories will no longer trigger CI runs, unless the git branches are associated with PRs in the fork repository, or the main repository.” (assuming that is correct)

  11. Sjors commented at 10:19 am on August 17, 2024: member
    Thanks, added that (correct) sentence to the description.

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-09-08 01:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me