Repository navigation
effects-lib: add hercules-ci-effects' flakeUpdate - #237
Merged
Merged
Conversation
multivac61
force-pushed
the
effects-lib-flake-update
branch
from
October 4, 2026 10:43
01ca4a9 to
390ad90
Compare
Mic92
force-pushed
the
effects-lib-flake-update
branch
from
October 4, 2026 19:23
390ad90 to
79c499e
Compare
Mic92
enabled auto-merge
October 5, 2026 11:40
Mic92
disabled auto-merge
October 5, 2026 11:40
Mic92
force-pushed
the
effects-lib-flake-update
branch
from
October 5, 2026 12:01
79c499e to
3f0a4f6
Compare
Contributor
Author
|
Can I assist further with this PR. Is it too much cruft to bring into the repo maybe? |
Mic92
force-pushed
the
effects-lib-flake-update
branch
3 times, most recently
from
October 25, 2026 19:46
abcae16 to
1933845
Compare
Flakes that keep their lock current from a scheduled effect use hci-effects.flakeUpdate, which keeps hercules-ci-effects as an input. Add one with the same arguments and behaviour, opening pull requests on GitHub, Gitea and GitLab, and pushing with tokenSecret since the checkout's forge token may only read. With perInput, each input gets its own branch and pull request, as with update-flake-inputs. Like it, the effect skips pushes that would only change commit dates, so CI does not rerun on every schedule, supports Gitea auto-merge and excluding inputs, and re-enables auto-merge on pull requests that are already open.
Mic92
force-pushed
the
effects-lib-flake-update
branch
from
October 25, 2026 19:50
1933845 to
1315830
Compare
Mic92
enabled auto-merge
October 25, 2026 19:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds hercules-ci-effects'
flakeUpdateto effects-lib. It takes the same arguments and behaves the same way, so a flake that keeps its lock current from a scheduled effect can drop hercules-ci-effects as an input. It's based onmain, independent of #232/#233.Same behaviour as upstream
I checked against
effects/flake-update/effect-fun.nixandeffects/modules/git-update.nixat hercules-ci-effects6c58de7:nix flake update --commit-lock-fileper entry offlakes, withinputsandcommitSummary; answers "n" tonixConfigbaseMergeBranch, or the default branchbaseMergeBranchonly when one is given (baseMerge.enable); otherwise it's updated as it stands--forcefor reset,--force-with-leasefor rebasepullRequestTitle(default`flake.lock`: Update), bodypullRequestBodyor the commit's; an existing PR or "No commits between" isn't an errorautoMergeMethodon GitHub: enable auto-merge, or merge at once if the PR is in clean statusenablePullRequestAutoMergeaccess-tokens) authenticate withtokenSecret(defaultGitToken) asusertokenSecret(defaultGitToken, so the forge token);userdefaults to the forge's token user instead ofgitUpstream also has a
moduleargument for extending its modular effect, and support for nix older than 2.19. Neither applies here.Why
tokenSecretmatters with nixbot's checkoutThe checkout carries the forge token twice: in
origin, and inurl."https://x-access-token:<token>@host/".insteadOf "https://host/", which rewrites every URL on the forge. When the App installation can't write contents, that token can't push. A repository in exactly that situation had its nightly update fail with a 403. Pushing with a PAT to the plain URL didn't help either, because theinsteadOfrewrote it back to the forge token. So the effect drops those rewrites and authenticates through a credential store holdingtokenSecret, as upstream'sgit-authdoes, which keeps the token out of URLs and error messages. With the defaultGitTokenthis changes nothing.Tested
userSetupScriptandeffectScripttwice per case, against a checkout set up as nixbot sets one up: forge token inoriginand in aninsteadOf. Behind it are local bare repositories at an http URL and a fake API for all three forges. The cases cover GitHub, Gitea and GitLab, reset vs. no base merge, auto-merge enabled, and auto-merge on a clean PR. It asserts the exact API requests, the pushed history, and the credentials git and nix got.insteadOfcleanup removed, the check fails with the 403 case's symptom:unable to access 'http://127.0.0.1:…/acme/widget.git/': … 501, because the push went to the fake API with the checkout's token.effects-lib-flake-update,effects-libandtreefmtbuild on aarch64-darwin.effects-lib-flake-updateevaluates on x86_64-linux and aarch64-linux.🤖 Generated with Claude Code