We now have the bot:
1. Doing the automated upgrade (bump version, src, recomputing hash)
2. Doing a full nixpkgs-review reverse closure rebuild
The next step for a human is to review the upstream changelog. Right now they
have to find it manually, but if `meta.changelog` is set, this commit adds a
link to it directly in the PR description .
Resolves#44
We're no longer running this on `staging` PRs, and users doing single-package
updates have the option to omit `nixpkgs-review`, so we should only include the
PR comment section if it was actually run.
This continues to enhance the automated tests for the PR comment formatting,
so you can see what the diff looks like just by looking at the test suite!
1. We should always use `~/.cache/nixpkgs`, since if we do it in PWD the hard
resets risk blowing away user work!
2. Previously, we weren't fetching and resetting to up-to-date master, which
meant cmds would fail if your nixpkgs checkout was stale.
3. Previously, we were ignoring the `--pr` option entirely. This fixes that bug
by passing the bool into the UpdateEnv, and also cleans up the selected options
in the logger so it's easier to see.
4. We were including the title PR twice, like this:
https://github.com/NixOS/nixpkgs/pull/86624
There are still some issues and things to improve, but with this PR I've managed
to get a working usage here:
https://github.com/NixOS/nixpkgs/pull/86625
Having the tests makes it easier to visualize what's going on, because we can
just look at the test output data. This is not foolproof, since one of the IO
helper functions could generate bad data to pass to the pure helper, but it's
better than nothing.
This refactors as much as possible to keep the PR description logic in the pure
`prComment` function, rather than computing it in multiple places, which also
increases out unit test coverage.
* it isn't necessary to run cabal2nix directly (developPackage) takes
care of that.
* the cabal file is committed, so it only needs to be updated when
adding dependencies or new files
* instead of --dry-run use --pr to indicate a PR is wanted
* instead of additional updates, have update take the update as an
argument
* print out stdout instead of log file in the case of non-batch
updates
* print PR message to log even in the case of no PR