Updated logic for HA DB/SCS cluster configuration validation #114
Merged
devanshjainms merged 24 commits intoAzure:development-sep-2025from Sep 30, 2025
Merged
Updated logic for HA DB/SCS cluster configuration validation #114devanshjainms merged 24 commits intoAzure:development-sep-2025from
devanshjainms merged 24 commits intoAzure:development-sep-2025from
Conversation
…etrieval in get_pcmk_properties.py for improved clarity and consistency
…pdate requirements.txt for package version upgrades
…ty and handling of missing parameters
…terValidator for improved clarity and consistency; update required flag in constants.yaml
…esource constant checks; refactor to use constants-first validation approach.
…clean up parsing logic for improved clarity and maintainability.
…eters method and updating parameter retrieval to include unique IDs for improved clarity and functionality.
…ue handling by introducing a tuple format for expected values, improving clarity and consistency across configurations.
…ields for configuration parameters; update report.html to adjust warning color for better visibility.
…Validation in input-api.yaml
…roving provider value retrieval logic for better clarity and consistency.
…date constants.yaml to enhance configuration parameter structure with 'value' and 'required' fields.
…mk_properties_scs_test.py for improved readability and structure
There was a problem hiding this comment.
Pull Request Overview
This PR introduces significant refactoring to the HA cluster configuration validation codebase, shifting from a parsing-first to a "constants-first" validation strategy. The main changes ensure all expected parameters from constants are validated against the cluster information base (CIB), with improved support for offline validation and enhanced parameter handling with required status tracking.
- Introduced a new
validate_from_constantsmethod replacingparse_ha_cluster_configfor constants-first validation - Enhanced parameter handling to use tuple
(value, required)format for better tracking of required parameters - Improved status calculation to distinguish between errors, warnings, and success for more granular feedback
Reviewed Changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/module_utils/get_pcmk_properties.py | Core refactoring with new validation methods and parameter handling logic |
| src/modules/get_pcmk_properties_*.py | Updated entry points to use new validation method |
| src/roles/*/constants.yaml | Updated constants structure to include value and required fields |
| tests/ | Updated test assertions to match new tuple return format |
| src/vars/input-api.yaml | Enabled previously disabled test groups |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…requirements file for package installation
…ag for automatic confirmation
…lag for manual confirmation
…ag for automatic confirmation
…manual confirmation
KimForss
approved these changes
Sep 30, 2025
mkdeegan
pushed a commit
that referenced
this pull request
Oct 3, 2025
* Bump requests from 2.32.4 to 2.32.5 (#105) * Bump requests from 2.32.4 to 2.32.5 (#106) * Updated logic for HA DB/SCS cluster configuration validation (#114) * Restructure the documents for high availability testing (#116) * Bump pandas from 2.3.1 to 2.3.3 (#118) Bumps [pandas](https://github.com/pandas-dev/pandas) from 2.3.1 to 2.3.3. - [Release notes](https://github.com/pandas-dev/pandas/releases) - [Commits](pandas-dev/pandas@v2.3.1...v2.3.3) --- updated-dependencies: - dependency-name: pandas dependency-version: 2.3.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Devansh Jain <86314060+devanshjainms@users.noreply.github.com> * Updated commands to get the automated-register and priority fencing delay (#122) * Add provider value resolution and enhance parameter status determination logic * Refactor cluster parameter retrieval logic and update related tests * Refactor command imports and update cluster status retrieval logic to use new parameters * Refactor HANA resource handling by renaming parameters and updating related logic across multiple files * Refactor command execution logic to simplify parameter value retrieval * Fix typo in method name and update related test cases for cluster parameter retrieval * Fix inconsistent quote style in test case for cluster parameter retrieval * Update cluster parameter retrieval to include PRIORITY_FENCING_DELAY and fix typo in test case name --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant refactoring and new validation logic to the HA cluster configuration validation codebase. The main focus is shifting from a parsing-first approach to a "constants-first" validation strategy, ensuring that all expected parameters from the constants are validated against the cluster information base (CIB), with improved support for offline validation. Additionally, parameter handling is enhanced to consistently track required status and expected values, and the overall status calculation now accounts for warnings as well as errors.
Validation and Parameter Handling Improvements:
validate_from_constantsmethod inget_pcmk_properties.py, replacing the previous parsing orchestration inparse_ha_cluster_config. This ensures all expected parameters defined in constants are checked, and supports offline validation. (src/module_utils/get_pcmk_properties.py, src/module_utils/get_pcmk_properties.pyL479-R490)_validate_basic_constants,_find_param_with_element_info,_validate_resource_constants, and_validate_constraint_constantsto systematically validate parameters from constants and CIB XML, including constraints and resources. (src/module_utils/get_pcmk_properties.py, src/module_utils/get_pcmk_properties.pyL538-R669)(value, required)format, improving handling of required parameters and complex expected value types. (src/module_utils/get_pcmk_properties.py, [1] [2] [3] [4] [5]Status Calculation and Reporting:
src/module_utils/get_pcmk_properties.py, src/module_utils/get_pcmk_properties.pyL538-R669)Codebase and API Changes:
_parse_basic_config,_parse_constraints) and updated entry points inget_pcmk_properties_db.pyto use the new validation method. Also adjusted resource category exclusions for improved flexibility in resource parsing. (src/module_utils/get_pcmk_properties.py, [1] [2];src/modules/get_pcmk_properties_db.py, [3] [4]src/module_utils/sap_automation_qa.py, [1];src/modules/get_pcmk_properties_db.py, [2]