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

Version 0.1.2 #1

Closed
wants to merge 90 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
df52d02
Give more information in automated update PRs
infinisil Mar 21, 2024
8d1f3d1
Don't limit automated npins update to just nixpkgs
infinisil Mar 21, 2024
80f7564
Also do automated cargo update
infinisil Mar 21, 2024
a7593f8
Do automated PRs from a fork to trigger CI
infinisil Mar 21, 2024
157ab23
Set automated PR committer and author to the machine account
infinisil Mar 21, 2024
2204330
Set derivation version from Cargo.toml
infinisil Mar 21, 2024
4841093
Introduce release script
infinisil Mar 21, 2024
ce41249
Automate releases
infinisil Mar 21, 2024
0f556f9
Improve auto updates and welcome @infinixbot (#15)
philiptaron Mar 21, 2024
adb1f8a
Merge pull request #16 from NixOS/automated-releases
philiptaron Mar 21, 2024
2ff05a5
Set GH_TOKEN to fix automated releases
infinisil Mar 21, 2024
99e4397
Don't commit PR body for automated updates
infinisil Mar 21, 2024
e9a34ee
Merge pull request #18 from NixOS/fix-release
philiptaron Mar 21, 2024
c5efaca
Merge pull request #19 from NixOS/fix-updates
philiptaron Mar 21, 2024
2674043
Fix the automated update workflow name
infinisil Mar 21, 2024
28d841d
Fix automated update action
infinisil Mar 21, 2024
4208244
🤖 update (#20)
philiptaron Mar 21, 2024
2f677ff
Define what CI should build in Nix
infinisil Mar 21, 2024
4561070
Fix automated updates (another try)
infinisil Mar 21, 2024
febcf57
Merge pull request #21 from NixOS/fix-updates
philiptaron Mar 21, 2024
432b7f5
Fix the automated updates (another try)
infinisil Mar 22, 2024
da24722
Merge pull request #22 from NixOS/fix-updates
philiptaron Mar 22, 2024
11551af
Automated update
infinixbot Mar 22, 2024
db27399
Merge pull request #23 from infinixbot/auto-update
philiptaron Mar 22, 2024
a169008
Remove superfluous error field relative_package_file
willbush Mar 22, 2024
d12e15a
Rename package_name field in InvalidPackageName error
willbush Mar 22, 2024
0bb6405
Derive relative_package_dir from the package name for PackageNonDir
willbush Mar 22, 2024
f8bdeab
Refactor ratchet problems into a struct with common fields
willbush Mar 22, 2024
5c502a2
Remove unnecessary braces
willbush Mar 23, 2024
9391e85
Group shard problems into a struct for shared context
willbush Mar 23, 2024
686cbbc
Fix clippy warnings
willbush Mar 23, 2024
94244b0
Refactor nix file problems into a struct with common fields
willbush Mar 23, 2024
7eaa754
Refactor ByNameOveride problems into a struct with common fields
willbush Mar 24, 2024
d32d4cf
Refactor check_nix_file to use to_problem closure
willbush Mar 24, 2024
797f201
Refactor ByName problems into a struct with common fields
willbush Mar 24, 2024
e5aa63d
Refactor Path related problems into a struct with common fields
willbush Mar 24, 2024
b0d270e
Refactor Package related problems into a struct with common fields
willbush Mar 24, 2024
81e45fa
Refactor some nixpkgs_problem imports
willbush Mar 24, 2024
3bb8e00
Automated update
infinixbot Mar 24, 2024
264aee8
Merge pull request #25 from infinixbot/auto-update
philiptaron Mar 25, 2024
b1e3aeb
Switch automated updates to weekly
infinisil Mar 25, 2024
6f70d44
Add CODEOWNERS for automatic review requests
infinisil Mar 25, 2024
bddeeb1
Add CODEOWNERS for automatic review requests (#27)
philiptaron Mar 25, 2024
3b4cedc
Merge pull request #26 from NixOS/weekly-updates
infinisil Mar 25, 2024
25adca4
Fix clone of `node` by moving variables above usage of `cast`
willbush Mar 26, 2024
2ed5984
Change most to_problem closures into to_validation
willbush Mar 26, 2024
c57206d
Replace RatchetErrorKind with is_new and is_empty bools
willbush Mar 26, 2024
bcc472d
Rename RatchetError to TopLevelPackageError
willbush Mar 26, 2024
d20e68a
Fix main.rs tests clippy lints
willbush Mar 26, 2024
6f3f293
Lint tests with clippy
willbush Mar 26, 2024
591be8e
Add comments to NixpkgsProblem struct sub-types
willbush Mar 26, 2024
65a04d8
Merge pull request #28 from willbush/clippy-lint-all-targets
infinisil Mar 26, 2024
53f206e
Refactor Error Types (#24)
philiptaron Mar 26, 2024
7859b53
Automated update
infinixbot Apr 1, 2024
8c2ad6a
Automated update of dependencies from infinixbot (#32)
philiptaron Apr 1, 2024
103a4a5
tests: move all-packages.nix to pkgs/top-level
willbush Apr 4, 2024
7c75c01
Fix relative paths in all-packages.nix files and expected outputs
willbush Apr 4, 2024
c460d5e
Update errors paths to be relative to the expression file
willbush Apr 4, 2024
7f0c106
Merge pull request #33 from willbush/feauter/consistent-relative-paths
infinisil Apr 4, 2024
5771107
Automated update
infinixbot Apr 8, 2024
7e09057
Merge pull request #34 from infinixbot/auto-update
infinisil Apr 8, 2024
528630d
Rename keep_nix_path argument to is_test
infinisil Apr 8, 2024
c088678
Version 0.1.1
infinisil Apr 8, 2024
09cdf12
Fix unexpanded format when tests fail
infinisil Apr 8, 2024
b6d29b2
Remove mention of the command from Nix eval failures
infinisil Apr 8, 2024
dea4b1c
Only print Nix stderr when eval fails
infinisil Apr 8, 2024
23cefc1
Only show stderr of Nix failures when a failure occurred (#35)
philiptaron Apr 9, 2024
2d9b9d2
Version 0.1.1 (#36)
philiptaron Apr 9, 2024
a4a82e0
Create a Nixpkgs PR after releases
infinisil Apr 9, 2024
44d5e2e
Create a Nixpkgs pull request after nixpkgs-check-by-name releases (#37)
philiptaron Apr 10, 2024
3f361a4
Use lazyDerivation to avoid exposing all drv attrs
infinisil Apr 10, 2024
b358b31
Refactor into individual update scripts
infinisil Apr 10, 2024
f8ec2d3
Regularly update GitHub Actions
infinisil Apr 10, 2024
815a4ec
Test auto update script in PRs
infinisil Apr 10, 2024
6d09601
Automatic GitHub action updates (#40)
philiptaron Apr 10, 2024
5817515
Explicitly expose version to avoid release script failure
infinisil Apr 10, 2024
90d32e5
Explicitly expose version to avoid release script failure (#41)
philiptaron Apr 10, 2024
254bea4
Simplify GitHub action update script
infinisil Apr 10, 2024
1697ff7
Simplify GitHub action update script (#42)
philiptaron Apr 10, 2024
946b865
Automated update
infinixbot Apr 15, 2024
52ed7c5
Merge pull request #43 from infinixbot/auto-update
philiptaron Apr 15, 2024
e799c53
Fix output markdown of update-github-actions
infinisil Apr 15, 2024
62d820f
Merge pull request #44 from NixOS/fix-update-html
philiptaron Apr 15, 2024
59d4693
Automated changelogs [WIP]
infinisil Apr 16, 2024
bab8abe
Generate draft release notes on PRs
infinisil Apr 18, 2024
d1e6ce2
Add test changelog
infinisil Apr 18, 2024
f4bb322
Test release pushing
infinisil Apr 18, 2024
a0d1ade
Various improvements and testing
infinisil Apr 18, 2024
98114bf
Merge a0d1ade0c50e150b8963ec9ab15d385d07c99415 into 62d820f35135edd7e…
infinisil Apr 18, 2024
5aa7173
Version 0.1.2
infinisil Apr 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @NixOS/nixpkgs-check-by-name
3 changes: 3 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@


- [x] This change is user-facing
27 changes: 27 additions & 0 deletions .github/workflows/check-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Changelog
on:
pull_request:
branches:
- main
# Edited such that we can detect changes to the description
types: [opened, synchronize, reopened, edited]

permissions:
pull-requests: read

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# We need to fetch the parents of the HEAD commit (which is a merge),
# because we need to compare the PR against the base branch
# to check whether it added a changelog
fetch-depth: 2

- name: check changelog
run: scripts/check-changelog.sh . ${{ github.event.pull_request.number }}
env:
GH_TOKEN: ${{ github.token }}

71 changes: 69 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,79 @@ on:
- main

jobs:
check:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v26

- name: build
run: nix-build -A build -A shell -A checks
run: nix-build -A ci

version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# This fetches the entire Git history.
# This is needed so we can determine the commits (and therefore PRs)
# where the changelogs have been added
fetch-depth: 0
# Needed so we can push to the fork later, it's stored in the git config otherwise and
# would override the URL basic authentication
persist-credentials: false

- uses: cachix/install-nix-action@v26

- name: Increment version and assemble changelog
run: |
nix-build -A autoVersion
version=$(result/bin/auto-version . ${{ github.event.pull_request.number || '' }})
git config user.name ${{ github.actor }}
git config user.email ${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com
git add --all
git commit --message "Version $version

Automated release"

echo "version=$version" >> "$GITHUB_ENV"
env:
GH_TOKEN: ${{ github.token }}

- name: Outputting draft release notes
# If we have a new version at all (it's not an empty string)
# And it's not a push event (so it's a PR),
if: ${{ env.version && github.event_name != 'push' }}
# we just output the draft changelog into the step summary
run: cat changes/released/${{ env.version }}.md > "$GITHUB_STEP_SUMMARY"

- name: Update release branch
# But if this is a push te the main branch,
#if: ${{ env.version && github.event_name == 'push' }}
# we push to the release branch.
# This continuously updates the release branch to contain the latest release notes,
# so that one can just merge the release branch into main to do a release.
# A PR to do that is opened regularly with another workflow
run: git push https://${{ secrets.MACHINE_USER_PAT }}@github.com/infinixbot/nixpkgs-check-by-name.git HEAD:refs/heads/release -f


test-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v26

- name: test update script
run: |
nix-build -A autoPrUpdate
{
result/bin/auto-pr-update .
echo ""
echo '```diff'
git diff
echo '```'
} > $GITHUB_STEP_SUMMARY
env:
GH_TOKEN: ${{ github.token }}
29 changes: 29 additions & 0 deletions .github/workflows/regular-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Regular Version
on:
workflow_dispatch: # Allows triggering manually
schedule:
- cron: '47 14 * * 2' # runs every Tuesday at 14:47 UTC (chosen somewhat randomly)
#pull_request:
# branches:
# main

jobs:
version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: infinixbot/nixpkgs-check-by-name
ref: release

- name: Create Pull Request
run: |
subject=$(git log -1 --format=%s HEAD)
gh pr create \
--repo ${{ github.repository }} \
--title "$(head -1 <<< "$subject")" \
--body "$(tail -1 <<< "$subject")" \
--head infinixbot:release
env:
# Needed so that CI triggers
GH_TOKEN: ${{ secrets.MACHINE_USER_PAT }}
63 changes: 63 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CD
on:
push:
branches:
- main

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v26

- name: release
run: scripts/release.sh
env:
GH_TOKEN: ${{ github.token }}

nixpkgs-pr:
runs-on: ubuntu-latest
needs: release
steps:
- uses: actions/checkout@v4
with:
repository: NixOS/nixpkgs

- name: Get the Nixpkgs rev
run: echo "rev=$(git rev-parse HEAD)" >> $GITHUB_ENV

- name: Get version before
run: echo "before=$(<pkgs/test/check-by-name/pinned-version.txt)" >> $GITHUB_ENV

- name: Update the version
# We run bash explicitly instead of using the files shebang,
# because the shebang is using nix-shell with dependencies we already have by default
run: bash pkgs/test/check-by-name/update-pinned-tool.sh

- name: Get version after
run: echo "after=$(<pkgs/test/check-by-name/pinned-version.txt)" >> $GITHUB_ENV

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
# To trigger CI for automated PRs, we use a separate machine account
# See https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#workarounds-to-trigger-further-workflow-runs
# and https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#push-pull-request-branches-to-a-fork
token: ${{ secrets.MACHINE_USER_PAT }}
push-to-fork: infinixbot/nixpkgs
committer: infinixbot <infinixbot@infinisil.com>
author: infinixbot <infinixbot@infinisil.com>
branch: update/nixpkgs-check-by-name
commit-message: |
nixpkgs-check-by-name: ${{ env.before }} -> ${{ env.after }}

https://github.com/NixOS/nixpkgs-check-by-name/releases/tag/${{ env.after }}
title: "nixpkgs-check-by-name: ${{ env.before }} -> ${{ env.after }}"
body: >
This is an automated PR to update the version of [nixpkgs-check-by-name](https://github.com/NixOS/nixpkgs-check-by-name),
which is used by CI to [check the `pkgs/by-name`](https://github.com/NixOS/nixpkgs/tree/${{ env.rev }}/pkgs/by-name#validation) directory.
The update was performed by running [`pkgs/test/check-by-name/update-pinned-tool.sh`](https://github.com/NixOS/nixpkgs/tree/${{ env.rev }}/pkgs/test/check-by-name#update-pinned-toolsh).

This PR updates the tool to [version ${{ env.after }}](https://github.com/NixOS/nixpkgs-check-by-name/releases/tag/${{ env.after }}).
28 changes: 20 additions & 8 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,38 @@
name: Update Nixpkgs pin
name: Automated update
on:
workflow_dispatch: # Allows triggering manually
schedule:
- cron: '47 14 * * *' # runs every day at 14:47 UTC (chosen somewhat randomly)
- cron: '47 14 * * 1' # runs every Monday at 14:47 UTC (chosen somewhat randomly)

jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: repo

- uses: cachix/install-nix-action@v26

- name: update
run: |
nix-build -A pkgs.npins
result/bin/npins update nixpkgs
nix-build repo -A autoPrUpdate
result/bin/auto-pr-update repo > body
env:
GH_TOKEN: ${{ github.token }}

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
commit-message: "Automated Nixpkgs update"
branch: auto-nixpkgs-update
title: "Automated Nixpkgs update"
body: "Update the pinned Nixpkgs automatically"
# To trigger CI for automated PRs, we use a separate machine account
# See https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#workarounds-to-trigger-further-workflow-runs
# and https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#push-pull-request-branches-to-a-fork
token: ${{ secrets.MACHINE_USER_PAT }}
path: repo
push-to-fork: infinixbot/nixpkgs-check-by-name
committer: infinixbot <infinixbot@infinisil.com>
author: infinixbot <infinixbot@infinisil.com>
commit-message: "Automated update"
branch: auto-update
title: "Automated update"
body-path: body
Loading
Loading