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

fetchTree/github:: add merge argument #11160

Open
roberth opened this issue Jul 23, 2024 · 7 comments
Open

fetchTree/github:: add merge argument #11160

roberth opened this issue Jul 23, 2024 · 7 comments
Labels
feature Feature request or proposal fetching Networking with the outside (non-Nix) world, input locking new-cli Relating to the "nix" command UX The way in which users interact with Nix. Higher level than UI.

Comments

@roberth
Copy link
Member

roberth commented Jul 23, 2024

Is your feature request related to a problem? Please describe.

It's often useful to build or run something from a PR, especially when reviewing.
Let's make this easier.

Describe the solution you'd like

Step 1: CLI only

GitHub already supports a magic ref, like github:NixOS/nix?ref=refs/pull/11159/merge
We could provide a shorthand for this, like github:NixOS/nix?merge=11159

These merge commits, as well as commits in the PR tend to disappear, so it's doesn't make sense to lock this by rev sha.

Print a little notice when the PR has been merged, to let the user remove the merge parameter.

Step 2: Locking

Store the diff in the lock file or a location relative to it.
This would make it viable for use in pure-eval mode and real locking.

Step 3: Multiple

Multiple PRs could be merged in a single fetching. GitHub doesn't do this for us, so this would need the logic of Step 2, which needs to implement its own patching anyway.

Describe alternatives you've considered

Additional context

Priorities

Add 👍 to issues you find important.

@roberth roberth added feature Feature request or proposal UX The way in which users interact with Nix. Higher level than UI. new-cli Relating to the "nix" command fetching Networking with the outside (non-Nix) world, input locking labels Jul 23, 2024
@Aleksanaa
Copy link
Member

Yeah, QoL feature 👍

@emilazy

This comment was marked as outdated.

@Aleksanaa
Copy link
Member

You can just write github:NixOS/nix/pull/11159/merge (or /head), which is pretty ergonomic already. I do this all the time. Not sure if the juice is worth the squeeze? But I’m not opposed either.

Maybe for a flake that contains more configs (such as flake for NixOS), it will be helpful to directly merge multiple PRs in inputs.

@emilazy

This comment was marked as outdated.

@Aleksanaa
Copy link
Member

Does GitHub support that?

No, so

Step 3: Multiple

Multiple PRs could be merged in a single fetching. GitHub doesn't do this for us, so this would need the logic of Step 2, which needs to implement its own patching anyway.

@emilazy
Copy link
Member

emilazy commented Jul 27, 2024

Sorry for the noise, should have skimmed less…

@Aleksanaa
Copy link
Member

Also it should be possible to merge into a branch, say github:nixos/nixpkgs/nixos-unstable?merge=11159. Not sure if GitHub magic ref can do that...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request or proposal fetching Networking with the outside (non-Nix) world, input locking new-cli Relating to the "nix" command UX The way in which users interact with Nix. Higher level than UI.
Projects
None yet
Development

No branches or pull requests

3 participants