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 UI for managing Qubes update repositories #172

Merged
merged 13 commits into from
Aug 28, 2019

Conversation

strugee
Copy link
Contributor

@strugee strugee commented Apr 8, 2019

Screenshot:

Screenshot_2019-04-08_03-24-50

Menu options provided:

  • Stable updates
  • Testing updates (security only)
  • Testing updates
  • Unstable updates

  • ITL template updates
  • ITL template updates (testing)

  • (Community templates disabled)
  • Community template updates
  • Community template updates (testing)

I'll fix the TODO in the PR with the qrexec services and then delete the hack in this code. But since the rest of this is complete I figured I'd open a PR and get the ball rolling on code review.

Depends on QubesOS/qubes-core-admin-linux#48

Fixes QubesOS/qubes-issues#4550

@strugee
Copy link
Contributor Author

strugee commented Apr 8, 2019

TODO is removed since I fixed the underlying bug in the other PR. This should be ready to merge.

@strugee
Copy link
Contributor Author

strugee commented Apr 8, 2019

Happy to squash the remaining PyLint warnings... but it seems unnecessary? The way it's currently written seems pretty clear and it's more concise.

@marmarek
Copy link
Member

marmarek commented Apr 8, 2019

While too long function name indeed is pylint being picky (you can add #pylint: disable=invalid-name just before it), I'd prefer to fix too short variable names to something more descriptive.

@strugee strugee force-pushed the repo-gui branch 2 times, most recently from ce3a552 to a443e33 Compare April 8, 2019 19:45
@strugee
Copy link
Contributor Author

strugee commented Apr 8, 2019

@marmarek done! I squashed the changes into the existing PyLint commit.

FWIW since I forgot to mention this last night, I have successfully tested these changes (including those I just pushed) decently thoroughly in dom0.

@strugee
Copy link
Contributor Author

strugee commented Apr 9, 2019

@marmarek CI is passing.

@strugee
Copy link
Contributor Author

strugee commented Apr 30, 2019

@marmarek ping for review, if you get a chance. No rush.

@marmarek
Copy link
Member

marmarek commented May 2, 2019

I haven't forgot, but first I want to get R4.1 in testable state. It's almost there: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.1&build=4.1-20190428&groupid=1 (see that one green dot!)

qubesmanager/global_settings.py Outdated Show resolved Hide resolved
qubesmanager/global_settings.py Outdated Show resolved Hide resolved
qubesmanager/global_settings.py Outdated Show resolved Hide resolved
qubesmanager/global_settings.py Outdated Show resolved Hide resolved
First of all, the method that was being called has asserts of its own,
so it's guaranteed to either succeed or crash the program with
AssertionError. Second, asserts are optimized out by the interpreter
when -O is passed. Therefore, this code is buggy because it sometimes
wouldn't be run, but we need the side effects.
@strugee
Copy link
Contributor Author

strugee commented Jul 2, 2019

@marmarek thanks very much for the helpful review, and sorry it took me a while to get around to making the changes - everything should be addressed. I also rebased while I was at it. The new changes have been manually tested so this should be ready to go in as soon as CI passes 👍

Apparently Python exceptions don't take **kwargs, so we just pass a
dictionary as the second (regular) argument. While we're at it, we
pretty-print said dictionary when displaying error messages.
Before this change, "foobar\n" on stderr would be rendered (in the
warning dialog) as "b'foobar\n'", which is ugly. Now it'll be rendered
just as "foobar", followed by an actual newline character.
@strugee
Copy link
Contributor Author

strugee commented Jul 2, 2019

OK, hopefully Travis is fixed (PyLint locally is complaining about short variable names, but it's in code I didn't touch recently... so we'll have to see what Travis says). I also found and fixed some bugs with the error handling, which is now fully tested. Here's what it looks like:

screenshot of a warning window in dom0 with the title "ERROR!" and the text "Error managing repository settings: qrexec call exited with non-zero return code; returncode: 1"

Also, before I forget, I want to point out that the program now unconditionally sets repository settings, even if they haven't changed. It was easier to write that way although if it's a big problem I can make it check beforehand.

@marmarek
Copy link
Member

marmarek commented Jul 2, 2019

the program now unconditionally sets repository settings, even if they haven't changed.

No, that will be problematic, may unintentionally change setting that wasn't touched. And also will fail in case of strict qrexec policy (for example no repository change allowed, user wanted to change just default netvm).

This definitely worked before, and I haven't touched this code recently
so I have no idea why these errors are just now popping up... but
whatever.
This helps in situations where the qrexec calls are forbidden; it also
prevents settings from being unintentionally changed and gives a
noticeable performance boost when the "OK" button is clicked.
@strugee
Copy link
Contributor Author

strugee commented Jul 3, 2019

@marmarek fixed!

@strugee
Copy link
Contributor Author

strugee commented Jul 3, 2019

Side note: PyQt really messes up debugging under Pdb; I used the method mentioned in this Stack Overflow answer to fix it. According to the mailing list post linked in that answer it's always safe to call that method, so I wonder if we should just call it at application startup to improve developer experience. (I haven't really looked closely into what this method does, yet.)

Also, as a note to myself, I don't know if the functions that are now inside a class should be using _ or __ and I really should figure that out.

Edit: here are docs on the method. I'm not really sure how this would impact us but since we don't have a REPL normally (except when debugging) it seems like a good idea?

@marmarek marmarek merged commit 7245603 into QubesOS:master Aug 28, 2019
@strugee strugee deleted the repo-gui branch August 29, 2019 18:42
@strugee
Copy link
Contributor Author

strugee commented Aug 29, 2019

Thanks @marmarek!! Super pumped to see this in a release :-)

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.

Graphical interface to manage testing repository updates
2 participants