HUE-7675 [core] Warn on startup for any invalid configurations in hue.ini

Review Request #12303 - Created Jan. 5, 2018 and updated

Information
Roohi Syeda
hue
HUE-7774-Autocomplete
HUE-7675
Reviewers
hue
enricoberti, jgauthier, johan, ranade, romain, weixia, yingc
commit f631905b9a56404be2555689c4eb01de1edeac93
Author: Roohi <roohisyeda@cloudera.com>
Date:   Fri Jan 5 13:32:04 2018 -0800

    HUE-7675 [core] Warn on startup for any invalid configurations in hue.ini (Step#1)

:100644 100644 fd61bcd200... c1f6e6df86... R091	desktop/core/ext-py/configobj/configobj.py	desktop/core/ext-py/configobj-4.7.2/configobj.py
:000000 100644 0000000000... 9023a7e014... A	desktop/core/ext-py/configobj-4.7.2/docs/configobj.html
:000000 100644 0000000000... 7dab99cc6d... A	desktop/core/ext-py/configobj-4.7.2/docs/configobj.txt
:100644 100644 8ae904d0a9... 030cf1719a... R080	desktop/core/ext-py/configobj/docs/stylesheets/default.css	desktop/core/ext-py/configobj-4.7.2/docs/default.css
:000000 100644 0000000000... 0992ff26d2... A	desktop/core/ext-py/configobj-4.7.2/docs/docutils.conf
:100644 100644 4a626f1a5e... 81b3e76075... R098	desktop/core/ext-py/configobj/docs/stylesheets/voidspace_docutils.css	desktop/core/ext-py/configobj-4.7.2/docs/docutils.css
:000000 100644 0000000000... 122b4294b9... A	desktop/core/ext-py/configobj-4.7.2/docs/pygments.css
:000000 100644 0000000000... 2591bce35d... A	desktop/core/ext-py/configobj-4.7.2/docs/template.tmp
:000000 100644 0000000000... f514475752... A	desktop/core/ext-py/configobj-4.7.2/docs/validate.html
:000000 100644 0000000000... acdb263194... A	desktop/core/ext-py/configobj-4.7.2/docs/validate.txt
:000000 100644 0000000000... 63d70cc0c8... A	desktop/core/ext-py/configobj-4.7.2/setup.py
:000000 100644 0000000000... e69de29bb2... A	desktop/core/ext-py/configobj-4.7.2/tests/functionaltests/__init__.py
:000000 100644 0000000000... aa429fff49... A	desktop/core/ext-py/configobj-4.7.2/tests/functionaltests/conf.ini
:000000 100644 0000000000... 3af70acf83... A	desktop/core/ext-py/configobj-4.7.2/tests/functionaltests/conf.spec
:000000 100644 0000000000... 8afa37f03b... A	desktop/core/ext-py/configobj-4.7.2/tests/functionaltests/test_configobj.py
:000000 100644 0000000000... 4517817d15... A	desktop/core/ext-py/configobj-4.7.2/tests/functionaltests/test_validate_errors.py
:000000 100644 0000000000... d4a3410237... A	desktop/core/ext-py/configobj-4.7.2/tests/test_configobj.py
:100644 100644 30bdfacbe8... 73dbdb891b... R098	desktop/core/ext-py/configobj/validate.py	desktop/core/ext-py/configobj-4.7.2/validate.py
:100644 000000 744c153f86... 0000000000... D	desktop/core/ext-py/configobj/PKG-INFO
:100644 000000 3da3a8d3f8... 0000000000... D	desktop/core/ext-py/configobj/docs/configobj.html
:100644 000000 2e9d99c2d7... 0000000000... D	desktop/core/ext-py/configobj/docs/images/PythonPowered.png
:100644 000000 aee56bec20... 0000000000... D	desktop/core/ext-py/configobj/docs/images/new_python.gif
:100644 000000 91cd58f670... 0000000000... D	desktop/core/ext-py/configobj/docs/images/osi-certified-120x100.gif
:100644 000000 f1465f98ac... 0000000000... D	desktop/core/ext-py/configobj/docs/images/powered_by_python.jpg
:100644 000000 5b559c63e8... 0000000000... D	desktop/core/ext-py/configobj/docs/images/pythonbanner.gif
:100644 000000 ea3b477d2d... 0000000000... D	desktop/core/ext-py/configobj/docs/smilies/arrow.gif
:100644 000000 7c4bc3e466... 0000000000... D	desktop/core/ext-py/configobj/docs/smilies/badgrin.gif
:100644 000000 b64b561f00... 0000000000... D	desktop/core/ext-py/configobj/docs/smilies/biggrin.gif
:100644 000000 b4cca3bba3... 0000000000... D	desktop/core/ext-py/configobj/docs/smilies/confused.gif
:100644 000000 813f9e4cbd... 0000000000... D	desktop/core/ext-py/configobj/docs/smilies/cool.gif
:100644 000000 747f764db7... 0000000000... D	desktop/core/ext-py/configobj/docs/smilies/cry.gif
:100644 000000 1e3c2dceb2... 0000000000... D	desktop/core/ext-py/configobj/docs/smilies/doubt.gif
:100644 000000 4f88dae2a5... 0000000000... D	desktop/core/ext-py/configobj/docs/smilies/evil.gif
:100644 000000 46f576d6fa... 0000000000... D	desktop/core/ext-py/configobj/docs/smilies/exclaim.gif
:100644 000000 8e9a67329d... 0000000000... D	desktop/core/ext-py/configobj/docs/smilies/idea.gif
:100644 000000 11618c5941... 0000000000... D	desktop/core/ext-py/configobj/docs/smilies/lol.gif
:100644 000000 808e079c68... 0000000000... D	desktop/core/ext-py/configobj/docs/smilies/mad.gif
:100644 000000 ffc87920c0... 0000000000... D	desktop/core/ext-py/configobj/docs/smilies/neutral.gif
:100644 000000 a1d0230078... 0000000000... D	desktop/core/ext-py/configobj/docs/smilies/question.gif
:100644 000000 b83b6c6768... 0000000000... D	desktop/core/ext-py/configobj/docs/smilies/razz.gif
:100644 000000 4fdd3914bd... 0000000000... D	desktop/core/ext-py/configobj/docs/smilies/redface.gif
:100644 000000 8ec17a0007... 0000000000... D	desktop/core/ext-py/configobj/docs/smilies/rolleyes.gif
:100644 000000 60da9d9741... 0000000000... D	desktop/core/ext-py/configobj/docs/smilies/sad.gif
:100644 000000 7e3cd6fd9a... 0000000000... D	desktop/core/ext-py/configobj/docs/smilies/sc_smilies.pak
:100644 000000 c3c40b5352... 0000000000... D	desktop/core/ext-py/configobj/docs/smilies/shock.gif
:100644 000000 55ae95b1f2... 0000000000... D	desktop/core/ext-py/configobj/docs/smilies/smile.gif
:100644 000000 336a7852b0... 0000000000... D	desktop/core/ext-py/configobj/docs/smilies/surprised.gif
:100644 000000 dc09e0a52d... 0000000000... D	desktop/core/ext-py/configobj/docs/smilies/wink.gif
:100644 000000 f98e7a5f04... 0000000000... D	desktop/core/ext-py/configobj/docs/stylesheets/pep.css
:100644 000000 48d4095ce7... 0000000000... D	desktop/core/ext-py/configobj/docs/stylesheets/pysrc.css
:100644 000000 1c990f2bda... 0000000000... D	desktop/core/ext-py/configobj/docs/validate.html
:100644 000000 722f99ae3d... 0000000000... D	desktop/core/ext-py/configobj/setup.py
:000000 100644 0000000000... 10dbc36c5b... A	desktop/core/src/desktop/management/commands/configspec_dump.py

  

Issues

  • 29
  • 0
  • 0
  • 29
Description From Last Updated
Could we leave empty? Romain Rigaux Romain Rigaux
Could we keep commented? Romain Rigaux Romain Rigaux
Could we keep if not dev Hue won't have it Romain Rigaux Romain Rigaux
Could we comment? If the default values are not there, could you set them in the conf.py? (we should not ... Romain Rigaux Romain Rigaux
Seems invalid new ” Romain Rigaux Romain Rigaux
A lot of stuff seems gone below? Romain Rigaux Romain Rigaux
? Romain Rigaux Romain Rigaux
Why can't we generate most of this file on the fly? (and tweak it afterwards if needed) Romain Rigaux Romain Rigaux
print Romain Rigaux Romain Rigaux
This is the spec file generated for validating the hue.ini file later Roohi Syeda Roohi Syeda
This is what I was talking about. Actually the validation fails because the spec file is itself incorrect as it ... Roohi Syeda Roohi Syeda
I will remove print after testing. Roohi Syeda Roohi Syeda
This is the main file which generated the spec file. This should be run everytime some changes are made to ... Roohi Syeda Roohi Syeda
There is an issue with the spec validation module. It expects kv's to appear before any sections Roohi Syeda Roohi Syeda
Move file to desktop/lib? Romain Rigaux Romain Rigaux
? Romain Rigaux Romain Rigaux
space after around * Romain Rigaux Romain Rigaux
if self.level != 0: Romain Rigaux Romain Rigaux
same for * and spaces Romain Rigaux Romain Rigaux
space after , Romain Rigaux Romain Rigaux
Could you move it down with the other dsktp imports? Romain Rigaux Romain Rigaux
Could you move it up with Django imports? Romain Rigaux Romain Rigaux
BTW: should we move this in a function so that we can add a test? Romain Rigaux Romain Rigaux
Maybe generate as a tmp file instead? Romain Rigaux Romain Rigaux
why not 'validator' and not 'vtor'? Romain Rigaux Romain Rigaux
nit: sometimes we do message = [] message.append(string ...) '\n'.join(message) (note: \n creates a new line in the warning, or ... Romain Rigaux Romain Rigaux
nit: new line above and not below Romain Rigaux Romain Rigaux
LOG.exception() or warn ? Romain Rigaux Romain Rigaux
if _CONFIG_ERROR_LIST and _CONFIG_ERROR_LIST: ? of even just if _CONFIG_ERROR_LIST: Romain Rigaux Romain Rigaux
Romain Rigaux
Roohi Syeda
Roohi Syeda
Review request changed

Change Summary:

I dropped the last commit in rebase and added new commit as most of the changes had to be reverted

Diff:

Revision 5 (+115 -5)

Show changes

Romain Rigaux

Nice!

How about refactoring so that we can unit test it easily? (with some corner cases)

Move file to desktop/lib?

?

space after around *

if self.level != 0:

same for * and spaces

desktop/core/src/desktop/lib/conf.py (Diff revision 5)
 
 

space after ,

desktop/core/src/desktop/views.py (Diff revision 5)
 
 

Could you move it down with the other dsktp imports?

desktop/core/src/desktop/views.py (Diff revision 5)
 
 

Could you move it up with Django imports?

desktop/core/src/desktop/views.py (Diff revision 5)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

BTW: should we move this in a function so that we can add a test?

desktop/core/src/desktop/views.py (Diff revision 5)
 
 

Maybe generate as a tmp file instead?

desktop/core/src/desktop/views.py (Diff revision 5)
 
 

why not 'validator' and not 'vtor'?

desktop/core/src/desktop/views.py (Diff revision 5)
 
 
nit: sometimes we do 

message = []

message.append(string ...)


'\n'.join(message)


(note: \n creates a new line in the warning, or we should just not put it?)
desktop/core/src/desktop/views.py (Diff revision 5)
 
 

nit: new line above and not below

desktop/core/src/desktop/views.py (Diff revision 5)
 
 

LOG.exception() or warn ?

desktop/core/src/desktop/views.py (Diff revision 5)
 
 

if _CONFIG_ERROR_LIST and _CONFIG_ERROR_LIST:

?

of even just

if _CONFIG_ERROR_LIST:

Loading...