Commit Graph

28 Commits

Author SHA1 Message Date
dependabot[bot]
36c667d9f4 build(deps): bump actions/github-script from 7.0.1 to 8.0.0
Bumps [actions/github-script](https://github.com/actions/github-script) from 7.0.1 to 8.0.0.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](60a0d83039...ed597411d8)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit 4ea8216576)
2025-09-08 12:36:31 +00:00
dependabot[bot]
ec3f65fdfd build(deps): bump cachix/install-nix-action from 31.6.0 to 31.6.1
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 31.6.0 to 31.6.1.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](56a7bb7b56...7be5dee142)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-version: 31.6.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit c4fd1f6500)
2025-09-08 12:23:32 +00:00
dependabot[bot]
f8ecf8cc37 build(deps): bump cachix/install-nix-action from 31.5.2 to 31.6.0
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 31.5.2 to 31.6.0.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](fc6e360bed...56a7bb7b56)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-version: 31.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit df934c4327)
2025-09-02 08:33:34 +00:00
dependabot[bot]
150ba26d2b build(deps): bump actions/create-github-app-token from 2.1.0 to 2.1.1
Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 2.1.0 to 2.1.1.
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](0f859bf9e6...a8d6161485)

---
updated-dependencies:
- dependency-name: actions/create-github-app-token
  dependency-version: 2.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit c1853d5ea1)
2025-08-26 12:08:31 +00:00
Wolfgang Walther
8353c8c10e ci/github-script/prepare: avoid running CI when targeting channel branches
This moves the no-channel-base check into the prepare script to exit
early and prevent all of CI to run against those branches. We also
provide better output by posting a "Changes Requested" review, using the
existing infrastructure from the old cherry-picks check.

The review will be dismissed automatically once the branch has been
corrected, because the commits check will run and do it.

(cherry picked from commit 0601cf6fd0)
2025-08-25 12:05:51 +00:00
Wolfgang Walther
59eb6387fa workflows/check: always run commits job
This is the very first step to extending the commits job to do more than
just cherry-picks in the future: It could check reverts or merge
commits, but also the commit message format and more.

Of course, cherry-picks are still just checked on the stable branches as
before. For now, this allows us to run the part that dismisses automated
reviews automatically. This helps us when we do branch related checks in
the prepare step, which would also create such a review. To avoid
cluttering multiple reviews across a PR, we'll want all of these reviews
to be handled by the same code, thus this change.

(cherry picked from commit b6bbf7b250)
2025-08-25 12:05:51 +00:00
Wolfgang Walther
78287e87be workflows/check: allow owners to fail when ci/OWNERS is untouched
The owners check is not reproducible, because it depends on the state of
the NixOS org on GitHub. Owners can rename their accounts or they can
leave the organisation and access to Nixpkgs can be removed from teams.
All of this breaks the owners check for reasons unrelated to the PR at
hand.

This PR makes the check for the owners file conditionally required: Only
when the ci/OWNERS file is actually modified a failed check will block
merging the PR. When that's not the case, the check will still fail
visibily in the checklist, but the failure can be ignored.

This is especially relevant for the Merge Queue, which should not be
entirely blocked whenever any of these events happen.

Also, it allows passing the checks in a fork when testing, where the
owners check will *always* fail, because the respective teams and
members are never part of the "user org" that a fork is.

(cherry picked from commit 956d0a744d)
2025-08-24 19:11:25 +00:00
Wolfgang Walther
0807259075 actions/checkout: always checkout pinned commits
With the latest performance improvements, this only adds up to 1s, but
reduces complexity in managing pinned checkouts explicitly, especially
when we need *both* pinned checkouts in the next commit.

(cherry picked from commit c18d1e4af8)
2025-08-22 11:53:56 +00:00
Wolfgang Walther
1ca8505578 actions/checkout: use single tmpfs with subfolders
This fixes problems on darwin, where the new tmpfs folder would not be
fully empty, but git only creates worktrees on fully empty directories.

(cherry picked from commit fb32eb0f29)
2025-08-22 10:13:11 +00:00
Wolfgang Walther
a4251b7612 [Backport release-25.05] ci/github-script/prepare: move more steps from workflow (#435325) 2025-08-20 17:51:00 +00:00
Wolfgang Walther
70fc919bde actions/checkout: rename inconsistent pinned-from input
(cherry picked from commit 7ab632b30f)
2025-08-20 16:58:10 +00:00
Wolfgang Walther
7d405339b3 actions/checkout: rename from actions/get-merge-commit
This moves the logic to "check whether the PR can be merged and
determine the relevant commits" into the PR / prepare job directly -
since that's the only place where it is supposed to be used.

Because of the if condition in get-merge-commit, this logic was run
multiple times, for example in the lint workflow, where only one of
targetSha or mergedSha was provided as input. However, this input was
thrown away directly. This might not be a big problem, because this was
not expensive, so far. But with the next commit, this will become more
so.

This also separates the logic a bit cleaner - `prepare` figures out all
the parameters for the whole PR workflow, while `checkout` handles the
consistency around these checkouts.

(cherry picked from commit b51e104439)
2025-08-20 16:58:10 +00:00
Wolfgang Walther
e3ff0fab42 workflows: never push source to cachix
Pushing the source path to cachix is pointless, because the only source
we're using is Nixpkgs - and that will always be available already via
checkout. No need to ever substitute it, so no need to push it either.

(cherry picked from commit 2400bdf0d4)
2025-08-20 16:54:39 +00:00
Wolfgang Walther
28c86b2359 workflows: support cachix in forks
This allows setting up a custom cachix cache in a contributor's fork.
That's most valuable when working on CI itself, testing and interating
in a fork. It's required when working on cachix related features
directly.

(cherry picked from commit 025424913f)
2025-08-20 16:54:39 +00:00
Wolfgang Walther
aefe360c78 workflows/check: move owners check job from codeowners
This runs the "check owners" job as part of the main PR workflow, with
multiple advantages:
- The job doesn't run anymore when undrafting a PR, where it's not
required, because the OWNERS file's contents didn't change.
- A valid OWNERS file is now a requirement to merge a PR.
- The OWNERS file is always checked on the exact same test merge commit
that the remainder of the workflows are running on as well.

(cherry picked from commit 15be04f7a2)
2025-08-20 15:16:14 +00:00
Wolfgang Walther
3ef8956f74 workflows/check: use regular checkout
The filtered checkout we used before was a nice idea, but only worked
for small numbers of commits in a PR. It would fetch the whole history
initially, but only fetch objects on demand. This turns out to be much
too slow in a PR with 18 commits, regularly hitting the 10 minute
timeout, even when running it locally.

The new approach uses regular checkouts again. In contrast to the old
style, before we switched to the filtered checkout, this only fetches
exactly the commits we need - and all of them at once. This is
significantly faster than both other approaches, and scales much better.
A bigger number of commits doesn't have much of an effect, if any at
all.

(cherry picked from commit 0dff5ad6c5)
2025-08-13 19:15:10 +00:00
Wolfgang Walther
521fd9bcd1 workflows/check: allow more time for check cherry picks job
This currently times out after 3 minutes. Give it a bit more time. 10
minutes might be excessive, but we only really want to guard against a
stuck job taking 6 hours.

(cherry picked from commit 17b1c6cb3d)
2025-08-12 17:15:00 +00:00
dependabot[bot]
c3969b49ee build(deps): bump actions/checkout from 4.2.2 to 5.0.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.2 to 5.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](11bd71901b...08c6903cd8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit 593aee095f)
2025-08-11 17:45:44 +02:00
Wolfgang Walther
63301f9889 .github/workflows: set timeouts
None of our jobs is expected to run for 6 hours, the GitHub limit. These
limits are generous and take into accounts that some jobs need to wait
for others.

If jobs exceed these times, most likely something else is wrong and
needs investigation.

(cherry picked from commit 436d54174d)
2025-08-09 19:11:02 +00:00
Wolfgang Walther
ca425fc98d ci/github-script/commits: block on errors
Most of the checks we do for cherry-picks are dismissable warnings, with
one exception: When a commit hash has been found, but this hash is not
available in any of the pickable branches, we raise this with
severity=error. This should also *block* the merge and not be
dismissable. That's because this is a fixable issue in every case.

(cherry picked from commit 1fbcad0434)
2025-07-17 10:12:42 +00:00
Wolfgang Walther
7f19a6e408 ci/github-script/commits: init from ci/check-cherry-picks
This turns the check-cherry-pick script into a github-script based
JavaScript program. This makes it much easier to extend to check reverts
or merge commits later on.

(cherry picked from commit b46cb23251)
2025-07-16 10:26:08 +00:00
Wolfgang Walther
e9f22139fa workflows/{check,reviewers}: don't run on PRs from secondary development branches
It makes no sense to check cherry picks or request reviewers on PRs from
staging-next to master, the same on backbranches or for haskell-updates
into staging.

(cherry picked from commit a3ce5970e0)
2025-06-23 10:54:39 +00:00
Wolfgang Walther
9a42b59630 workflows/pr: refactor base/head branch decision making
Some jobs purposefully only run on certain base or head branches. By
centralizing the logic, parts of it can easily be re-used later. Also,
this gives them an explicit name and thus makes them easier to
understand.

(cherry picked from commit 7763be5a80)
2025-06-23 10:54:39 +00:00
Wolfgang Walther
5db160cb07 workflows: log rate limits consistently
This will give us a better idea about:
- Which jobs use the most API calls and can possibly be made more
efficient.
- Which rate limits apply exactly to which tokens.

(cherry picked from commit 356bf98a32)
2025-06-23 06:41:07 +00:00
Wolfgang Walther
9eb06853d9 workflows/{pr,push}: init
Those two workflows bundle all the main jobs in two event-specific
wrapper workflows. This enables us to do two things later on:
- Synchronize the merge commits between most of the jobs run in a PR.
- Create a single "required" job to be targeted by GitHub's "required
status checks to pass" feature.

(cherry picked from commit 959eed1f2a)
2025-06-18 12:17:58 +00:00
Wolfgang Walther
4aa51a994c workflows/{labels,reviewers}: fix concurrency groups for nested workflows
This didn't work as intended. When a workflow is run with
`workflow_call`, it will have `github.workflow` set to the *parent*
workflow. So the `caller` input that we passed, resulted in this
concurrency key:

```
Eval-Eval-...
```

But that's bad, because the labels and reviewers workflows will cancel
each other!

What we actually want is this:
- Label and Reviewers workflow should have different groups.
- Reviewers called via Eval and called directly via undraft should have
*different* groups.

We can't use the default condition we use everywhere else, because
`github.workflow` is the same for Label and Reviewers. Thus, we hardcode
the workflow's name as well. This essentially means we have this as a
key:

```
<name-of-running-workflow>-<name-of-triggering-workflow>-<name-of-event>-<name-of-head-branch>
```

This should do what we want.

Since workflows can be made reusable workflows later on, we add those
hardcoded names to *all* concurrency groups. This avoids copy&paste
errors later on.

(cherry picked from commit 6793e238fa)
2025-06-14 14:27:37 +02:00
Wolfgang Walther
93ecbedbae workflows: prevent accidental cancelling of other PRs
This can happen when two PRs run at the same time, which come from
different forks, but have the same head branch name.

github.head_ref is suggested by GitHub's docs, but.. that's not really
useful for cases with forks.

(cherry picked from commit 7ba7720b28)
2025-06-14 14:27:32 +02:00
Wolfgang Walther
e6c1c77513 workflows/check: run "checks" in one workflow
This introduces "check" as another category of jobs suitable for the
"Require status checks to pass" feature.

Checks as a category would include everything that is done before even
looking at the code: Right branch? Commit messages? Cherry-picked
correctly?

(commit messages are not checked, yet)

(cherry picked from commit f11b58a7a0)
2025-06-13 10:12:12 +00:00