prabhjyotsingh opened a new pull request, #4260: URL: https://github.com/apache/ambari/pull/4260
## What changes were proposed in this pull request? JIRA: [AMBARI-26677](https://issues.apache.org/jira/browse/AMBARI-26677) The React Add Service wizard persists its state as a server-side workflow checkpoint. On a cluster with several installed services this broke the wizard in three ways. - **Checkpoint too large.** Add Service saved the whole wizard state, including the Customize Services stack catalogs (`configs`, `stackLevelConfigs`, `themes`) and static metadata on every property. About eight installed services exceeded the 2 MB scoped-state limit (`WORKFLOW_STATE_TOO_LARGE`). The new `projectAddServiceValues` drops the catalogs and the per-property stack metadata: description, display name, dependency lists, raw stack default, derived theme state, and non-managed `recommendedValue`. This matches Classic `saveServiceConfigProperties`, which stores only mutable info. Step 7 rebuilds the metadata from the stack on restore. Identity, value, change-tracking, and `propertyAttributes` fields remain, so Review builds the same deploy payload and the sanitizer still recognizes password properties. The live wizard state is not modified; only the saved copy is projected. - **False credential re-entry.** `sanitizeWorkflowValues` marked an object `requires_reentry` whenever a child value was `undefined`. Unset fields such as `serviceId` or `host_id` produced markers that nothing on screen could clear, and Next failed with "Some credential values were removed from the saved checkpoint". Unset fields are now skipped. Values that were present and removed still require re-entry. - **Installed hosts lost on resume.** When a restored checkpoint already contained `HOST_STATUS` and `MASTERS`, the provider never loaded installed hosts. The stack advisor request then had an empty host list and failed. The host-loading effect now also runs when `installedHosts` is empty. The React baseline note in `docs/frontend-refactor/react-current/07-cluster-installation-gap.md` records the checkpoint behavior. ## How was this patch tested? Run from `ambari-web/latest` on this branch, based on trunk `5228d58356`: - `npx vitest run src/Utils/scopedWorkflow.test.ts src/screens/Services/AddServiceWizard`: 3 files, 44 tests passed. - `npx vitest run` (full suite): 261 files, 1498 tests passed. - `npx tsc --noEmit -p .`: exit 0. - `npm run build`: succeeded. New tests: - The projection keeps what Review, deploy, and restore read, and drops the stack metadata. - Review builds the same deploy payload from a projected checkpoint (new service and installed-service change). - Password values stay out of a projected checkpoint. - Unset fields do not require re-entry; a removed credential still does. - The live wizard state is not mutated. - The provider loads installed hosts after restoring a checkpoint that already holds host and master steps. This test fails without the fix. Manual: on a cluster with HDFS, YARN, MapReduce2, Hive, HBase, Tez, and ZooKeeper installed, adding Ranger previously failed at Customize Services with `WORKFLOW_STATE_TOO_LARGE`. With this change the checkpoint saved at about 1.8 MB and the wizard continued. 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]
