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 free-form text to qube for notes, comments, ... #656

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alimirjamali
Copy link
Contributor

Core and API part of adding free-form text to each qube for comments, notes, descriptions, remarks, reminders, etc.

fixes: QubesOS/qubes-issues#899

@alimirjamali alimirjamali marked this pull request as draft February 16, 2025 17:19
@alimirjamali alimirjamali force-pushed the issue-899 branch 4 times, most recently from 0940271 to 72c5176 Compare February 17, 2025 09:32
@marmarek
Copy link
Member

Black complains

Copy link

codecov bot commented Feb 20, 2025

Codecov Report

Attention: Patch coverage is 97.67442% with 1 line in your changes missing coverage. Please review.

Project coverage is 69.80%. Comparing base (6828311) to head (884cd29).
Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
qubes/backup.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #656      +/-   ##
==========================================
- Coverage   69.81%   69.80%   -0.01%     
==========================================
  Files          58       58              
  Lines       12542    12593      +51     
==========================================
+ Hits         8756     8791      +35     
- Misses       3786     3802      +16     
Flag Coverage Δ
unittests 69.80% <97.67%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alimirjamali
Copy link
Contributor Author

Black complains

Black complains are resolved. And the Codecov is advising on the required unittests. I guess I can proceed with the unittests? And I should assure that proper errors are raised if necessary.

@alimirjamali alimirjamali force-pushed the issue-899 branch 12 times, most recently from d9b77a8 to 2fdb146 Compare February 26, 2025 00:05
Core and API part of adding free-form text to each qube for comments,
notes, descriptions, remarks, reminders, etc.

fixes: QubesOS/qubes-issues#899
@alimirjamali alimirjamali marked this pull request as ready for review February 26, 2025 00:53
self.fire_event_for_permission()
try:
notes = self.dest.get_notes()
except Exception as e:
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if this broad except is a good idea, it may make bug reports (if any) hard to follow, as it will hide the backtrace, and for many built-in exception message is quite enigmatic (for example KeyError without context is hard to find).
get_notes() already has handing for expected errors (if some are missing, should be added there)

)
try:
self.dest.set_notes(notes)
except Exception as e:
Copy link
Member

Choose a reason for hiding this comment

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

same comment here

b"test-vm1",
payload=payload,
)
with self.assertRaises(qubes.exc.QubesException):
Copy link
Member

Choose a reason for hiding this comment

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

this should wrap only the last call_mgmt_func call, no?

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.

Allow users to add free-form text to qubes (for descriptions, notes, comments, remarks, reminders, etc.)
2 participants