-
Notifications
You must be signed in to change notification settings - Fork 242
[Nix] Update flake.lock (59 weeks behind) + Fix CI for Nix #533
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
Changes from all commits
e59c270
da770b9
d2f907f
79dffd2
4e9ce7d
071e781
a9af107
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| name: Check Nix flake | ||
| on: | ||
| pull_request_target: | ||
| pull_request: | ||
| paths: | ||
| - '*.nix' | ||
| - '**.nix' | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The purpose of this change is to ensure that this CI check is triggered in all cases it is required, i.e. whenever any changes are made to any files in the project that have a The Problem
The Solution
|
||
| - flake.lock | ||
| push: | ||
| branches: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,11 +15,14 @@ jobs: | |
| - uses: DeterminateSystems/magic-nix-cache-action@main | ||
| - name: update flake.lock | ||
| run: nix flake update | ||
| - name: Define Unique COMMIT_BRANCH by Timestamp | ||
| run: | | ||
| TIMESTAMP=$(date +'%Y-%m-%d-%H%M%S') | ||
| echo "COMMIT_BRANCH=automation/update-flake-dependencies-$TIMESTAMP" >> $GITHUB_ENV | ||
| - name: Create signed commit with flake.lock changes | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| FILE_TO_COMMIT: flake.lock | ||
| COMMIT_BRANCH: automation/update-flake-dependencies | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The purpose of this change is to fix the broken weekly Update flake dependencies GitHub workflow. The ProblemOnce a week and on manual workflow executions, the same branch name The SolutionAdd a timestamp to the end of the branch name so it is unique. This means that a new branch + PR will be created on every run of this workflow.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: the reason I made a separate branch was under the assumption that if a new branch and PR is created every week, it will notify the 2nd reviewer more frequently and may result in more of the PRs getting the 2nd approvals they need, but obviously it's more of a spammy solution. |
||
| COMMIT_MESSAGE: "chore(nix): Update Flake dependencies" | ||
| run: | | ||
| # make sure something actually changed first, if not, no updates required | ||
|
|
||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Normally I would not have updated the lock file in the same PR as CI changes, but your entire CI pipeline for Nix is not working as expected and that is partially because it is dependent on an up-to-date |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The purpose of this change is to fix the automated Nix CI workflow for the
nix flake checkcommand.The Problem
The old workflow used
pull_request_target, which caused it to run checks against the outdatedflake.lockfile from themainbranch, leading to consistent failures due to the constraints of this workflow (which requires the tested branch to have aflake.lockfile generated in the last 30 days).See image source here
The Solution
This change switches the workflow to the
pull_requesttrigger, which correctly runs checks against theflake.lockbeing added in a pull request branch rather than against theflake.lockin themainbranch.Why It's Still Failing
Because the workflow specifications are read from the
mainbranch, the newpull_requesttrigger will not take effect until this change is merged. The checks will continue to fail until then, and as a result you will likely have to override the checks to deploy this.