Skip to content

Commit

Permalink
[EventGrid] Update System events and prepare for Jan release (#19741)
Browse files Browse the repository at this point in the history
* [EventGrid] Event Schema Updates for January Release

This change pulls in the latest changes from the
`azure-rest-api-specs` repository for system events in Azure.

While no new events have been added with this release, some events now
have additional properties (the service teams which produce these
events now provide additional information in each event).

In addition, it fixes an issue we had with some of the Azure Resource
Manager events. We discovered that the event schemas for these events
was authored incorrectly and said some properties were of type
"string" instead of either a rich object or a map of strings to
strings.

A customer discovered this for .NET and that caused us to do some
investigation with the service team to discover that the specification
was wrong and get it corrected.

This is a breaking change for code which is written in typescript and
which uses any of these impacted properties because the underlying
type has changed from string to something else. However, any code
which previously was written against the old typings would have
*failed* at runtime with a type error, so in practice anyone who gets
an issue is now correctly discovering a bug in their program at
compile time now instead of runtime.

To prevent these issues in the future, we've been working closely with
the service team to introduce guard rails that ensure the events
services publish correspond to the schemas they have have published.

* [EventGrid] Prepare for Release
  • Loading branch information
ellismg authored Jan 10, 2022
1 parent 69fa41b commit 24798c4
Show file tree
Hide file tree
Showing 8 changed files with 431 additions and 107 deletions.
27 changes: 23 additions & 4 deletions sdk/eventgrid/eventgrid/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
# Release History

## 4.5.1 (Unreleased)
## 4.6.0 (2022-01-11)

### Features Added

### Breaking Changes
- Added a new property to `AcsRecordingChunkInfo` (for the `Microsoft.Communication.RecordingFileStatusUpdated` system event):
- `deleteLocation`

- Added new properties to `ContainerRegistryArtifactEventData` and `ContainerRegistryEventData` (for the `Microsoft.ContainerRegistry.{ChartDeleted|ChartPushed|ImagePushed|ImageDeleted}` system events):

- `connectedRegistry`
- `location`

- Added new properties to `AcsRecordingFileStatusUpdatedEventData` (for the `Microsoft.Communication.RecordingFileStatusUpdated` system event):

- `recordingChannelType`
- `recordingContentType`
- `recordingFormatType`

### Key Bug Fixes

- The TypeScript typings for events from Azure Resource Manager were incorrect. The following properties had their types changed:

### Bugs Fixed
- `authorization`
- `claims`
- `httpRequest`

### Other Changes
Previously, these properties were typed as `string` but the underlying events from the service actually contained objects. Customers using `isSystemEvent` with TypeScript will
now see compliation issues if they try to treat these properties as strings (previously, the code would fail at runtime).

## 4.5.0 (2021-10-05)

Expand Down
2 changes: 1 addition & 1 deletion sdk/eventgrid/eventgrid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"sdk-type": "client",
"author": "Microsoft Corporation",
"description": "An isomorphic client library for the Azure Event Grid service.",
"version": "4.5.1",
"version": "4.6.0",
"keywords": [
"node",
"azure",
Expand Down
112 changes: 84 additions & 28 deletions sdk/eventgrid/eventgrid/review/eventgrid.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export type AcsChatThreadWithUserDeletedEventData = AcsChatThreadEventBase & {
// @public
export interface AcsRecordingChunkInfo {
contentLocation: string;
deleteLocation: string;
documentId: string;
endReason: string;
index: number;
Expand All @@ -166,7 +167,10 @@ export interface AcsRecordingChunkInfo {

// @public
export interface AcsRecordingFileStatusUpdatedEventData {
recordingChannelType: RecordingChannelType;
recordingContentType: RecordingContentType;
recordingDurationMs: number;
recordingFormatType: RecordingFormatType;
recordingStartTime: string;
recordingStorageInfo: AcsRecordingStorageInfo;
sessionEndReason: string;
Expand Down Expand Up @@ -359,7 +363,9 @@ export interface CommunicationUserIdentifierModel {
// @public
export interface ContainerRegistryArtifactEventData {
action: string;
connectedRegistry: ContainerRegistryEventConnectedRegistry;
id: string;
location: string;
target: ContainerRegistryArtifactEventTarget;
timestamp: string;
}
Expand All @@ -386,11 +392,18 @@ export interface ContainerRegistryEventActor {
name: string;
}

// @public
export interface ContainerRegistryEventConnectedRegistry {
name: string;
}

// @public
export interface ContainerRegistryEventData {
action: string;
actor: ContainerRegistryEventActor;
connectedRegistry: ContainerRegistryEventConnectedRegistry;
id: string;
location: string;
request: ContainerRegistryEventRequest;
source: ContainerRegistryEventSource;
target: ContainerRegistryEventTarget;
Expand Down Expand Up @@ -1071,12 +1084,23 @@ export interface PolicyInsightsPolicyStateDeletedEventData {
timestamp: string;
}

// @public
export type RecordingChannelType = string;

// @public
export type RecordingContentType = string;

// @public
export type RecordingFormatType = string;

// @public
export interface ResourceActionCancelEventData {
authorization: string;
claims: string;
authorization: ResourceAuthorization;
claims: {
[propertyName: string]: string;
};
correlationId: string;
httpRequest: string;
httpRequest: ResourceHttpRequest;
operationName: string;
resourceGroup: string;
resourceProvider: string;
Expand All @@ -1088,10 +1112,12 @@ export interface ResourceActionCancelEventData {

// @public
export interface ResourceActionFailureEventData {
authorization: string;
claims: string;
authorization: ResourceAuthorization;
claims: {
[propertyName: string]: string;
};
correlationId: string;
httpRequest: string;
httpRequest: ResourceHttpRequest;
operationName: string;
resourceGroup: string;
resourceProvider: string;
Expand All @@ -1103,10 +1129,12 @@ export interface ResourceActionFailureEventData {

// @public
export interface ResourceActionSuccessEventData {
authorization: string;
claims: string;
authorization: ResourceAuthorization;
claims: {
[propertyName: string]: string;
};
correlationId: string;
httpRequest: string;
httpRequest: ResourceHttpRequest;
operationName: string;
resourceGroup: string;
resourceProvider: string;
Expand All @@ -1116,12 +1144,23 @@ export interface ResourceActionSuccessEventData {
tenantId: string;
}

// @public
export interface ResourceAuthorization {
action: string;
evidence: {
[propertyName: string]: string;
};
scope: string;
}

// @public
export interface ResourceDeleteCancelEventData {
authorization: string;
claims: string;
authorization: ResourceAuthorization;
claims: {
[propertyName: string]: string;
};
correlationId: string;
httpRequest: string;
httpRequest: ResourceHttpRequest;
operationName: string;
resourceGroup: string;
resourceProvider: string;
Expand All @@ -1133,10 +1172,12 @@ export interface ResourceDeleteCancelEventData {

// @public
export interface ResourceDeleteFailureEventData {
authorization: string;
claims: string;
authorization: ResourceAuthorization;
claims: {
[propertyName: string]: string;
};
correlationId: string;
httpRequest: string;
httpRequest: ResourceHttpRequest;
operationName: string;
resourceGroup: string;
resourceProvider: string;
Expand All @@ -1148,10 +1189,12 @@ export interface ResourceDeleteFailureEventData {

// @public
export interface ResourceDeleteSuccessEventData {
authorization: string;
claims: string;
authorization: ResourceAuthorization;
claims: {
[propertyName: string]: string;
};
correlationId: string;
httpRequest: string;
httpRequest: ResourceHttpRequest;
operationName: string;
resourceGroup: string;
resourceProvider: string;
Expand All @@ -1161,12 +1204,22 @@ export interface ResourceDeleteSuccessEventData {
tenantId: string;
}

// @public
export interface ResourceHttpRequest {
clientIpAddress: string;
clientRequestId: string;
method: string;
url: string;
}

// @public
export interface ResourceWriteCancelEventData {
authorization: string;
claims: string;
authorization: ResourceAuthorization;
claims: {
[propertyName: string]: string;
};
correlationId: string;
httpRequest: string;
httpRequest: ResourceHttpRequest;
operationName: string;
resourceGroup: string;
resourceProvider: string;
Expand All @@ -1178,10 +1231,12 @@ export interface ResourceWriteCancelEventData {

// @public
export interface ResourceWriteFailureEventData {
authorization: string;
claims: string;
authorization: ResourceAuthorization;
claims: {
[propertyName: string]: string;
};
correlationId: string;
httpRequest: string;
httpRequest: ResourceHttpRequest;
operationName: string;
resourceGroup: string;
resourceProvider: string;
Expand All @@ -1193,10 +1248,12 @@ export interface ResourceWriteFailureEventData {

// @public
export interface ResourceWriteSuccessEventData {
authorization: string;
claims: string;
authorization: ResourceAuthorization;
claims: {
[propertyName: string]: string;
};
correlationId: string;
httpRequest: string;
httpRequest: ResourceHttpRequest;
operationName: string;
resourceGroup: string;
resourceProvider: string;
Expand Down Expand Up @@ -1682,7 +1739,6 @@ export interface WebSlotSwapWithPreviewStartedEventData {
verb: string;
}


// (No @packageDocumentation comment for this package)

```

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 24798c4

Please sign in to comment.