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

Added alert to admin interface of instances still on Trusty after Mar 4 #4055

Merged

Conversation

zenmonkeykstop
Copy link
Contributor

@zenmonkeykstop zenmonkeykstop commented Jan 21, 2019

Status

Ready for review

Description of Changes

Fixes #4027. Adds a red bar at the top of the page for logged-in users of the Journalist Interface, warning them that their instance's server OS is EOL and must be upgraded. This message only appears if the system date is Mar 4 2019 or later and the OS version string is not "16.04"

Visually, the bar element should match the mockup in #4027 with the exception of the shade of red used - as coded, it uses the red warning color predefined in the application's stylesheets.

Testing

Testing in a development environment

The date for the alert to start appearing, and the OS version to test for, are set in journalist_app/__init__.py:

XENIAL_WARNING_DATE = datetime.strptime('Mar 4 2019', '%b %d %Y'),      
XENIAL_VER = '16.04'   

The simplest way to test the alert behaviour is to modify these config settings and restart the Journalist Interface application.

  • Set XENIAL_WARNING_DATE to tomorrow, and verify that the alert is NOT displayed
  • Set XENIAL_WARNING_DATE to tomorrow and XENIAL_VER to "14.04", and verify that the alert is NOT displayed
  • Set XENIAL_WARNING_DATE to yesterday and XENIAL_VER to "14.04", and verify that the alert is NOT displayed
  • Set XENIAL_WARNING_DATE to yesterday and XENIAL_VER to "16.04", and verify that the alert is displayed

Testing in staging

  • Modify the XENIAL_WARNING_DATE in securedrop/journalist_app/__init__.py to yesterday, and create a (Trusty) staging environment with make build-debs && make staging. Verify that the warning is displayed
  • Modify the XENIAL_WARNING_DATE in securedrop/journalist_app/__init__.py to yesterday, and create a (Trusty) staging environment with `make build-debs && make staging. Verify that the warning is displayed.
  • Modify the XENIAL_WARNING_DATE in securedrop/journalist_app/__init__.py to yesterday, and create a (Trusty) staging environment with make build-debs && molecule converge -s libvirt-staging-xenial. Verify that the warning is not displayed.

Checklist

If you made changes to the server application code:

  • Linting (make ci-lint) and tests (make -C securedrop test) pass in the development container

If you made non-trivial code changes:

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

securedrop/journalist_templates/base.html Outdated Show resolved Hide resolved
securedrop/journalist_app/__init__.py Show resolved Hide resolved
securedrop/tests/test_journalist.py Outdated Show resolved Hide resolved
Copy link
Contributor

@kushaldas kushaldas left a comment

Choose a reason for hiding this comment

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

screenshot from 2019-01-22 20-31-37

The bar looks very nice. But, in my case, both Xenial and Trusty is showing me the bar. Can anyone also please double check this?

@zenmonkeykstop
Copy link
Contributor Author

@kushaldas apologies, was getting caught out by apparmor rules - works now.

Copy link
Contributor

@kushaldas kushaldas left a comment

Choose a reason for hiding this comment

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

Now things are working as intended. I will wait for others to approve the text in the banner though.

Copy link
Contributor

@emkll emkll left a comment

Choose a reason for hiding this comment

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

Thanks @zenmonkeykstop this looks great. Functional testing in staging VM looks good to me, the apparmor profiles seem to work well. Otherwise, I've left a couple minor comments inline.

I'll let others chime in on the final wording, but it sounds good to me.

securedrop/tests/test_journalist.py Show resolved Hide resolved
securedrop/journalist_templates/base.html Show resolved Hide resolved
Copy link
Contributor

@heartsucker heartsucker left a comment

Choose a reason for hiding this comment

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

I ran through the full test suite for both dev and staging environments. Good to go.

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.

6 participants