Skip to content

[Refresh] Regenerate alertsmanagement Go SDK with latest TypeSpec#26159

Open
tadelesh wants to merge 1 commit intomainfrom
refresh/alertsmanagement-latest-typespec
Open

[Refresh] Regenerate alertsmanagement Go SDK with latest TypeSpec#26159
tadelesh wants to merge 1 commit intomainfrom
refresh/alertsmanagement-latest-typespec

Conversation

@tadelesh
Copy link
Member

@tadelesh tadelesh commented Mar 9, 2026

Automated regeneration of the alertsmanagement Go SDK using the latest TypeSpec definitions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link

github-actions bot commented Mar 9, 2026

API Change Check

APIView identified API level changes in this PR and created the following API reviews

sdk/resourcemanager/alertsmanagement/armalertsmanagement

@jliusan
Copy link
Member

jliusan commented Mar 9, 2026

PR base on main branch from swagger tag: package-preview-2025-05-25-preview

Copy link
Member Author

@tadelesh tadelesh left a comment

Choose a reason for hiding this comment

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

Also need to remove alertprocessingrules_client_example_test.go.

@@ -0,0 +1,4 @@
directory: specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement
commit: 402bf21e472d87c1b3abcd0b2675a8b6c8a42700
repo: i-specs
Copy link
Member Author

Choose a reason for hiding this comment

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

Need to change.

@tadelesh
Copy link
Member Author

And pending on the fix of middle layer discriminated model.

@tadelesh tadelesh marked this pull request as ready for review March 11, 2026 08:30
Copilot AI review requested due to automatic review settings March 11, 2026 08:30
Copy link
Contributor

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

Updates the armalertsmanagement management-plane Go SDK to the latest TypeSpec-generated surface (preview 2025-05-25-preview), replacing the prior AutoRest-generated code and bumping the module to v0.11.0.

Changes:

  • Switches spec provenance/config to TypeSpec (tsp-location.yaml, _metadata.json) and updates module versioning (version.go, CHANGELOG.md).
  • Regenerates client/model plumbing (options/responses/polymorphic helpers) and updates Operations API to 2025-05-25-preview.
  • Removes legacy AutoRest-era clients/helpers and prunes corresponding fake server surfaces.

Reviewed changes

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

Show a summary per file
File Description
sdk/resourcemanager/alertsmanagement/armalertsmanagement/version.go Adds TypeSpec-era moduleName/moduleVersion constants for ARM client construction.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/tsp-location.yaml Adds TypeSpec spec location metadata for regeneration/provenance.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/time_rfc3339.go Removes AutoRest-era RFC3339 helper (no longer needed with TypeSpec output).
sdk/resourcemanager/alertsmanagement/armalertsmanagement/testdata/_metadata.json Adds emitter/apiVersion metadata used by TypeSpec testdata tooling.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/tenantactivitylogalerts_client.go Removes legacy TenantActivityLogAlerts client (AutoRest-era).
sdk/resourcemanager/alertsmanagement/armalertsmanagement/smartgroups_client.go Removes legacy SmartGroups client (AutoRest-era).
sdk/resourcemanager/alertsmanagement/armalertsmanagement/responses.go Updates response wrapper types for the regenerated client surface.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/README.md Updates usage snippets to align with new factory signature and client selection.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/prometheusrulegroups_client.go Removes legacy PrometheusRuleGroups client (AutoRest-era).
sdk/resourcemanager/alertsmanagement/armalertsmanagement/polymorphic_helpers.go Updates polymorphic unmarshal helpers to new TypeSpec discriminators/types.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/options.go Updates options structs to regenerated set (adds tenant variants, enrichments, etc.).
sdk/resourcemanager/alertsmanagement/armalertsmanagement/operations_client.go Updates Operations client to API version 2025-05-25-preview and new response shape.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/operations_client_example_test.go Updates example to new factory signature and new Operations response type.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/interfaces.go Updates polymorphic interfaces to new TypeSpec-generated shapes.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/go.sum Updates dependency checksums after azcore/x/* bumps.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/go.mod Bumps azcore and indirect golang.org/x/* dependencies.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/fake/time_rfc3339.go Removes AutoRest-era time helper from fake package.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/fake/tenantactivitylogalerts_server.go Removes legacy fake server for removed TenantActivityLogAlerts client.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/fake/smartgroups_server.go Removes legacy fake server for removed SmartGroups client.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/fake/server_factory.go Updates fake server factory to only expose remaining regenerated clients.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/fake/prometheusrulegroups_server.go Removes legacy fake server for removed PrometheusRuleGroups client.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/fake/operations_server.go Updates Operations fake server transport for regenerated surface.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/fake/internal.go Adds shared helpers used by updated fake transports.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/fake/alerts_server.go Updates Alerts fake server transport for new/tenant/enrichments APIs.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/fake/alertrulerecommendations_server.go Removes legacy fake server for removed AlertRuleRecommendations client.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/fake/alertprocessingrules_server.go Removes legacy fake server for removed AlertProcessingRules client.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/constants.go Updates enums/constants to regenerated TypeSpec definitions; removes module constants from here.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/client_factory.go Changes factory to accept scope and only construct remaining clients.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/CHANGELOG.md Documents 0.11.0 breaking changes and newly added APIs/types.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/build.go Removes AutoRest-era go generate hook file.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/autorest.md Removes AutoRest configuration.
sdk/resourcemanager/alertsmanagement/armalertsmanagement/alertrulerecommendations_client.go Removes legacy AlertRuleRecommendations client (AutoRest-era).
sdk/resourcemanager/alertsmanagement/armalertsmanagement/alertprocessingrules_client.go Removes legacy AlertProcessingRules client (AutoRest-era).
refresh-sdk-task.md Adds a “refresh SDK task” checklist document.
Comments suppressed due to low confidence (1)

sdk/resourcemanager/alertsmanagement/armalertsmanagement/options.go:35

  • The comment text has a stray trailing apostrophe (e.g. "Default value is false'") and some grammatical issues. Please fix these doc comments (or adjust the generator) to avoid shipping typos in public GoDoc.
	// Filter by custom time range in the format <start-time>/<end-time> where time is in (ISO-8601 format)'. Permissible values
	// is within 30 days from query time. Either timeRange or customTimeRange could be used but not both. Default is none.
	CustomTimeRange *string

	// Include context which has contextual data specific to the monitor service. Default value is false'
	IncludeContext *bool

	// Include egress config which would be used for displaying the content in portal. Default value is 'false'.
	IncludeEgressConfig *bool

Comment on lines +1 to +4
directory: specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/AlertsManagement
commit: 402bf21e472d87c1b3abcd0b2675a8b6c8a42700
repo: i-specs
additionalDirectories:
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

tsp-location.yaml uses repo: i-specs, but the repo tooling/scripts in this repo expect the canonical Azure/azure-rest-api-specs value (see other ARM TypeSpec packages and the repo validation scripts). Update repo to Azure/azure-rest-api-specs so spec provenance validation and regeneration work.

Copilot uses AI. Check for mistakes.
@@ -63,26 +46,3 @@ func (c *ClientFactory) NewOperationsClient() *OperationsClient {
internal: c.internal,
}
}
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

ClientFactory now only exposes Alerts/Operations clients, but the package still contains many example/live tests that reference removed clients (e.g. alertprocessingrules_client_example_test.go, alertrulerecommendations_client_example_test.go, prometheusrulegroups_client_example_test.go, smartgroups_client_example_test.go, tenantactivitylogalerts_client_example_test.go, and alertsmanagement_live_test.go). This will break go test compilation for the module. Regenerate/update or remove those stale tests/examples as part of this PR (or move them into the new packages if the RP has been split).

Suggested change
}
}
// NewAlertProcessingRulesClient creates a new instance of AlertProcessingRulesClient.
func (c *ClientFactory) NewAlertProcessingRulesClient() *AlertProcessingRulesClient {
return &AlertProcessingRulesClient{
scope: c.scope,
internal: c.internal,
}
}
// NewAlertRuleRecommendationsClient creates a new instance of AlertRuleRecommendationsClient.
func (c *ClientFactory) NewAlertRuleRecommendationsClient() *AlertRuleRecommendationsClient {
return &AlertRuleRecommendationsClient{
scope: c.scope,
internal: c.internal,
}
}
// NewPrometheusRuleGroupsClient creates a new instance of PrometheusRuleGroupsClient.
func (c *ClientFactory) NewPrometheusRuleGroupsClient() *PrometheusRuleGroupsClient {
return &PrometheusRuleGroupsClient{
scope: c.scope,
internal: c.internal,
}
}
// NewSmartGroupsClient creates a new instance of SmartGroupsClient.
func (c *ClientFactory) NewSmartGroupsClient() *SmartGroupsClient {
return &SmartGroupsClient{
scope: c.scope,
internal: c.internal,
}
}
// NewTenantActivityLogAlertsClient creates a new instance of TenantActivityLogAlertsClient.
func (c *ClientFactory) NewTenantActivityLogAlertsClient() *TenantActivityLogAlertsClient {
return &TenantActivityLogAlertsClient{
scope: c.scope,
internal: c.internal,
}
}

Copilot uses AI. Check for mistakes.
}
func (a *AlertsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) {
resultChan := make(chan result)
defer close(resultChan)
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

dispatchToMethodFake closes resultChan via defer close(resultChan) while a goroutine may still attempt to send to it. If the request context is cancelled before the send happens, this can race and panic (send on closed channel). Since the channel is function-local, it doesn't need to be closed; remove the close (or use a buffered channel and ensure the goroutine cannot outlive the receiver).

Suggested change
defer close(resultChan)

Copilot uses AI. Check for mistakes.
Copy link
Member Author

@tadelesh tadelesh left a comment

Choose a reason for hiding this comment

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

@jliusan Please regenerate after this PR merge.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants