Merge lp:~jose/charms/precise/juju-gui/add-blank-defaults into lp:~juju-gui/charms/trusty/juju-gui/trunk

Proposed by José Antonio Rey
Status: Needs review
Proposed branch: lp:~jose/charms/precise/juju-gui/add-blank-defaults
Merge into: lp:~juju-gui/charms/trusty/juju-gui/trunk
Diff against target: 26 lines (+3/-0)
1 file modified
config.yaml (+3/-0)
To merge this branch: bzr merge lp:~jose/charms/precise/juju-gui/add-blank-defaults
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Matt Bruzek Pending
Review via email: mp+217120@code.launchpad.net

This proposal supersedes a proposal from 2014-03-26.

Description of the change

Currently, `charm proof` returns an error when there are options without defaults on the config.yaml file. I've added blank defaults for the options that didn't have them, except for login-help.

To post a comment you must log in.
Revision history for this message
Matt Bruzek (mbruzek) wrote : Posted in a previous version of this proposal

Hello Jose,

Thank you for working on this merge proposal! Your commitment to the communit is very impressive.

The current charm store policy does recommend that all configuration values have default values. However some older charms got in before this was a rule and consiquently some code actually depends on the value not being set. Since the hooks are python that is realized as a value of None in the code. When you default it to "" the configuration option is not None. We should be very careful with these kind of changes, to not break the code.

I followed all 4 configuration values through the code and believe that 3 of them are OK. But the login-help configuration value has the following code:

if login_help is None:

So when the login-help configuration option is "" it misses this block of code and the hard coded text is never set. I was able to see this text if you deploy the current juju-gui charm on the login page. If you deploy the juju-gui with your code the login text is empty and I do not believe this is what we want to happen.

Please leave the login-help configuration value without a default. I realize that charm proof will still report a warning here but this is a rare case where that is OK.

Thanks again for your work here! Keep being awesome Jose!

review: Needs Fixing
Revision history for this message
José Antonio Rey (jose) wrote : Posted in a previous version of this proposal

Hey, Matt!

Thanks so much for the comments, really appreciate it :)

I have removed the blank default from login-help. Let me know if there's anything else I should fix and I'll get right to it.

Revision history for this message
Francesco Banconi (frankban) wrote : Posted in a previous version of this proposal

Hi José,

thanks a lot for contributing to the GUI charm!
FWIW I think it should be easy enough to change utils.write_gui_config so that it handles login_help as an empty string if you prefer that strategy.

That said, the GUI charm development is done using the development branch in lp:~juju-gui/charms/trusty/juju-gui/trunk (see http://bazaar.launchpad.net/~juju-gui-charmers/charms/precise/juju-gui/trunk/view/head:/HACKING.md). When we create a new release, that branch is then pushed to the precise and trusty release branches (lp:charms/juju-gui and lp:charms/trusty/juju-gui).

Could you please re-propose your changes against that branch?
Also, please run "make lint" and "make unittest" before creating the MP.

Thanks!

Revision history for this message
José Antonio Rey (jose) wrote : Posted in a previous version of this proposal

Hi, Francesco!

I am going to make sure I do that later. Thanks for the heads up.

Revision history for this message
Matt Bruzek (mbruzek) wrote :

Hello José,

Thanks for addressing my concern about the login-help. I see no further blocking issues.

+1 LGTM.

My understanding is the juju-gui team will have to review and approve this change. Look for them to make comments on this change after they run their tests.

Thanks again for your patience on this process.

Unmerged revisions

90. By José Antonio Rey

Removed blank default from login-help

89. By José Antonio Rey

Added blank defaults for missing ones

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2014-04-15 14:17:12 +0000
3+++ config.yaml 2014-04-24 18:19:36 +0000
4@@ -66,12 +66,14 @@
5 the GUI. Both ssl-cert-contents and ssl-key-contents must be provided.
6 If not, cetificates will be automatically generated.
7 type: string
8+ default: ""
9 ssl-key-contents:
10 description: |
11 The contents of the private key file to be used in SSL connections to
12 the GUI. Both ssl-cert-contents and ssl-key-contents must be provided.
13 If not, cetificates will be automatically generated.
14 type: string
15+ default: ""
16 login-help:
17 description: |
18 The help text shown to the user on the login screen. If not provided, a
19@@ -103,6 +105,7 @@
20 If given, the password to use for the environment to immediately
21 connect. Do not set unless you understand and accept the risks.
22 type: string
23+ default: ""
24 sandbox:
25 description: |
26 Run using an in-memory sandbox rather than a real Juju backend. Sandbox

Subscribers

People subscribed via source and target branches