Skip to content

Storage - STG104 Container Change Feed#49307

Open
gunjansingh-msft wants to merge 3 commits into
feature/storage/stg104basefrom
feature/storage/containerchangefeed
Open

Storage - STG104 Container Change Feed#49307
gunjansingh-msft wants to merge 3 commits into
feature/storage/stg104basefrom
feature/storage/containerchangefeed

Conversation

@gunjansingh-msft
Copy link
Copy Markdown
Member

@gunjansingh-msft gunjansingh-msft commented May 29, 2026

No description provided.

@gunjansingh-msft gunjansingh-msft changed the title container feed changes STG 104 - container feed changes May 29, 2026
@github-actions github-actions Bot added the Storage Storage Service (Queues, Blobs, Files) label May 29, 2026
@ibrandes ibrandes changed the title STG 104 - container feed changes Storage - STG104 Container Change Feed May 31, 2026
Copy link
Copy Markdown
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

Adds support in azure-storage-blob-changefeed for newer change feed schema variants (V6–V8), including container change feed-related event types and new optional event data fields, and strengthens deserialization testing using representative payloads.

Changes:

  • Added schema V6/V7/V8 JSON payloads and a new deserialization-focused test suite covering the new optional fields.
  • Extended changefeed models/deserialization to surface createTime, lastAccessTime, and restoredContainerVersion.
  • Introduced/expanded enums for additional event types and operation names to cover newer schema behaviors.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
sdk/storage/azure-storage-blob-changefeed/src/test/resources/EventSchemaV6.json Adds a schema V6 sample payload used by deserialization tests.
sdk/storage/azure-storage-blob-changefeed/src/test/resources/EventSchemaV7.json Adds a schema V7 sample payload (includes lastAccessTime).
sdk/storage/azure-storage-blob-changefeed/src/test/resources/EventSchemaV8.json Adds a schema V8 sample payload (includes restoredContainerVersion).
sdk/storage/azure-storage-blob-changefeed/src/test/java/com/azure/storage/blob/changefeed/MockedChangefeedResources.java Updates mocked event data construction to include newly added optional fields.
sdk/storage/azure-storage-blob-changefeed/src/test/java/com/azure/storage/blob/changefeed/implementation/models/BlobChangefeedEventDeserializationTests.java New unit tests validating enum parsing and optional field deserialization across schema versions.
sdk/storage/azure-storage-blob-changefeed/src/test/java/com/azure/storage/blob/changefeed/ChunkTests.java Updates mocked Avro record creation to include new optional keys (null values) for compatibility.
sdk/storage/azure-storage-blob-changefeed/src/main/java/com/azure/storage/blob/changefeed/models/BlobOperationName.java Adds a new ExpandableStringEnum for operation names used by the change feed.
sdk/storage/azure-storage-blob-changefeed/src/main/java/com/azure/storage/blob/changefeed/models/BlobChangefeedEventType.java Adds new event type constants for newer schema/container change feed events.
sdk/storage/azure-storage-blob-changefeed/src/main/java/com/azure/storage/blob/changefeed/models/BlobChangefeedEventData.java Adds default getters for new optional fields (creation time, last access time, restored container version).
sdk/storage/azure-storage-blob-changefeed/src/main/java/com/azure/storage/blob/changefeed/implementation/models/InternalBlobChangefeedEventData.java Implements parsing/storage of the newly added optional fields and includes them in equals/hashCode/toString.

Comment on lines +119 to +123
ChangefeedTypeValidator.isNull(createTime)
? null
: OffsetDateTime.parse(
Objects.requireNonNull(ChangefeedTypeValidator.nullOr("createTime", createTime, String.class))),
ChangefeedTypeValidator.isNull(lastAccessTime)
Comment on lines +123 to +127
ChangefeedTypeValidator.isNull(lastAccessTime)
? null
: OffsetDateTime.parse(Objects
.requireNonNull(ChangefeedTypeValidator.nullOr("lastAccessTime", lastAccessTime, String.class))),
ChangefeedTypeValidator.nullOr("restoredContainerVersion", restoredContainerVersion, String.class));
Comment on lines +322 to +325
private static Map<String, Object> loadJsonAsAvroMap(String resourceName) throws IOException {
try (InputStream is = BlobChangefeedEventDeserializationTests.class.getClassLoader()
.getResourceAsStream(resourceName);
JsonReader reader = JsonProviders.createReader(is)) {
Comment on lines +1 to +60
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.storage.blob.changefeed.models;

import com.azure.core.util.ExpandableStringEnum;

import java.util.Collection;

/**
* This class represents the operation name that triggered a {@link BlobChangefeedEvent}.
*/
public final class BlobOperationName extends ExpandableStringEnum<BlobOperationName> {

/** Static value AppendBlock for BlobOperationName. */
public static final BlobOperationName APPEND_BLOCK = fromString("AppendBlock");

/** Static value UpdateLastAccessTime for BlobOperationName. */
public static final BlobOperationName UPDATE_LAST_ACCESS_TIME = fromString("UpdateLastAccessTime");

/** Static value CreateContainer for BlobOperationName. */
public static final BlobOperationName CREATE_CONTAINER = fromString("ContainerCreated");

/** Static value DeleteContainer for BlobOperationName. */
public static final BlobOperationName DELETE_CONTAINER = fromString("ContainerDeleted");

/** Static value RestoreContainer for BlobOperationName. */
public static final BlobOperationName RESTORE_CONTAINER = fromString("RestoreContainer");

/** Static value SetContainerMetadata for BlobOperationName. */
public static final BlobOperationName SET_CONTAINER_METADATA = fromString("SetContainerMetadata");

/**
* Creates a new instance of {@link BlobOperationName} with no string value.
*
* @deprecated Please use {@link #fromString(String)} to create an instance of BlobOperationName.
*/
@Deprecated
public BlobOperationName() {
}

/**
* Creates or finds a BlobOperationName from its string representation.
*
* @param name a name to look for.
* @return the corresponding BlobOperationName.
*/
public static BlobOperationName fromString(String name) {
return fromString(name, BlobOperationName.class);
}

/**
* Gets known BlobOperationName values.
*
* @return known BlobOperationName values.
*/
public static Collection<BlobOperationName> values() {
return values(BlobOperationName.class);
}
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

do we need this class? its never wired to BlobChangefeedEventData.getApi() - which still returns a string. I think we are okay to remove this class, since the new event types are enough to disambiguate.

@ibrandes
Copy link
Copy Markdown
Member

ibrandes commented Jun 4, 2026

looks good so far - please resolve the open comments and analyze errors

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

Labels

Storage Storage Service (Queues, Blobs, Files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants