-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Fix #2271: Add documentation about minification flag and check for bad pattern before committed. #2298
Conversation
Hi @gvishal PTAL. |
@@ -33,6 +33,10 @@ | |||
IS_MINIFIED = os.environ.get('MINIFICATION') == 'True' | |||
|
|||
# Whether we should serve the development or production experience. | |||
# This is environment specific variable(DEV_MODE) changes to true only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/changes to true/changes to false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's an edited version: "DEV_MODE should only be changed to False in the production environment. To use minified resources in the development environment, change the MINIFICATION env variable in app.yaml to True."
@makoscafee -- I still don't understand what DEV_MODE is, though (I don't know what you mean by an "environment-specific variable"). Can you perhaps explain what it affects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when server starts there are variable that are set based on the environment the server has been started from, and DEV_MODE is set to true only if the SERVER_SOFTWARE is development meaning is just run from the local computer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I get that from looking at the file. But what is the actual effect of DEV_MODE being set to True/False -- what does it affect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooh ok like adding numpy in development mode, clearing cookies, set the dev mode green label that appears only in dev_mode ... I think only those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see! OK, then add an additional comment:
When DEV_MODE is True, this indicates that we are not running in the production App Engine environment, which affects things like login/logout URLs, as well as third-party libraries that App Engine normally provides.
@makoscafee Looks good! Left some minor comments. Thanks! |
@@ -108,6 +108,12 @@ | |||
'core/templates/dev/head/expressions/typeParserSpec.js')} | |||
} | |||
|
|||
BAD_PATTERNS_YAML = { | |||
'MINIFICATION: true': { | |||
'message': 'Please set minification to false(MINIFICATION: false)', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please set the MINIFICATION env variable in app.yaml to False before committing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Current coverage is 47.99% (diff: 100%)@@ develop #2298 diff @@
==========================================
Files 190 190
Lines 15921 15921
Methods 2733 2733
Messages 0 0
Branches 2696 2696
==========================================
Hits 7642 7642
Misses 8279 8279
Partials 0 0
|
@@ -95,7 +95,7 @@ for arg in "$@"; do | |||
fi | |||
done | |||
|
|||
# Set value of MINIFICATION variable in app.yaml | |||
# Updates value of MINIFICATION variable in app.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Updates/Update
@@ -110,5 +110,8 @@ libraries: | |||
version: '1.6.1' | |||
- name: webapp2 | |||
version: '2.5.2' | |||
# This environmental variable is for serving minified resources | |||
# when set True. It is used to run server as prod environment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set True --> set to true
And let's not confuse "prod" with "minified". Maybe say: It allows minified resources to be used when running the server in the dev environment.
A few more small comments, otherwise lgtm! |
LGTM. Thanks @makoscafee! @gvishal, does it look good to you? If so, we can merge this. |
@makoscafee @seanlip LGTM! |
…d pattern before committed. (#2298) * : * fix linting problems" * test the precommint minification check * fix lint error * remove unused variable * tryin to see if it changes * add pattern check for minification variable * fix linting error * addressed review comments * added more documentations for DEV_MODE variable * addresed sean review comments
…or bad pattern before committed. (oppia#2298) * : * fix linting problems" * test the precommint minification check * fix lint error * remove unused variable * tryin to see if it changes * add pattern check for minification variable * fix linting error * addressed review comments * added more documentations for DEV_MODE variable * addresed sean review comments
added documentation about --prod_env flag, MINIFICATION and DEV_MODE variables and added the check for app.yaml for any change in MINIFICATION variable.
fix #2271.