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

Add --boot flag to deploy and correct ratchet script #1352

Merged
merged 2 commits into from Jun 11, 2020
Merged

Add --boot flag to deploy and correct ratchet script #1352

merged 2 commits into from Jun 11, 2020

Conversation

cole-h
Copy link
Member

@cole-h cole-h commented May 25, 2020

This is similar to running nixos-rebuild boot, just as nixops deploy --test is similar to running nixos-rebuild test. The flag creates a
new config and sets it as the default to boot into, but doesn't switch
to it right away.


%s has no special meaning to echo, so the ratchet script was printing Checking base branch at %s, then PR at %s...\n origin/master d2cb660583ce356af51d9978329c0e77ad284620.


Since we already have --test, I figured "why not go for all three major uses?" (the implicit switch, and the explicit --test and now --boot).

Sometimes I have a config I want to switch into a boot time (because it may be destructive to switch mid-session), so this is the perfect use for it. For example: recently, I was messing with udev rules. Setting services.udev.extraRules and switching into this configuration rendered my USB devices (mouse, keyboard) unresponsive until I rebooted. Now, in the future, I know that this is potentially game-over, so I want the change to be available at boot and not switch into it right away.

Let me know if I need to do anything else!

P.S. One thing I noticed when running the various CI scripts is that ci/check-tests.sh failed to check coverage with the error: nose.plugins.cover: ERROR: Coverage not available: unable to import coverage module. Maybe it's fine (and you just let CI handle it), but it might be nice to have a nix-shell shebang or have pkgs.python3.pkgs.nose in the shell's buildInputs.

EDIT: I imagine ratchet is failing because the new boot argument is also of type Any (due to def deploy(self, **kwargs: Any) -> None:). If not (and there's a way I can fix it), let me know.

This is similar to running `nixos-rebuild boot`, just as `nixops deploy
--test` is similar to running `nixos-rebuild test`. The flag creates a
new config and sets it as the default to boot into, but doesn't switch
to it right away.
`%s` has no special meaning to echo.
@adisbladis adisbladis merged commit ebc78be into NixOS:master Jun 11, 2020
@cole-h cole-h deleted the deploy-boot branch June 11, 2020 18:44
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.

None yet

2 participants