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

Reordered manage.py args in parser. #4858

Merged

Conversation

zenmonkeykstop
Copy link
Contributor

@zenmonkeykstop zenmonkeykstop commented Sep 23, 2019

Status

Ready for review

Description of Changes

Reorders the list of commands in the ./manage.py parser help output to put common operations first and dev-only operations last, with some description cleanup.

Changes proposed in this pull request:

Testing

  • checkout this branch and run make dev

  • verify that output of ./manage.py with no arguments looks like:

Click to view
 ./manage.py 
usage: ./manage.py [-h] [-v] [--data-root DATA_ROOT] [--store-dir STORE_DIR]
                   {add-admin,add_admin,add-journalist,add_journalist,delete-user,delete_user,check-disconnected-db-submissions,check-disconnected-fs-submissions,delete-disconnected-db-submissions,delete-disconnected-fs-submissions,list-disconnected-db-submissions,list-disconnected-fs-submissions,clean-tmp,clean_tmp,init-db,were-there-submissions-today,run,reset}
                   ...

Management and testing utility for SecureDrop.

positional arguments:
  {add-admin,add_admin,add-journalist,add_journalist,delete-user,delete_user,check-disconnected-db-submissions,check-disconnected-fs-submissions,delete-disconnected-db-submissions,delete-disconnected-fs-submissions,list-disconnected-db-submissions,list-disconnected-fs-submissions,clean-tmp,clean_tmp,init-db,were-there-submissions-today,run,reset}
    add-admin           Add an admin to the application.
    add_admin           ^
    add-journalist      Add a journalist to the application.
    add_journalist      ^
    delete-user         Delete a user from the application.
    delete_user         ^
    check-disconnected-db-submissions
                        Check for submissions that exist in the database but
                        not the filesystem.
    check-disconnected-fs-submissions
                        Check for submissions that exist in the filesystem but
                        not in the database.
    delete-disconnected-db-submissions
                        Delete submissions that exist in the database but not
                        the filesystem.
    delete-disconnected-fs-submissions
                        Delete submissions that exist in the filesystem but
                        not the database.
    list-disconnected-db-submissions
                        List submissions that exist in the database but not
                        the filesystem.
    list-disconnected-fs-submissions
                        List submissions that exist in the filesystem but not
                        the database.
    clean-tmp           Cleanup the SecureDrop temp directory.
    clean_tmp           Cleanup the SecureDrop temp directory.
    init-db             Initialize the database.
    were-there-submissions-today
                        Update the file indicating whether submissions were
                        received in the past 24h.
    run                 DANGER!!! ONLY FOR DEVELOPMENT USE. DO NOT USE IN
                        PRODUCTION. Run the Werkzeug source and journalist
                        WSGI apps.
    reset               DANGER!!! ONLY FOR DEVELOPMENT USE. DO NOT USE IN
                        PRODUCTION. Clear the SecureDrop application's state.

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose
  --data-root DATA_ROOT
                        directory in which the securedrop data is stored
  --store-dir STORE_DIR
                        directory in which the documents are stored
  • Run ./manage.py commands. verify that the correct action is invoked by each command.

Deployment

Deployed as part of securedrop app code.

Checklist

If you made non-trivial code changes:

  • I have written a test plan and validated it for this PR

@eloquence
Copy link
Member

LGTM (tested in Docker env). Output is as expected (identical to your example), commands function as expected, output is indeed better organized than before.

@conorsch
Copy link
Contributor

Reviewing locally...

@conorsch conorsch self-requested a review September 26, 2019 18:59
Copy link
Contributor

@conorsch conorsch left a comment

Choose a reason for hiding this comment

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

Verified output locally. Big improvement. Thanks, @zenmonkeykstop!

@conorsch conorsch merged commit dffb823 into freedomofpress:develop Sep 26, 2019
SecureDrop Team Board automation moved this from Ready for review to Done Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants