Commit Graph

33 Commits

Author SHA1 Message Date
Will Bush
d08c0dbc47
workflows: force CLI color when running nixpkgs-check-by-name
Currently something about the environment in which GH action is running the
colored library is not using ANSI colors.

I have done some testing in this repo:

https://github.com/willbush/throwaway-miette-gh-action-test/actions/runs/8777029939/job/24081383467

And I'm fairly certain env var `CLICOLOR_FORCE: 1` should fix colors.
2024-04-21 20:23:06 -05:00
Silvan Mosberger
f7ea336cb2 workflows/check-by-name.yml: Switch to new separate repo
The nixpkgs-check-by-name tooling is [being moved](https://github.com/NixOS/nixpkgs/issues/286559#issuecomment-2000466124)
to a [separate repo](https://github.com/NixOS/nixpkgs-check-by-name).

This commit updates Nixpkgs CI to use it instead of the tree inside
Nixpkgs

No changes have been made to the tooling locally since it was moved:
- [Exported history](55bf02190e/pkgs/test/nixpkgs-check-by-name)
- [Imported history](d579e1821d/)
2024-03-26 21:24:48 +01:00
dependabot[bot]
677b0f82c7
build(deps): bump actions/checkout from 4.1.1 to 4.1.2
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](b4ffde65f4...9bb56186c3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-18 11:50:32 +00:00
dependabot[bot]
1fb53efbbf
build(deps): bump cachix/install-nix-action from 25 to 26
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 25 to 26.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](6004951b18...8887e596b4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-11 11:39:15 +00:00
Silvan Mosberger
0825957f54 workflows/check-by-name: Trigger on base branch changes
Not doing this can cause CI to report a misleading result when it wasn't
retriggered after a base branch change.
2024-01-21 22:47:10 +01:00
dependabot[bot]
7a6810eb0f
build(deps): bump cachix/install-nix-action from 24 to 25 (#281120)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 24 to 25.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](7ac1ec2549...6004951b18)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-18 17:08:54 +01:00
Silvan Mosberger
8cf3cd91b2 check-by-name: Update contributor docs
Now that the tooling is pinned instead of being fetched indirectly from
the channel, the docs need some updating
2024-01-17 21:26:39 +01:00
Silvan Mosberger
50d57f6236 check-by-name: Fix CI
Wasn't detected in https://github.com/NixOS/nixpkgs/pull/281407
2024-01-17 21:26:12 +01:00
Silvan Mosberger
9da57b5bd3 check-by-name/run-local.sh: Make it usable for non-CI platforms
Since https://github.com/NixOS/nixpkgs/pull/281374, the
nixpkgs-check-by-name tooling is pinned to a specific /nix/store path to
avoid having to evaluate Nixpkgs in CI.

The same path is used for local runs, but that doesn't actually work
when you're trying to run it on a platform different from CI.

This commit makes it work by being clearer about platforms and making
local runs check out the correct Nixpkgs to evaluate the tool from.
2024-01-17 10:45:23 +01:00
Silvan Mosberger
cc422e321e workflows/check-by-name: Pin nixpkgs-check-by-name tool
Before this, the tool for CI would update when nixos-unstable updated,
which is kind of terrible because you don't know when it happens, and it
might break master.

In fact, the tooling _right now_ has a serious bug and shouldn't be used!

This PR addresses this by _pinning_ the tooling in Nixpkgs itself.

Updating the tooling now requires two PRs:
- The first PR to update the tooling source
- (wait for Hydra to build and publish it in nixos-unstable)
- The second PR to update the pinned tooling

In turn you know exactly when the changes are going to take effect.

This change however has additional benefits:
- It makes CI more reproducible, because it doesn't depend on the state
  of nixos-unstable anymore
- Updates to the tooling can be tested with the workflow itself,
  because PRs that update the pinned tool will be tested on the updated
  version
- CI gets a sizable speed boost, because there's no need to download and
  evaluate a channel anymore
- It makes it more realistic to move the source of the tool into a
  separate repository
- It removes the brittle branch-specific logic that was previously
  needed to ensure that release branches use their own version of the
  tooling.
2024-01-16 19:58:19 +01:00
Silvan Mosberger
02b3c06b1c
Merge pull request #274591 from tweag/by-name-reproducible
`pkgs/by-name`: Enable gradual migration checks and add `run-local.sh`
2023-12-22 00:17:37 +01:00
Silvan Mosberger
f882df781c maintainers/scripts/check-by-name.sh: Introduce symlink alias 2023-12-22 00:04:16 +01:00
Silvan Mosberger
1968beeabd check-by-name: Pass --base in CI and local running script
This enables the ratchet checks for pkgs/by-name, allowing gradual
migrations!
2023-12-20 17:38:06 +01:00
Silvan Mosberger
1ad45e503f workflows/check-by-name: Slim down and prepare for --base
Now that we have a script to run the check locally,
there's no real need to output the information to reproduce anymore,
which allows cleaning up the CI workflow.

Furthermore, this prepares the CI workflow to be passed `--base`, as
introduced recently.
2023-12-20 17:38:05 +01:00
Silvan Mosberger
c6267887db workflows/check-by-name: Why the mergeability check needs to be inline 2023-12-19 23:15:41 +01:00
Silvan Mosberger
3869ba4127 workflows/check-by-name: Move tool fetching into script
This part of the CI can also be reproduced locally
2023-12-19 23:15:01 +01:00
Silvan Mosberger
dbb599f2e4 workflows/check-by-name: Cancel on merge conflicts 2023-12-15 18:49:29 +01:00
dependabot[bot]
e3e5f288bf
build(deps): bump cachix/install-nix-action from 23 to 24 (#272011)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 23 to 24.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](6a9a9e84a1...7ac1ec2549)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-05 01:52:38 +01:00
Silvan Mosberger
ac01ff7146
Merge pull request #270496 from tweag/by-name-backoff
workflows/check-by-name: Limited and exponential retries
2023-12-01 04:47:17 +01:00
Victor Engmark
4177297b14 ci: pin third party actions
For reproducibility.

Command:

```shell
for file in .github/workflows/*.y*ml; do
    npx pin-github-action --comment=' {ref}' "$file"
done
```

Then had to manually replace all the versions with accurate specifiers
(for example, "v4" → "v4.1.1" in case of `actions/checkout`).
2023-11-29 09:51:22 +01:00
Silvan Mosberger
5e0644896d workflows/check-by-name: Set 10 minute timeout
Co-Authored-By: Cole Helbling <cole.e.helbling@outlook.com>
2023-11-27 23:57:08 +01:00
Silvan Mosberger
d38a7343fe workflows/check-by-name: Limited and exponential retries
We've had a recent PR CI mass failure event, ultimately caused by the
mergeability check GitHub API not returning a result.

But due to the `pkgs/by-name` check workflow not backing off
appropriately between retries, it pummeled the API, resulting in
exceeding the API rate limit:

https://github.com/NixOS/nixpkgs/actions/runs/7010089143/job/19069845070

This commit fixes that for the future by implementing a retry strategy limited to three
retries, with exponential backoff
2023-11-27 22:42:17 +01:00
Silvan Mosberger
ad228aee4b workflows/check-by-name: If channel no existent, fall back to nixos-unstable 2023-11-22 01:53:07 +01:00
Silvan Mosberger
785b8ca2e7 workflows/check-by-name: Improved mergeability check 2023-10-18 01:59:47 +02:00
Artturin
5fbbada2fb workflows/check-by-name: print failed command output 2023-10-17 22:04:48 +03:00
Silvan Mosberger
b3e14b9045
Merge pull request #259074 from tweag/detect-merge-conflicts
workflows/check-by-name: Better error for merge conflicts
2023-10-06 05:09:54 +02:00
Silvan Mosberger
004da0cf91 workflows/check-by-name: Better error for merge conflicts 2023-10-05 00:13:47 +02:00
Silvan Mosberger
dd543a79d5 workflows/check-by-name: Add a missing colon 2023-10-04 23:42:10 +02:00
Silvan Mosberger
0dcdf60c38 workflows/check-by-name: Better error when base branch also fails
Previously, even if the check also failed on the base branch, it looked
like the PR introduced the failure.

We can easily have a better error message for such cases.

Meanwhile this also paves the road for something like
https://github.com/NixOS/nixpkgs/issues/256788
2023-10-02 22:01:43 +02:00
Silvan Mosberger
437d00dde3 workflows/check-by-name: Make runnable without approval
Co-Authored-By: zowoq <59103226+zowoq@users.noreply.github.com>
2023-09-11 14:27:42 +02:00
dependabot[bot]
9a70b1e242 build(deps): bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-11 13:55:35 +02:00
dependabot[bot]
1d179cbc67
build(deps): bump cachix/install-nix-action from 22 to 23
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 22 to 23.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v22...v23)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-05 14:26:48 +00:00
Silvan Mosberger
f6467c3574 pkgs/by-name: Introduce
This introduces the `pkgs/by-name` directory as proposed by RFC 140.
Included are:
- The implementation to add packages defined in that directory to the
  top-level package scope
- Contributer documentation on how to add packages to it
- A GitHub Actions workflow to check the structure of it on all PRs
2023-09-05 16:10:50 +02:00