Repository navigation
[HorizonDB] Add failover command - #10607
Open
Gabriel Lobo (thegabrielobo) wants to merge 1 commit into
Open
Gabriel Lobo (thegabrielobo) wants to merge 1 commit into
Gabriel Lobo (thegabrielobo) wants to merge 1 commit into
Conversation
Add the bodyless cluster failover LRO for API 2026-10-01-preview, with standard selectors, default waiting and no-wait support. Include focused unit coverage, authentic recorded playback and documentation. ADO 5812512. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Thank you for your contribution Gabriel Lobo (@thegabrielobo)! We will review the pull request and get back to you soon. |
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The PR description still lacks the actual Azure/aaz model PR link, preventing reviewers from verifying the generated command, arguments, API version, and LRO configuration against its source model.
1 open issue
What changed in this PR
Adds az horizondb cluster failover to the HorizonDB extension for service-selected failover within a cluster’s designated read-write pool.
Changes:
- Adds a bodyless failover action using API
2026-10-01-preview, with default waiting, updated Cluster output, and--no-waitsupport. - Adds mocked command tests and a failover scenario covering pool setup, completion, and cluster state.
- Documents usage and recording precautions, and bumps the extension to
1.0.0b10.
| File | Description |
|---|---|
src/horizondb/setup.py |
Bumps the extension version to 1.0.0b10. |
src/horizondb/README.md |
Documents failover usage and scenario-test procedures. |
src/horizondb/HISTORY.rst |
Adds failover release notes. |
src/horizondb/azext_horizondb/tests/latest/unittest_cluster_failover.py |
Tests selectors, requests, polling, output, and error propagation. |
src/horizondb/azext_horizondb/tests/latest/test_horizondb_cluster.py |
Adds a failover scenario and missing-recording guard. |
src/horizondb/azext_horizondb/aaz/latest/horizondb/cluster/_failover.py |
Implements the generated failover command. |
src/horizondb/azext_horizondb/aaz/latest/horizondb/cluster/__init__.py |
Imports the new command for registration. |
Review effort: Balanced
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # | ||
| # Code generated by aaz-dev-tools |
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.

🤖 PR Validation —⚠️ Review suggested
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az horizondb cluster failoverGenerated from: Azure/aaz#1176
ADO 5812512: https://dev.azure.com/msdata/5603b9e3-ece0-4518-b9c8-1a36054d9970/_workitems/edit/5812512
Description
Adds
az horizondb cluster failoverusing the bodylessClusters_FailoverPOST action in API2026-10-01-preview.--no-wait.--yesinputs, or custom runtime orchestration.Bumps the extension version from
1.0.0b9to1.0.0b10and documents the change in HISTORY.rst / README.md.Testing
azdev style horizondb- PASSED (pylint and flake8).azdev linter horizondb- PASSED (standard rules and custom pylint rules).azdev scan --file-path <file>for each of the eight committed extension files - PASSED: no secrets detected.python scripts\ci\test_index.py -q- PASSED: 9 tests run, including 2 CI-only skips.python -m pytest src\horizondb\azext_horizondb\tests\latest\unittest_cluster_failover.py -q --disable-warnings --tb=short- PASSED: 11 tests, 23 subtests. Mocked HTTP covers bodyless POST/API version, selectors, default LRO waiting, final Cluster output,--no-waitand errors.python <task-files>\validate_failover_offline.py(task-local socket-blocked runner) - PASSED: 65 tests, 145 subtests, zero skips. Includes 63 unit tests and both recorded Cluster management/failover scenarios.python <task-files>\record_failover.py --subscription <approved-subscription> --resource-group <approved-existing-rg> --cluster <approved-new-cluster> --pool <approved-new-pool> --existing-resource-group- PASSED: 1 live scenario, zero failures/errors/skips; 969.439 seconds.python <task-files>\audit_failover_recording.py <recording>- PASSED: 33 authentic interactions; supplemental local privacy inspection passed. No response semantics were edited.python <task-files>\validate_failover_offline.py --failover-only- PASSED: 1 authentic playback scenario, zero skips, with socket connections blocked.$env:AZURE_TEST_RUN_LIVE='false',azdev test test_horizondb_cluster_failover --series --xml-path <results-dir>\failover-azdev-playback.xml- PASSED: 1 playback scenario, zero skips.aaz-dev command-model verify --aaz-path <aaz-checkout> --target horizondband task-local exact model-to-code/XML export verification - PASSED; existing command/wait selections preserved.HorizonDBClusterFailoverScenarioTestchecks pool provisioning/designation, executes failover with default waiting, checks the returned Cluster and a subsequent show, then deletes the disposable Cluster. Its operations and assertions run in both live and playback modes. The authentic fixture records one bodyless POST accepted with 202, monitor polling, and a final Location GET returning the Ready/Succeeded Cluster. Missing playback fixtures fail before resource preparation rather than skipping or implicitly recording live.--no-waitis mocked coverage; no additional disruptive failover was performed for it.Live recording used an isolated test-only helper to preserve the existing resource group and handle the installed Python 3.10 SDK's cassette-save bookkeeping defect. The first operator-run scenario passed but lost its cassette; the explicitly approved additional run retained the authentic recording and verified playback. No shared SDK or extension runtime patch was made. Cleanup of only the new test Cluster was verified.
Full-repository tests and remote CI were not run locally.
The existing shell hooks were invoked but returned early because their shared Python/discovery configuration did not recognize the isolated worktree. Secret scanning, style and linter checks were run independently and passed; no
--no-verifyor shared-hook/configuration changes were used.History Notes
az horizondb cluster failover, with default waiting, updated Cluster output and--no-wait.General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)azdev style horizondb: passed.python scripts/ci/test_index.py -qlocally? (pip install azdevrequired)python scripts\ci\test_index.py -q: passed, including 2 CI-only skips.1.0.0b9->1.0.0b10.For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.