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

Refactor move DeleteSourceDialog to 'gui.source' namespace #1394

Merged
merged 2 commits into from
Jan 25, 2022

Conversation

gonzalo-bulnes
Copy link
Contributor

Description

🔮 Review recommendations: I split the changes in two commits, so that tests can be run (unchanged) after the class as been moved, then can be run again (without changes to the non-test code) after they are moved. 🙂

This is the 11th step to be split out of #1369.
It moves the DeleteSourceDialog definition to its own file/module.

Test Plan

  • Confirm that the DeleteSourceDialog dialog behavior and appearance hasn't changed
  • Confirm that the DeleteSourceDialog definition is not changed
  • Confirm that the DeleteSourceDialog unit tests haven't changed
  • Confirm that the translatable strings haven't changed
  • Confirm that CI is green

Checklist

If these changes modify code paths involving cryptography, the opening of files in VMs or network (via the RPC service) traffic, Qubes testing in the staging environment is required. For fine tuning of the graphical user interface, testing in any environment in Qubes is required. Please check as applicable:

  • I have tested these changes in the appropriate Qubes environment
  • I do not have an appropriate Qubes OS workstation set up (the reviewer will need to test these changes)
  • These changes should not need testing in Qubes

If these changes add or remove files other than client code, the AppArmor profile may need to be updated. Please check as applicable:

  • I have updated the AppArmor profile
  • No update to the AppArmor profile is required for these changes
  • I don't know and would appreciate guidance

If these changes modify the database schema, you should include a database migration. Please check as applicable:

  • I have written a migration and upgraded a test database based on main and confirmed that the migration applies cleanly
  • I have written a migration but have not upgraded a test database based on main and would like the reviewer to do so
  • I need help writing a database migration
  • No database schema changes are needed

@gonzalo-bulnes gonzalo-bulnes requested a review from a team as a code owner January 13, 2022 09:04
@gonzalo-bulnes
Copy link
Contributor Author

@creviera This PR is extremely similar to #1393 - and it's ready to review 🙂

Copy link
Contributor

@sssoleileraaa sssoleileraaa left a comment

Choose a reason for hiding this comment

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

one comment to just raise attention towards, but nothing blocking. it looks like a clean refactor, so lgtm!

along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
# Import classes here to make possible to import them from securedrop_client.gui.source.delete
from securedrop_client.gui.source.delete.dialog import DeleteSourceDialog # noqa: F401
Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, so you are hiding the dialog module from the path so that you can from securedrop_client.gui.source.delete import DeleteSourceDialog when you actually need to import DeleteSourceDialog vs from securedrop_client.gui.source.delete.dialog import DeleteSourceDialog. Either way works for me, but I tend to try to keep my __init__.py empty and kind of prefer the simplicity and explicit-y when importing classes, functions, and variables from somewhere.

@sssoleileraaa sssoleileraaa merged commit 6c48d41 into main Jan 25, 2022
@sssoleileraaa sssoleileraaa deleted the refactor-move-source-deletion-dialog-to-namespace branch January 25, 2022 02:51
@sssoleileraaa sssoleileraaa mentioned this pull request Jan 26, 2022
26 tasks
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