-
Notifications
You must be signed in to change notification settings - Fork 13
Updated logic for HA DB/SCS cluster configuration validation #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated logic for HA DB/SCS cluster configuration validation #114
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_constants
method replacingparse_ha_cluster_config
for 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
* 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 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_constants
method 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_constants
to 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.py
to 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]