[ 
https://issues.apache.org/jira/browse/AMBARI-11216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14548476#comment-14548476
 ] 

Hudson commented on AMBARI-11216:
---------------------------------

SUCCESS: Integrated in Ambari-trunk-Commit #2635 (See 
[https://builds.apache.org/job/Ambari-trunk-Commit/2635/])
AMBARI-11216 Refactor service-config 'defaultValue' property into 'savedValue' 
and 'recommendedValue'. (ababiichuk) (ababiichuk: 
http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=07616603c4388c0a9c1dc769659de92edb64b2cb)
* ambari-web/test/controllers/main/service/info/config_test.js
* ambari-web/app/data/HDP2.3/site_properties.js
* ambari-web/app/messages.js
* ambari-web/app/data/HDP2/secure_properties.js
* ambari-web/app/models/configs/objects/service_config.js
* ambari-web/app/controllers/main/admin/kerberos.js
* ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js
* ambari-web/app/mappers/configs/config_versions_mapper.js
* ambari-web/test/views/common/configs/widgets/slider_config_widget_view_test.js
* ambari-web/test/utils/configs/config_property_helper_test.js
* ambari-web/app/views/common/configs/widgets/directory_config_widget_view.js
* ambari-web/app/templates/common/modal_popups/dependent_configs_list.hbs
* ambari-web/app/data/HDP2.2/site_properties.js
* ambari-web/app/views/common/configs/widgets/combo_config_widget_view.js
* 
ambari-web/test/controllers/main/admin/highAvailability/resourceManager/step3_controller_test.js
* ambari-web/app/views.js
* ambari-web/app/views/common/configs/widgets/config_widget_view.js
* ambari-web/app/views/common/configs/widgets/list_config_widget_view.js
* ambari-web/app/data/HDP2/rm_ha_properties.js
* ambari-web/app/views/common/configs/widgets/time_interval_spinner_view.js
* ambari-web/app/models/configs/config_property.js
* ambari-web/app/controllers/main/service/info/configs.js
* ambari-web/test/mock_data_setup/configs_mock_data.js
* ambari-web/test/controllers/wizard/step7_test.js
* ambari-web/app/models/configs/objects/service_config_property.js
* ambari-web/app/mixins/common/configs/configs_saver.js
* ambari-web/app/data/BIGTOP/site_properties.js
* ambari-web/test/mappers/configs/config_versions_mapper_test.js
* 
ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
* ambari-web/test/controllers/wizard/step8_test.js
* ambari-web/test/views/common/configs/widgets/toggle_config_widget_view_test.js
* ambari-web/app/controllers/wizard/step7_controller.js
* ambari-web/test/views/common/configs/widgets/list_config_widget_view_test.js
* ambari-web/test/views/common/controls_view_test.js
* ambari-web/test/mappers/configs/stack_config_properties_mapper_test.js
* ambari-web/app/data/HDP2/ha_properties.js
* ambari-web/app/controllers/wizard/step8_controller.js
* ambari-web/app/utils/config.js
* ambari-web/test/controllers/wizard_test.js
* ambari-web/app/views/common/configs/widgets/checkbox_config_widget_view.js
* ambari-web/test/data/HDP2/site_properties_test.js
* ambari-web/test/views/common/configs/service_configs_by_category_view_test.js
* ambari-web/app/data/HDP2/custom_configs.js
* ambari-web/app/mappers/configs/stack_config_properties_mapper.js
* ambari-web/test/utils/config_test.js
* ambari-web/test/models/configs/config_property_test.js
* ambari-web/app/views/common/configs/service_configs_by_category_view.js
* ambari-web/app/utils/configs/config_property_helper.js
* ambari-web/app/controllers/wizard.js
* ambari-web/app/views/common/configs/widgets/plain_config_text_field.js
* ambari-web/app/views/common/modal_popups/prompt_popup.js
* ambari-web/app/models/configs/stack_config_property.js
* 
ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step3_controller.js
* ambari-web/app/data/HDP2/site_properties.js
* ambari-web/app/views/common/controls_view.js
* ambari-web/app/data/PHD/site_properties.js
* ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
* ambari-web/app/views/common/configs/widgets/toggle_config_widget_view.js
* ambari-web/test/models/configs/objects/service_config_property_test.js
* ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js
* ambari-web/app/mixins/common/configs/enhanced_configs.js


> Refactor service-config 'defaultValue' property into 'savedValue' and 
> 'recommendedValue'
> ----------------------------------------------------------------------------------------
>
>                 Key: AMBARI-11216
>                 URL: https://issues.apache.org/jira/browse/AMBARI-11216
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-web
>    Affects Versions: 2.1.0
>            Reporter: Andrii Babiichuk
>            Assignee: Andrii Babiichuk
>            Priority: Critical
>             Fix For: 2.1.0
>
>         Attachments: AMBARI-11216.patch
>
>
> {{App.ServiceConfigProperty}} class has this property called {{defaultValue}} 
> which is overloaded and confusing. We want to refactor it into distinct 
> properties called {{savedValue}} and {{recommendedValue}}.
> *Background*
> Originally this property represented the default value provided by the 
> {{/api/v1/stacks}} endpoint so that when installing cluster the {{value}} 
> could be accurately populated. Later to support the _Undo_ action we put the 
> values saved in {{/api/v1/clusters/c1/configurations}} into the same 
> {{defaultValue}} property. So if {{/api/v1/stacks}} had value '1', and user 
> saved '2', then {{defaultValue}} would become '2'. If ever {{value}} differed 
> from {{defaultValue}}, then _Undo_ action and other logics would trigger.
> *Problem*
> With the increasing usage of {{/recommendations}} endpoint for config's 
> dynamic values and value-attributes, the {{defaultValue}} is getting complex 
> to understand and comprehend. We generally tend to update {{defaultValue}} 
> whenever {{value}} is updated - which is hard to explain. For example in the 
> add-service wizard we [suppress any updates to 
> core-site.xml|https://github.com/apache/ambari/blob/trunk/ambari-web/app/controllers/wizard/step8_controller.js#L864]
>  because we cannot tell when core-site.xml configs were changed from what is 
> saved on server.
> *Proposal*
> Each config should have 3 values, as they are 3 different entities:
> # {{value}} - Represents the value shown in UI only to the user
> # {{savedValue}} - Represents the value saved in Ambari DB in 
> {{/api/v1/clusters/c1/configurations}}. Should only be set when loading 
> configs from API.
> # {{recommendedValue}} - Represents the value either provided by 
> {{/api/v1/stacks}} or by {{/recommendations}}. 
> This will cleanly differentiate the purpose of each variable. This will have 
> an effect on the logic used like {{#isNotDefaultValue}} and 
> {{#isOverrideChanged}} etc.
> Undo action should be whenever {{value}} != {{savedValue}}.
> Set recommended action should be whenever {{value}} != {{recommendedValue}}
> Add-service wizard should basically save only those config-types which have 
> {{value}} != {{savedValue}} etc.
> The change might be as simple as renaming {{defaultValue}} to {{savedValue}}, 
> but the semantics will be clearer to understand and code.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to