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

Fix #2271: Add documentation about minification flag and check for bad pattern before committed. #2298

Merged
merged 11 commits into from
Jul 26, 2016

Conversation

makoscafee
Copy link
Contributor

@makoscafee makoscafee commented Jul 26, 2016

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.

@makoscafee makoscafee changed the title Minification flag doc Add documentation about minification flag and check for bad pattern before committed fix #2271 Jul 26, 2016
@makoscafee makoscafee changed the title Add documentation about minification flag and check for bad pattern before committed fix #2271 Fix #2271: Add documentation about minification flag and check for bad pattern before committed. Jul 26, 2016
@makoscafee
Copy link
Contributor Author

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
Copy link
Contributor

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

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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.

@gvishal
Copy link
Contributor

gvishal commented Jul 26, 2016

@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)',
Copy link
Member

@seanlip seanlip Jul 26, 2016

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@codecov-io
Copy link

codecov-io commented Jul 26, 2016

Current coverage is 47.99% (diff: 100%)

Merging #2298 into develop will not change coverage

@@            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          

Powered by Codecov. Last update fe5438e...bb7fb79

@@ -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
Copy link
Contributor

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
Copy link
Member

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.

@seanlip
Copy link
Member

seanlip commented Jul 26, 2016

A few more small comments, otherwise lgtm!

@seanlip
Copy link
Member

seanlip commented Jul 26, 2016

LGTM. Thanks @makoscafee!

@gvishal, does it look good to you? If so, we can merge this.

@gvishal
Copy link
Contributor

gvishal commented Jul 26, 2016

@makoscafee @seanlip LGTM!

@seanlip seanlip merged commit aa4e928 into oppia:develop Jul 26, 2016
@makoscafee makoscafee deleted the minification-flag-doc branch July 26, 2016 09:22
wxyxinyu pushed a commit that referenced this pull request Aug 8, 2016
…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
ctao5660 pushed a commit to ctao5660/oppia that referenced this pull request Nov 23, 2018
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modification to app.yaml when enabling minified version in dev mode.
4 participants