Repository navigation
[Service Bus] Add topic sqlFilterCount and correlationFilterCount runtime properties - #39500
Conversation
…time properties Add read-only sqlFilterCount and correlationFilterCount properties to TopicRuntimeProperties, reporting the total number of SQL and correlation filters across a topic's subscriptions. These are served by Service Bus management API version 2024-05, which is now the current api-version. - Expose sqlFilterCount/correlationFilterCount (optional number, undefined when absent), mirroring subscriptionCount - Deserialize the SqlFilterCount/CorrelationFilterCount ATOM elements - Bump CURRENT_API_VERSION to 2024-05 and widen the serviceVersion option - Regenerate the public API report - Add unit and live tests Part of a cross-language effort; reference implementation is Azure/azure-sdk-for-net#61559.
…pic-filter-counts-37720586 # Conflicts: # sdk/servicebus/service-bus/CHANGELOG.md
There was a problem hiding this comment.
Pull request overview
Adds topic-level SQL and correlation filter counts to Service Bus administration runtime properties using API version 2024-05.
Changes:
- Deserializes and exposes both optional filter counts.
- Updates the default and supported ATOM API versions.
- Adds unit/live coverage and updates public API documentation.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
CHANGELOG.md |
Records the new properties and API version. |
review/service-bus-node.api.md |
Updates the public API report. |
src/serializers/topicResourceSerializer.ts |
Maps and defines filter counts. |
src/serviceBusAtomManagementClient.ts |
Adds 2024-05 client support. |
src/util/constants.ts |
Adds XML constants and updates the default version. |
src/util/utils.ts |
Extends the API-version union. |
test/internal/unit/atomXml.spec.ts |
Tests deserialization and default version. |
test/public/atomManagement.spec.ts |
Adds live filter-count validation. |
…count live test to one version, add admin snippet, add CHANGELOG PR links
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.
Suppressed comments (1)
sdk/servicebus/service-bus/test/public/atomManagement.spec.ts:676
- The comprehensive ATOM live suite at line 30 still enumerates only
2021-05and2017-04, so the new default version is exercised here only for rule creation andgetTopicRuntimeProperties. Since2024-05is now sent by default for every administration operation, add it to the suite's supported-version matrix (and use that iteration for this scenario) so regressions in the other queue/topic/subscription/rule operations are covered before changing the default.
(serviceVersion === "2021-05" ? describe : describe.skip)("Atom management - Topic filter counts", function (): void {
const filterCountsClient = (): ServiceBusAdministrationClient =>
new ServiceBusAdministrationClient(getFullyQualifiedNamespace(), createTestCredential(), {
serviceVersion: "2024-05",
|
Azure Pipelines: Successfully started running 1 pipeline(s). 9 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Johnathan W (j7nw4r)
left a comment
There was a problem hiding this comment.
I built the package on the PR head and ran the gates. The build and extract-api pass, and the committed service-bus-node.api.md regenerates identically. Lint reports no errors. Prettier is clean. The Node unit suite passes, with 390 tests. I could not run the live suite, because I have no namespace here.
The implementation is correct, and I checked it rather than assumed it. I drove the client through a fake transport with a realistic ATOM entry. The default client sends api-version=2024-05, and both counts land on getTopicRuntimeProperties and on listTopicsRuntimeProperties. A 0 value stays 0, so there is no gap between zero and absent. I also read the merged .NET PR, and your default version bump matches it.
Two things hold this up. The new unit tests build their input from the same constants the code reads with, so they cannot catch a wrong ATOM element name. I proved that by replacing both names with garbage on the PR head, and all 390 tests still passed. Separately, the live suite still pins every assertion to 2021-05 and 2017-04, so the new default that every customer gets has no live coverage. The two threads carry the detail.
The other three comments are small: a describe gate that ties this test's survival to an array 640 lines up the file, an api-version assertion that restates a constant, and a README sample whose counts sit at their floor. The CHANGELOG entries, the TSDoc, and the regenerated api report are all in good shape.
…erage - Add fake-transport tests that drive the client with a literal ATOM body, so the element names SqlFilterCount and CorrelationFilterCount are pinned independently of the constants, and cover listTopicsRuntimeProperties. - Assert the default api-version on the request URL from a default client, and the pinned value when the caller supplies one, replacing the constant equality check. - Run the live admin suite at 2024-05 as well, and carry the two new properties in the expected topic runtime objects, version aware. Without this the runtime info tests fail at every api-version, since the properties are present as keys even where the value is undefined. - Move the topic filter count live block beside the suite so it runs once without a version gate, and manage its own topic lifecycle. - Create a subscription and a correlation rule in the admin sample so the counts aggregate, and regenerate the README snippet.
bd459db
into
main
Description
Adds two read-only runtime properties to
TopicRuntimeProperties:sqlFilterCount— the total number of SQL filters across all of a topic's subscriptions.correlationFilterCount— the total number of correlation filters across all of a topic's subscriptions.These counts are served by Service Bus management API version 2024-05, so
CURRENT_API_VERSIONis updated to2024-05and the publicserviceVersionoption is widened accordingly. When the service does not report the counts (an older api-version or a region that has not yet deployed the feature), the properties areundefined, consistent with the existingsubscriptionCount.This is the JS member of a coordinated cross-language effort. The reference implementation is the merged .NET PR Azure/azure-sdk-for-net#61559; sibling PRs exist for Java, Go, and Python.
Implementation notes
SqlFilterCount/CorrelationFilterCountATOM elements viagetIntegerOrUndefined, mirroringsubscriptionCount.CURRENT_API_VERSIONto2024-05and widens theServiceBusAtomAPIVersionunion and the publicserviceVersionoption type.review/service-bus-node.api.md).undefined) plus a default-api-version assertion, and a live test asserting the counts.