Skip to content

fix(providers/azure): send canonical reservedResourceType enum values - #1208

Merged
cristim merged 1 commit into
mainfrom
fix/arch-01-azure-reserved-resource-type
Jul 16, 2026
Merged

fix(providers/azure): send canonical reservedResourceType enum values#1208
cristim merged 1 commit into
mainfrom
fix/arch-01-azure-reserved-resource-type

Conversation

@cristim

@cristim cristim commented Jun 10, 2026

Copy link
Copy Markdown
Member

Problem

Closes #1189 (review finding ARCH-01, P2).

The Azure SQL Database and Synapse reservation purchase bodies sent hand-written reservedResourceType literals that are not members of the armreservations.ReservedResourceType enum:

  • providers/azure/services/database/client.go: "SqlDatabase" (canonical: "SqlDatabases")
  • providers/azure/services/synapse/client.go: "SqlDW" (canonical: "SqlDataWarehouse")

Once the #731 role fix makes non-VM Azure purchases reachable, calculatePrice would reject these values, breaking the purchase path for both services. This repeats the PR #1047 failure mode ("MEMORY_MB" instead of the SDK's "MEMORY").

Fix

  • Replace both bad literals with the SDK constants string(armreservations.ReservedResourceTypeSQLDatabases) and string(armreservations.ReservedResourceTypeSQLDataWarehouse).
  • Convert the already-correct literals in cache, cosmosdb, compute, and managedredis purchase bodies to their SDK constants (ReservedResourceTypeRedisCache, ReservedResourceTypeCosmosDb, ReservedResourceTypeVirtualMachines), so every expressible purchase body value is a compile-time-checked enum member. Zero behavior change for these four.
  • Audit results requested by the finding:
    • managedredis "RedisCache": valid enum member, now uses the SDK constant.
    • search "SearchService": has no counterpart in the armreservations enum in v1.1.0 or v2.0.0 (no search/cognitive-search member exists at all), so it cannot be expressed as an SDK constant; documented in a comment and left for live-catalog verification.
    • The Advisor/Consumption filter literal resourceType eq 'SqlDatabase' at database/client.go:173 is a different API surface (armconsumption reservation recommendations filter, not the Capacity purchase enum) and is intentionally left unchanged here; it needs live verification before touching the read path.

Tests

New regression tests capture the calculatePrice request body and assert the sent reservedResourceType equals the SDK constant AND is a member of armreservations.PossibleReservedResourceTypeValues():

  • TestDatabaseClient_PurchaseCommitment_CanonicalReservedResourceType
  • TestPurchaseCommitment_canonicalReservedResourceType (synapse)

Verified both FAIL against the pre-fix code (stash fix, run, unstash): expected "SqlDatabases" got "SqlDatabase", expected "SqlDataWarehouse" got "SqlDW".

Verification run:

  • go build ./... (root module and providers/azure module): pass
  • go vet ./providers/azure/...: clean
  • go test ./services/... in providers/azure: 495 passed in 9 packages

Summary by CodeRabbit

  • Refactor
    • Updated Azure reserved-capacity purchase requests to use Azure SDK-defined reserved resource type constants for Cache, Compute, Cosmos DB, SQL Database, Managed Redis, and Synapse (improves consistency/canonical values).
    • Added a clarifying note for SearchService, which remains hard-coded due to no available SDK enum.
  • Tests
    • Added/extended regression coverage to verify the canonical reservedResourceType values sent in the calculatePrice request for SQL Database and Synapse.

@cristim cristim added triaged Item has been triaged priority/p2 Backlog-worthy severity/medium Moderate harm urgency/this-quarter Within the quarter impact/few Limited audience effort/s Hours type/chore Maintenance / non-user-visible labels Jun 10, 2026
@cristim

cristim commented Jun 10, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 30 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6f430433-8d91-45e4-8c86-70ade13363e5

📥 Commits

Reviewing files that changed from the base of the PR and between fd4b778 and 359ef73.

📒 Files selected for processing (9)
  • providers/azure/services/cache/client.go
  • providers/azure/services/compute/client.go
  • providers/azure/services/cosmosdb/client.go
  • providers/azure/services/database/client.go
  • providers/azure/services/database/client_test.go
  • providers/azure/services/managedredis/client.go
  • providers/azure/services/search/client.go
  • providers/azure/services/synapse/client.go
  • providers/azure/services/synapse/client_test.go
📝 Walkthrough

Walkthrough

Replace hardcoded Azure Reservations reservedResourceType literals with armreservations SDK enum constants across multiple service clients, document the SearchService exception, and add tests validating canonical enum usage in Database and Synapse purchase request payloads.

Changes

Canonical reservedResourceType Enum Adoption

Layer / File(s) Summary
SDK enum adoption across services
providers/azure/services/cache/client.go, providers/azure/services/compute/client.go, providers/azure/services/cosmosdb/client.go, providers/azure/services/database/client.go, providers/azure/services/managedredis/client.go, providers/azure/services/synapse/client.go
Add armreservations imports and replace hardcoded reservedResourceType string literals ("RedisCache", "VirtualMachines", "CosmosDb", "SqlDatabase", "RedisCache", "SqlDW") with the SDK constants (ReservedResourceTypeRedisCache, ReservedResourceTypeVirtualMachines, ReservedResourceTypeCosmosDb, ReservedResourceTypeSQLDatabases, ReservedResourceTypeRedisCache, ReservedResourceTypeSQLDataWarehouse).
Document SearchService hardcoded literal
providers/azure/services/search/client.go
Add inline comment explaining reservedResourceType: "SearchService" remains literal because no corresponding SDK enum/constant exists; request payload unchanged.
Regression tests for canonical enum values
providers/azure/services/database/client_test.go, providers/azure/services/synapse/client_test.go
Add tests that intercept the calculatePrice HTTP request, extract properties.reservedResourceType, assert it equals the SDK enum constant (ReservedResourceTypeSQLDatabases or ReservedResourceTypeSQLDataWarehouse) and that it is a member of armreservations.PossibleReservedResourceTypeValues().

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • LeanerCloud/CUDly#622: Both PRs modify providers/azure/services/synapse/client.go's reservation purchase payload handling and introduce/assert canonical reservedResourceType values.
  • LeanerCloud/CUDly#620: Both PRs touch the Managed Redis reservation flow in providers/azure/services/managedredis/client.go; #620 introduced the earlier literal-based flow.
  • LeanerCloud/CUDly#680: Both PRs modify Azure reservation PurchaseCommitment request flow and payloads; #680 refactored the calculatePrice → purchase sequence.

Suggested labels

type/bug

Poem

🐰 Hopping through code with a careful glance,
I swapped the strings for the SDK's stance.
Enums now march in a tidy row,
Tests watch the payloads to make sure they go.
A little rabbit cheers: canonical! 🌸

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(providers/azure): send canonical reservedResourceType enum values' clearly summarizes the main change: replacing hard-coded strings with SDK enum constants across multiple Azure services.
Linked Issues check ✅ Passed The PR fully addresses issue #1189's requirements: replaced non-canonical literals (SqlDatabase→SqlDatabases, SqlDW→SqlDataWarehouse), converted other correct literals to SDK constants for compile-time checking, documented SearchService as having no SDK enum, added regression tests asserting values are in PossibleReservedResourceTypeValues(), and avoided unrelated API changes.
Out of Scope Changes check ✅ Passed All changes are within scope: file imports and reservedResourceType constants in purchase bodies directly address the linked issue; documentation comments in search/client.go explain the SearchService hard-code decision.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/arch-01-azure-reserved-resource-type

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
providers/azure/services/synapse/client.go (1)

230-233: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update stale doc comment to match canonical enum value.

Line 232 still states "SqlDW", but the request now sends the canonical SDK value (SqlDataWarehouse). Keeping this stale text risks future regressions.

Suggested doc-only fix
-// Reservations API two-step flow (calculatePrice -> purchase). The reserved
-// resource type is "SqlDW" which covers Dedicated SQL Pool DWU reservations.
+// Reservations API two-step flow (calculatePrice -> purchase). The reserved
+// resource type is the canonical SDK enum value "SqlDataWarehouse"
+// (armreservations.ReservedResourceTypeSQLDataWarehouse), which covers
+// Dedicated SQL Pool DWU reservations.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@providers/azure/services/synapse/client.go` around lines 230 - 233, The doc
comment for PurchaseCommitment is outdated: it says the reserved resource type
is "SqlDW" but the code/SDK uses the canonical enum value "SqlDataWarehouse";
update the comment inside the PurchaseCommitment function header to replace
"SqlDW" with "SqlDataWarehouse" (or otherwise note the canonical SDK enum) so
the comment matches the actual value used and avoids future confusion with the
Reservations API flow.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@providers/azure/services/synapse/client.go`:
- Around line 230-233: The doc comment for PurchaseCommitment is outdated: it
says the reserved resource type is "SqlDW" but the code/SDK uses the canonical
enum value "SqlDataWarehouse"; update the comment inside the PurchaseCommitment
function header to replace "SqlDW" with "SqlDataWarehouse" (or otherwise note
the canonical SDK enum) so the comment matches the actual value used and avoids
future confusion with the Reservations API flow.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 18667251-f17d-4df1-b178-724b603dca3f

📥 Commits

Reviewing files that changed from the base of the PR and between 006aba9 and 8c2975b.

📒 Files selected for processing (9)
  • providers/azure/services/cache/client.go
  • providers/azure/services/compute/client.go
  • providers/azure/services/cosmosdb/client.go
  • providers/azure/services/database/client.go
  • providers/azure/services/database/client_test.go
  • providers/azure/services/managedredis/client.go
  • providers/azure/services/search/client.go
  • providers/azure/services/synapse/client.go
  • providers/azure/services/synapse/client_test.go

@cristim
cristim force-pushed the fix/arch-01-azure-reserved-resource-type branch from 8c2975b to fd4b778 Compare June 19, 2026 14:44
@cristim

cristim commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented Jun 26, 2026

Copy link
Copy Markdown
Member Author

Adversarial review -- PR #1208

Reviewed against the stated risk surfaces (SDK enum canonicality, case-sensitivity, sibling enum-as-string patterns, JSON wire format, test fixtures, search/* literal). Net: no blocking findings. Two out-of-scope follow-ups filed.

What I checked

  • SDK enum canonicality. Cross-checked all five converted call sites against armreservations@v1.1.0/constants.go:490-520. Every replacement is exact:
    • ReservedResourceTypeRedisCache -> "RedisCache" (cache, managedredis) ✓
    • ReservedResourceTypeVirtualMachines -> "VirtualMachines" (compute) ✓
    • ReservedResourceTypeCosmosDb -> "CosmosDb" (cosmosdb) ✓
    • ReservedResourceTypeSQLDatabases -> "SqlDatabases" (database, plural -- replaces the singular "SqlDatabase") ✓
    • ReservedResourceTypeSQLDataWarehouse -> "SqlDataWarehouse" (synapse -- replaces "SqlDW") ✓
  • SearchService claim verified. Grepped armreservations@v1.1.0/constants.go and armreservations/v2@v2.0.0/constants.go -- neither has a SearchService / AzureCognitiveSearch member in PossibleReservedResourceTypeValues(). The comment at search/client.go:297-301 is accurate; keeping the literal is the right move for now.
  • Regression tests fail pre-fix. Reverted database/client.go + synapse/client.go to HEAD~1 while keeping the new tests:
    database: TestDatabaseClient_PurchaseCommitment_CanonicalReservedResourceType
      expected: "SqlDatabases"   actual: "SqlDatabase"
    synapse:  TestPurchaseCommitment_canonicalReservedResourceType
      expected: "SqlDataWarehouse"   actual: "SqlDW"
    
    Exactly the wire-string deltas the PR description claims. The tests verify the JSON-marshalled wire format (not the Go-side String()), and assert membership in PossibleReservedResourceTypeValues() so any future enum drift fails the test.
  • JSON wire format vs String(). armreservations.ReservedResourceType is type ReservedResourceType string, so the underlying value is what gets JSON-marshalled. string(armreservations.X) is identical to JSON's encoding. No risk of String() method divergence.
  • Other purchase paths swept.
    • providers/azure/recommendations.go:403-410 is the inbound (read) mapping; already uses lowercase plural "sqldatabases" to match canonical -- consistent ✓.
    • providers/azure/services/compute/exchange.go:146 already uses armreservations.ReservedResourceTypeVirtualMachines constant for the read-side exchange-eligibility check ✓.
    • providers/azure/services/savingsplans/client.go uses a different SDK (armbillingbenefits) with its own typed toAzureTerm helper -- not affected ✓.
    • providers/azure/services/internal/reservations/purchase_test.go:38 test fixture uses "VirtualMachines" as a literal in a JSON string body -- that one is intentionally raw because the test exercises the round-trip parser, not the producer. Leaving it as a literal is fine.
  • Memory feedback_sdk_enum_string_literals.md. This PR is the textbook example -- exact same failure shape as PR fix(gcp): wire Count/pricing into GCP converters; refuse fabricated prices #1047 ("MEMORY_MB" vs SDK "MEMORY"). The sentinel test pattern (assert Contains(PossibleReservedResourceTypeValues(), capturedValue)) is exactly what the memory recommends.
  • Per memory feedback_pr_workflow.md. Base is main ✓.
  • Per memory feedback_mock_assert_expectations.md. Synapse test uses t.Cleanup(func() { mHTTP.AssertExpectations(t) }) (correct). Database test calls mockHTTP.AssertExpectations(t) inline at the end (also correct, but t.Cleanup is slightly preferred for early-return safety -- noted as a nit, not blocking).
  • Per memory feedback_bytes_reader.md. Both tests use bytes.NewReader(bodyBytes) to refresh the consumed body -- correct, no strings.NewReader(string(...)) byte-copy ✓.

CI state

The five failing checks (Lint Code, Security Scanning, Integration Tests, E2E Tests, CI Success cascade) are all pre-existing repo-wide failures unrelated to this PR's seven-file diff:

  • Lint Code -- errcheck debt across internal/api, internal/auth, cmd/, internal/commitmentopts, none of which this PR touches.
  • Security Scanning -- govulncheck exit 1 from HIGH/CRITICAL CVEs in dependencies.
  • Integration Tests + E2E Tests -- duplicate migration file: 000074_repair_partial_migration_058_067.down.sql -- exactly the migration-number-collision failure mode described in memory project_migration_number_collisions.md (only fails in CI on the merge ref, not local pre-commit).

None of those are introduced by this PR. From a code-correctness standpoint the diff is mergeable; the UNSTABLE state reflects repo-level debt that should be addressed at the repo level.

Out-of-scope follow-ups filed

Minor nits (no fix required, not blocking)

  • Database test uses inline mockHTTP.AssertExpectations(t) at function end; synapse test uses t.Cleanup. Both work; t.Cleanup is slightly safer against early returns. Noted for consistency; not worth a fix-up commit.
  • Search client test suite has no sentinel for the literal "SearchService" value. Since there's no SDK enum to assert against today, this is a gap that becomes worth filling only when/if armreservations adds a search-service member; not blocking now.

Verdict

No fix needed on PR #1208 itself. The core claim (SDK constants land canonical wire strings, regression tests fail pre-fix and pass post-fix) is fully verified. Re-request CR once the unrelated CI failures are addressed at the repo level, then merge.

@cristim

cristim commented Jun 26, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim
cristim force-pushed the fix/arch-01-azure-reserved-resource-type branch from fd4b778 to 359ef73 Compare July 10, 2026 13:32
@cristim

cristim commented Jul 10, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

The Azure SQL Database and Synapse purchase bodies sent hand-written
reservedResourceType literals ("SqlDatabase", "SqlDW") that are not
members of the armreservations ReservedResourceType enum; Azure would
reject calculatePrice with an invalid-value error once non-VM purchases
become reachable (known-issues #731). Replace them with the canonical
SDK constants ReservedResourceTypeSQLDatabases ("SqlDatabases") and
ReservedResourceTypeSQLDataWarehouse ("SqlDataWarehouse").

Also convert the already-correct literals in cache, cosmosdb, compute,
and managedredis to their SDK constants so all purchase bodies are
compile-time-checked enum members, and document that search's
"SearchService" has no SDK enum counterpart (v1.1.0 and v2.0.0).

Regression tests capture the calculatePrice request body and assert the
sent value equals the SDK constant and is a member of
PossibleReservedResourceTypeValues(); both fail against the old
literals.

Closes #1189
@cristim
cristim force-pushed the fix/arch-01-azure-reserved-resource-type branch from 359ef73 to d6647f4 Compare July 16, 2026 19:16
@cristim

cristim commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

Rebased onto origin/main (132 commits behind). Clean rebase, 1 commit.

Gates (providers/azure module):

  • build=0
  • vet=0
  • gocyclo=0 (touched files, threshold 10)
  • lintnew=0 (4 bodyclose warnings in new test files -- severity=warning, exit 0)
  • test=0 (357 passed across 7 packages)

Branch force-pushed: fix/arch-01-azure-reserved-resource-type

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor
🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo '== Branch and effective PR diff =='
git status --short
git log --oneline --decorate -3
base="$(git merge-base HEAD origin/main)"
printf 'merge-base: %s\n' "$base"
git diff --stat "$base"...HEAD
git diff --name-only "$base"...HEAD

echo
echo '== Changed-file outlines =='
git diff --name-only "$base"...HEAD | while IFS= read -r file; do
  case "$file" in
    *.go)
      echo "--- $file"
      ast-grep outline "$file" --items all --view compact || true
      ;;
  esac
done

echo
echo '== Patch =='
git diff --unified=55 "$base"...HEAD -- 'providers/azure/services/**/*.go'

echo
echo '== Relevant enum/payload occurrences in changed Azure service files =='
rg -n -C 4 --glob '*.go' \
  '(ReservedResourceType|reservedResourceType|calculatePrice|PossibleReservedResourceTypeValues|AssertExpectations|\.Body\.Close\s*\()' \
  providers/azure/services

echo
echo '== Azure Reservations dependency declaration =='
rg -n -C 2 'armreservations' go.mod providers/azure/go.mod 2>/dev/null || true

Length of output: 201565


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

base="$(git merge-base HEAD origin/main)"

echo '== Exact changed files and concise patch =='
git diff --name-status "$base"...HEAD
git diff --unified=12 "$base"...HEAD

echo
echo '== Focused changed implementation regions =='
for file_and_range in \
  'providers/azure/services/cache/client.go:300,340' \
  'providers/azure/services/compute/client.go:410,450' \
  'providers/azure/services/cosmosdb/client.go:300,332' \
  'providers/azure/services/database/client.go:300,337' \
  'providers/azure/services/managedredis/client.go:248,280' \
  'providers/azure/services/search/client.go:286,310' \
  'providers/azure/services/synapse/client.go:226,280' \
  'providers/azure/services/database/client_test.go:1245,1305' \
  'providers/azure/services/synapse/client_test.go:850,915'
do
  file="${file_and_range%%:*}"
  range="${file_and_range#*:}"
  echo "--- $file ($range)"
  sed -n "${range}p" "$file"
done

echo
echo '== Test helper response ownership and bodyclose configuration =='
rg -n -C 3 --glob '*.go' \
  '(func (createMockHTTPResponse|newHTTPResponse|fakeHTTPResp)\b|bodyclose|io\.NopCloser)' \
  providers/azure/services/database providers/azure/services/synapse \
  .golangci.yml .golangci.yaml 2>/dev/null || true

echo
echo '== All changed reservedResourceType assignments =='
git diff --unified=0 "$base"...HEAD -- 'providers/azure/services/**/*.go' |
  rg -n -C 2 '^[+-].*reservedResourceType|^[+-].*ReservedResourceType|^[+-].*SqlDW|^[+-].*SqlDatabase'

Length of output: 51844


@cristim Reviewed the rebased diff. No blocking findings.

One non-blocking nit: providers/azure/services/synapse/client.go still says the reserved resource type is "SqlDW" in the PurchaseCommitment doc comment, although the request now correctly sends "SqlDataWarehouse" via armreservations.ReservedResourceTypeSQLDataWarehouse. Updating that sentence would keep the implementation documentation aligned with the canonical wire value.

The five converted purchase bodies use the intended SDK constants, the SearchService exception is appropriately documented, and the new SQL Database/Synapse tests validate the JSON payload plus SDK enum membership.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim
cristim merged commit ed288c4 into main Jul 16, 2026
19 checks passed
@cristim

cristim commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

Merged to main after pre-merge review (rebased onto current main, CLEAN + all CI green). Replaces hand-written Azure reservedResourceType string literals with canonical armreservations SDK enum values across cache/compute/cosmosdb/database purchase bodies; fixes the invalid "SqlDatabase" (Azure rejects it) to the canonical "SqlDatabases", and adds a regression test asserting the calculatePrice body carries the SDK enum. Directly enforces the typed-SDK-enum money-path rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/s Hours impact/few Limited audience priority/p2 Backlog-worthy severity/medium Moderate harm triaged Item has been triaged type/chore Maintenance / non-user-visible urgency/this-quarter Within the quarter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ARCH-01: Azure purchase bodies send non-canonical reservedResourceType literals (SqlDatabase, SqlDW)

1 participant