Skip to content

Conversation

devanshjainms
Copy link
Contributor

This pull request introduces several improvements and refactoring to the cluster status and resource validation logic, with a focus on better handling of resource parameters and provider-specific configurations. The main changes include refactoring the way HANA resource names are passed and used, adding support for retrieving and validating the priority-fencing-delay cluster parameter, and simplifying provider-based value resolution for resource validation.

Cluster Status Parameter Handling

  • Refactored the handling of HANA resource names in get_cluster_status_db.py by splitting the single hana_resource_name parameter into hana_clone_resource_name and hana_primitive_resource_name for more precise resource identification. All related Ansible task files were updated to use the new parameters. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
  • Updated the cluster status checker to retrieve both AUTOMATED_REGISTER and the new PRIORITY_FENCING_DELAY parameters, storing them in the result dictionary for downstream use and validation. [1] [2] [3] [4] [5] [6]

Provider-Specific Resource Validation

  • Refactored and simplified provider-based value resolution logic in get_pcmk_properties_scs.py by introducing helper methods _resolve_provider_values, _extract_values_from_config, and _compare_value_with_expectations. This makes provider-specific validation more robust and easier to maintain. [1] [2]

Minor Fixes and Cleanups

  • Fixed a duplicate key in the constants.yaml file for GLOBAL_INI to ensure proper configuration loading.

These changes improve the clarity, maintainability, and extensibility of cluster resource parameter handling and validation logic.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds support for retrieving cluster parameter priority-fencing-delay alongside AUTOMATED_REGISTER, refactors HANA resource handling by splitting a single hana_resource_name into distinct clone and primitive resource names, and restructures provider-specific validation logic in get_pcmk_properties_scs. Key adjustments cascade through Ansible tasks, tests, and command definitions.

  • Split hana_resource_name into hana_clone_resource_name and hana_primitive_resource_name across modules, tasks, and tests
  • Added retrieval and exposure of PRIORITY_FENCING_DELAY and refactored AUTOMATED_REGISTER retrieval
  • Introduced helper methods for provider value resolution in get_pcmk_properties_scs

Reviewed Changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/roles/mock_data/get_cluster_status_db.txt Updated mock to include new resource params and PRIORITY_FENCING_DELAY
tests/roles/mock_data/secondary_get_cluster_status_db.txt Same as above for secondary scenario
tests/modules/get_cluster_status_db_test.py Adjusted tests to new method name and params (with a misspelling)
tests/modules/get_pcmk_properties_scs_test.py Removed leftover debug print
tests/roles/ha_db_hana/*_test.py Updated command names to separated clone/primitive resource retrieval
src/vars/input-api.yaml Added separate primitive and clone resource ID command entries
src/roles/misc/tasks/pre-validations-db.yml Refactored resource ID discovery to set both clone and primitive names
src/roles/misc/tasks/cluster-report.yml Propagated new resource parameter names
src/roles/ha_db_hana/tasks/*.yml Replaced hana_resource_name with split clone/primitive names and added usage in cluster status calls
src/roles/ha_db_hana/tasks/block-network.yml Added priority-fencing-delay assertions and reporting
src/roles/ha_db_hana/tasks/files/constants.yaml Removed duplicate GLOBAL_INI key
src/modules/get_cluster_status_db.py Refactored parameter retrieval method and resource name handling (method name misspelled)
src/module_utils/commands.py Replaced AUTOMATED_REGISTER constant with lambda and added PRIORITY_FENCING_DELAY command
src/modules/get_pcmk_properties_scs.py Added helper methods for provider-based value resolution

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@devanshjainms devanshjainms requested a review from Copilot October 2, 2025 17:46
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 26 out of 26 changed files in this pull request and generated 6 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@hdamecharla hdamecharla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@mkdeegan mkdeegan merged commit b1b0f53 into Azure:development-sep-2025 Oct 3, 2025
6 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants