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

Simplify the testing matrix and add isort #22

Merged
merged 4 commits into from
Jan 4, 2018
Merged

Conversation

willbarton
Copy link
Member

@willbarton willbarton commented Jan 2, 2018

This PR does the following:

  • Simplify our testing matrix to test against LTS versions of Django and Wagtail only (as well as Wagtail 1.10, which CFPB is still using)
  • Updates the flake8 configuration and adds isort to comply with CFPB's Python standards
  • Updates the README slightly.

@willbarton willbarton changed the title Testing sorting Simplify the testing matrix and add isort Jan 2, 2018
Copy link
Member

@chosak chosak left a comment

Choose a reason for hiding this comment

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

LGTM. A few minor comments.


To use Wagtail-Flags you first need to define the flag, use the flag in code, and define conditions for the flag to be enabled.
To use Wagtail-Flags you first need to define the flag, use the flag, and define conditions for the flag to be enabled.

First, define the flag in Django `settings.py`:

Copy link
Member

Choose a reason for hiding this comment

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

This wasn't changed in this PR, but as part of reviewing this I noticed a missing ) at the end of line 94. Instead of

url(r'^/mypage$', TemplateView.as_view(template_name='mytemplate.html'),

it should be

url(r'^/mypage$', TemplateView.as_view(template_name='mytemplate.html')),

README.md Outdated
from flags.state import flag_enabled

if flag_enabled('MY_FLAG', request=a_request):
print("My feature flag is enabled")
Copy link
Member

Choose a reason for hiding this comment

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

Is this intentionally indented 8 spaces instead of 4?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope!

README.md Outdated
Django templates:

```django
{% flag_enabled 'MY_FLAG' as my_flag %}
Copy link
Member

Choose a reason for hiding this comment

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

It might be nice to include the

{% load feature_flags %}

line here (as above in Quickstart) as this is necessary for this tag to work.

README.md Outdated
Jinja2 templates:

```jinja
{% if flag_enabled('MY_FLAG', request) %}
Copy link
Member

Choose a reason for hiding this comment

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

Will this work in Jinja if you don't explicitly include this in the global environment, i.e. an entry here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope! I'll add that.

Copy link
Member

@higs4281 higs4281 left a comment

Choose a reason for hiding this comment

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

Looks good.

One nit, not related to this PR: The cfgov-refresh link at the very bottom of the README throws a 404.

@willbarton
Copy link
Member Author

@higs4281 fixed that too!

@willbarton willbarton merged commit aa891b7 into master Jan 4, 2018
@willbarton willbarton deleted the testing-sorting branch January 4, 2018 21:56
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.

3 participants