prabhjyotsingh opened a new pull request, #4261:
URL: https://github.com/apache/ambari/pull/4261

   ## What changes were proposed in this pull request?
   
   JIRA: [AMBARI-26676](https://issues.apache.org/jira/browse/AMBARI-26676)
   
   The React Customize Services (Configs) step does not follow the Classic UI
   in four ways. Together they made adding a service such as Ranger impossible
   to finish. The PR has two commits.
   
   **Commit 1: Add recommended properties the stack does not define.**
   Stack Advisor can recommend properties the stack does not define, such as
   core-site `hadoop.proxyuser.<user>.hosts/groups`. Classic creates them under
   "Custom <config-type>" (step7 `_createNewProperty`). React only updated
   existing properties, so the deployed core-site lacked them.
   `addByRecommendations` now adds them to the matching Custom section through
   the new `recommendedConfigProperty` helper. This applies to cluster creation
   and Add Service.
   
   **Commit 2: Align Customize Services with Classic for Add Service.**
   
   - **Recommendations for the services being added.**
     `updateConfigsByRecommendations` assigned recommended values only for
     cluster creation or outside a wizard. Classic
     `_updateConfigByRecommendation` sets the value whenever
     `allowUpdateProperty` passes, except for the config being edited and values
     the user overrode. React now applies recommendations directly to properties
     of the services being added. Installed-service changes remain reviewable
     dependent recommendations.
     The Step 7 tab child (`RestAllTabs` → `Config`) receives every in-scope
     service as `installedServices`, because that list also feeds the advisor
     request. Step 7 therefore passes the cluster's real installed list
     separately as `clusterInstalledServices`, used only for this decision.
     Effect: Ranger `ranger.jpa.jdbc.url` and `ranger_privelege_user_jdbc_url`
     now follow `admin-properties/db_host`.
   - **Test Connection host.** The Ranger database Theme `test-db-connection`
     widget requires `ranger-site/ranger_admin_hosts`, which is not a stack
     config. As in Classic `test_db_connection_widget_view`, React now derives
     the component (`RANGER_ADMIN`) from the property name and uses the hosts
     assigned on the Masters step (`masterHostsByComponent`). A real config
     property still takes precedence.
   - **Add Service Next gate.** Add Service renders one configuration view with
     no category tabs. A hidden `credentials` category stayed selected when a
     credentials Theme existed, and the Next effect returns early for that
     category. Next therefore stayed disabled after any recommendation or
     validation finished. Add Service now always uses the All Configurations
     rule, matching Classic `step7.hbs`, which binds Next to `isSubmitDisabled`.
   
   The React baseline notes in
   `docs/frontend-refactor/react-current/07-cluster-installation-gap.md`
   record each behavior and its Classic counterpart.
   
   ## How was this patch tested?
   
   Run from `ambari-web/latest` on this branch, based on trunk `5228d58356`:
   
   - `npx vitest run` (full suite): 265 files, 1511 tests passed.
   - `npx tsc --noEmit -p .`: exit 0.
   - `npm run build`: succeeded.
   - First commit alone: `npx tsc --noEmit -p .` exit 0, and
     `npx vitest run src/hooks src/screens/ClusterWizard` 45 files, 216 tests
     passed.
   
   New tests:
   
   - `useEnhancedConfigs.addByRecommendations.test.tsx` and
     `recommendedConfigProperty.test.ts`: stack-undefined recommended
     properties reach the deploy payload; a rejected recommendation stays out;
     no duplicates.
   - `useEnhancedConfigs.updateByRecommendations.test.tsx`:
     - a new service takes recommended values;
     - user-typed values are kept;
     - installed-service values stay reviewable;
     - the Step 7 child applies recommendations with `clusterInstalledServices`;
     - cluster creation is unchanged.
     The new-service case fails without the fix.
   - `testConnectionUtils.componentHosts.test.ts`:
     - host mapping from Masters data;
     - Ranger source host resolution;
     - no assigned host;
     - a missing required value still blocks;
     - a real config wins.
   - `Step7/index.test.tsx`: Add Service Next re-enables after a
     recommendation settles when a credentials Theme exists. This test fails
     without the fix.
   
   Manual: on a cluster adding Ranger, changing the Ranger DB host updated both
   JDBC connect strings, Test Connection enabled once its inputs were valid, and
   Next enabled after the required credentials were filled in.
   
   Please review [Ambari Contributing 
Guide](https://cwiki.apache.org/confluence/display/AMBARI/How+to+Contribute) 
before opening a pull request.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to