DeterminateSystems / update-flake-lock

Automatically refresh your Nix Flakes.
MIT License
252 stars 30 forks source link

Include upstream git log in PR description, possibly even filtered? #65

Open nomeata opened 1 year ago

nomeata commented 1 year ago

This action looks like it’s the natural replacement for https://github.com/knl/niv-updater-action when moving from niv to flakes.

One feature that I like a lot about niv-updater-actions is that it includes the relevant bits from the upstream git changelog in the PR description (and, somewhat related, it keeps updating the same PR until it can get merged, so if merging takes longer it will not create many PRs).

(It munges the changelog so that commit and PR references point to the right repo, and that they don’t spam upstream PRs with “this PR has been mentioned”.)

Would this be a useful feature for update-flake-lock as well?

If so, a possible (optional) extension would be to only lists those upstream commits that actually changed the derivation of the current flake’s outputs – useful when upstream has lots of unrelated changes, as nixpkgs tends to do, as outlined in https://discourse.nixos.org/t/bumping-flake-inputs-bisecting-input-repo-for-relevant-changelog-entries/25619/7?u=nomeata.

tlvince commented 11 months ago

A quick and dirty way of doing this could be to interpret the commit diff to leverage GitHub's compare commits feature, e.g. compare.js, example PR: https://github.com/tlvince/nixos-config/pull/33.

Rather than RegEx, a better way would be to hook into nix flake update directly. Could it produce an AST? Failing that, parsing flake.lock (since it's just JSON) could work.