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

[Chore] Make it possible to override input instead of updating #30

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rvem
Copy link
Member

@rvem rvem commented Jul 26, 2023

Problem: We'd like to have an ability to massively apply flake inputs overrides in our repos in order to test some updates before merging potentially breaking changes.

Solution: Make it possible to specify an attrset of input name and override url in the list of inputs to update. For each such entry in the inputs list, 'flake.lock' update will be done using '--override-input' instead of '--update-input'.

Config usage example for the overriding:

...
    "inputs": [
        {
            "input": "nixpkgs",
            "override_url": "github:nixos/nixpkgs"
        }
    ],
    "repos": [
      {
        "owner": "serokell",
        "repo": "update-daemon",
        "settings": {},
        "type": "github"
      }
    ],
...

Related YT issue: https://issues.serokell.io/issue/OPS-1478

Problem: We'd like to have an ability to massively apply flake inputs
overrides in our repos in order to test some updates before merging
potentially breaking changes.

Solution: Make it possible to specify an attrset of input name and override
url in the list of inputs to update. For each such entry in the inputs
list, 'flake.lock' update will be done using '--override-input' instead
of '--update-input'.

Config usage example for the overriding:
```
...
    "inputs": [
        {
            "input": "nixpkgs",
            "override_url": "github:nixos/nixpkgs"
        }
    ],
    "repos": [
      {
        "owner": "serokell",
        "repo": "update-daemon",
        "settings": {},
        "type": "github"
      }
    ],
...
```
@rvem rvem requested a review from lierdakil July 26, 2023 08:37
Copy link
Contributor

@lierdakil lierdakil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vaguely get the overall idea, but I'm very fuzzy on the details of how this would work, mostly because I don't know how/where update-daemon is actually run. Is the intention to basically change the config before doing an update proper and seeing how that pans out in auto-update PRs? Is there a qualitative difference from actually doing the update in the first place and seeing how things shake out (aside from which repo the commits switching out versions end up in)?

src/main.rs Outdated Show resolved Hide resolved
@rvem
Copy link
Member Author

rvem commented Jul 26, 2023

Is the intention to basically change the config before doing an update proper and seeing how that pans out in auto-update PRs?

Yes, more-or-less, but my idea was to create separate PRs for this, e.g. see https://github.com/serokell/aquarius-infra/pull/169

Is there a qualitative difference from actually doing the update in the first place and seeing how things shake out

Just to attempt to catch issues from the "upstream" (e.g. sometimes nixpkgs might be broken) and postpone the update or patch our fork if needed

@rvem
Copy link
Member Author

rvem commented Jul 26, 2023

but I'm very fuzzy on the details of how this would work, mostly because I don't know how/where update-daemon is actually run

Currently update-daemon is invoked on a daily basis on our build server.
However, my idea was to invoke it separately (either manually or from the CI) to create PRs that will test the update.

Copy link
Contributor

@lierdakil lierdakil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, so I've looked over the related slack thread, and I think I have a better grasp of the intent. As an "advance warning system" this makes sense. So correct me if I'm wrong, you're essentially planning to do something like nix flake lock --override-input nixpkgs github:NixOS/nixpkgs every so often in a branch separate from the automatic-update one? In that case, I would suggest manually running it isn't really justified, you could just as well run it automatically. Anyway, IIUC, the changes in this here PR are fit for this purpose (although some additional setup is required on the infra side, but nothing too bad), so I'll approve this.

That being said, do you suppose adding --refresh to the arguments while at it would make sense? I'm a little fuzzy on when exactly nix decides flake repos need redownloading, so maybe it's superfluous if you'll be running it rarely enough. OTOH, it shouldn't really hurt anything either, and could be helpful if you re-trigger manually within a short timespan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants