-
Notifications
You must be signed in to change notification settings - Fork 14
Add hana_resource_name parameter to HANA tasks to get hana resource name dynamically #95
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
Add hana_resource_name parameter to HANA tasks to get hana resource name dynamically #95
Conversation
…ommit suggestion Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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
Enhance HANA task flexibility by adding an optional hana_resource_name parameter throughout the module, roles, and tests to allow dynamic resource name handling.
- Introduce
hana_resource_nameparameter inget_cluster_status_dbmodule and its invocation - Update role task files to pass through
hana_resource_namewith backward-compatible default - Adjust tests and mock data to include the new parameter and inject
commandsfor pre-validation logic
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/roles/mock_data/*.txt | Added hana_resource_name to module argument specs in mock data |
| tests/roles/ha_db_hana/*_test.py | Injected commands variable and updated extra_vars_override |
| tests/modules/get_cluster_status_db_test.py | Added fixture values for hana_resource_name |
| src/roles/misc/tasks/pre-validations-db.yml | Implement pre-validation tasks to fetch and set hana_resource_name |
| src/roles/misc/tasks/cluster-report.yml | Pass hana_resource_name into cluster report collection |
| src/roles/ha_db_hana/tasks/*.yml | Propagate hana_resource_name into all get_cluster_status_db calls |
| src/modules/get_cluster_status_db.py | Extend checker constructor, logic, and argument spec for new parameter |
Comments suppressed due to low confidence (2)
src/roles/misc/tasks/pre-validations-db.yml:27
- The play uses the
commandsvariable but it isn’t defined in defaults. Consider documentingcommandsindefaults/main.ymlor providing a fallback to avoid undefined variable errors when not explicitly passed.
set -o pipefail && {{ commands
src/roles/misc/tasks/pre-validations-db.yml:24
- [nitpick] This task name is duplicated within the same block; consider making the inner task’s name more descriptive (e.g., include
shellorregisteraction) to improve readability in logs.
- name: "Pre validation: Get HANA resource id for saphanasr_angi"
KimForss
left a comment
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.
Looks good to me
This pull request introduces support for a new optional parameter,
hana_resource_name, across multiple modules and roles in the codebase. The changes enhance flexibility in handling HANA resource names and improve compatibility with various configurations. The most important changes include updates to theget_cluster_status_db.pymodule and modifications to task files within theha_db_hanarole to incorporate the new parameter.Updates to
get_cluster_status_db.py:hana_resource_name, to the__init__method and updated theresultdictionary to include this parameter. (src/modules/get_cluster_status_db.py)_process_node_attributesmethod to dynamically usehana_resource_namefor constructing synchronization attributes, with a fallback to the default format. (src/modules/get_cluster_status_db.py)run_modulefunction to accepthana_resource_nameas an optional parameter and pass it to thechecker.run()method. (src/modules/get_cluster_status_db.py) [1] [2]Updates to
ha_db_hanarole task files:hana_resource_nameparameter into various task files (e.g.,block-network.yml,fs-freeze.yml,primary-crash-index.yml, and others) to support its usage during task execution. (src/roles/ha_db_hana/tasks) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]src/roles/ha_db_hana/tasks) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]