Commit df6c780
Create Azure adapter: SQLServerFailoverGroup (#4539)
<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
## Summary
Creates a new Azure adapter for SQL Server Failover Groups, following
the azure-adapter-creation skill workflow.
## Changes
### New Files
- `sources/azure/clients/sql-failover-groups-client.go` - Client
interface for Azure SQL Failover Groups SDK
- `sources/azure/manual/sql-server-failover-group.go` -
SearchableWrapper adapter implementation
- `sources/azure/manual/sql-server-failover-group_test.go` - Unit tests
- `sources/azure/integration-tests/sql-server-failover-group_test.go` -
Integration tests (requires SQL admin credentials)
- `sources/azure/shared/mocks/mock_sql_failover_groups_client.go` -
Generated mock
### Modified Files
- `sources/azure/manual/adapters.go` - Registered the adapter
## Implementation Details
- **Wrapper type**: SearchableWrapper (client.Get takes
resourceGroupName, serverName, failoverGroupName)
- **UniqueAttribute**: Composite key via
`shared.CompositeLookupKey(serverName, failoverGroupName)`
- **SDK package**: `armsql/v2` (already in go.mod)
- **Parent adapter**: `sql-server.go` already has SEARCH link to this
child type
### Linked Items
- Parent SQL Server (GET)
- Partner servers (GET with cross-resource-group scope extraction)
- Databases in the failover group (GET with composite key)
- Read-only endpoint target server (GET)
### Health Mapping
- Empty string / normal → HEALTH_OK
- CATCH_UP, PENDING, SEEDING → HEALTH_PENDING
- SUSPENDED → HEALTH_WARNING
- Unknown states → HEALTH_UNKNOWN
## Self-Review Checklist
- [x] **IAMPermissions**: Present, references
`Microsoft.Sql/servers/failoverGroups/read`
- [x] **PredefinedRole**: Present, uses `Reader`
- [x] **LinkedItemQueries**: 4 link types verified (parent server,
partner servers, databases, target server)
- [x] **PotentialLinks**: 2 types listed (SQLServer, SQLDatabase),
matches LinkedItemQueries
- [x] **Unit tests**: All passing (Get, Search, SearchStream,
StaticTests, ErrorHandling, edge cases)
- [x] **Integration test**: Present and structurally correct (skips when
SQL admin credentials not available)
All checklist items passed. Ready for review.
## Testing
Unit tests pass:
```
=== RUN TestSqlServerFailoverGroup
--- PASS: TestSqlServerFailoverGroup (0.03s)
--- PASS: TestSqlServerFailoverGroup/Get
--- PASS: TestSqlServerFailoverGroup/Get_WithInsufficientQueryParts
--- PASS: TestSqlServerFailoverGroup/GetWithEmptyServerName
--- PASS: TestSqlServerFailoverGroup/GetWithEmptyFailoverGroupName
--- PASS: TestSqlServerFailoverGroup/Search
--- PASS: TestSqlServerFailoverGroup/SearchStream
--- PASS: TestSqlServerFailoverGroup/SearchWithEmptyServerName
--- PASS: TestSqlServerFailoverGroup/Search_InvalidQueryParts
--- PASS: TestSqlServerFailoverGroup/Search_WithNilName
--- PASS: TestSqlServerFailoverGroup/ErrorHandling_Get
--- PASS: TestSqlServerFailoverGroup/ErrorHandling_Search
--- PASS: TestSqlServerFailoverGroup/InterfaceCompliance
```
Linting passes:
```
golangci-lint run ./sources/azure/...
0 issues.
```
Resolves ENG-3551
<!-- CURSOR_AGENT_PR_BODY_END -->
Linear Issue:
[ENG-3551](https://linear.app/overmind/issue/ENG-3551/create-azure-adapter-sqlserverfailovergroup)
<div><a
href="https://cursor.com/agents/bc-395e64c7-6cd3-437f-ac44-70ac02f0a153"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a
href="https://cursor.com/background-agent?bcId=bc-395e64c7-6cd3-437f-ac44-70ac02f0a153"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a> </div>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Lionel Wilson <Lionel-Wilson@users.noreply.github.com>
GitOrigin-RevId: b1a861686385e61721059943f5ab67671b29a93b1 parent ff79a8a commit df6c780
6 files changed
Lines changed: 1553 additions & 0 deletions
File tree
- sources/azure
- clients
- integration-tests
- manual
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
0 commit comments