Skip to content

chore(CloudCommonProtos): remove orphaned AttributeContext metadata - #9533

Open
sofisl wants to merge 2 commits into
mainfrom
chore/cloud-common-protos-remove-orphaned-metadata
Open

chore(CloudCommonProtos): remove orphaned AttributeContext metadata#9533
sofisl wants to merge 2 commits into
mainfrom
chore/cloud-common-protos-remove-orphaned-metadata

Conversation

@sofisl

@sofisl sofisl commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

The AttributeContext proto correctly belongs to CommonProtos (which maps to google/rpc), not CloudCommonProtos (which maps to google/cloud/audit, etc.). During the migration of common-protos to this repository in PR #7554, the metadata file was accidentally duplicated here, but the actual source classes were correctly placed in CommonProtos.

This orphaned metadata file creates a namespace collision when both packages are loaded, as shown in the test below:

<?php
require __DIR__ . '/vendor/autoload.php';

if (class_exists('\GPBMetadata\Google\Rpc\Context\AttributeContext')) {
    echo "Class exists\n";
    $reflector = new \ReflectionClass('\GPBMetadata\Google\Rpc\Context\AttributeContext');
    echo "Found in: " . $reflector->getFileName() . "\n";
} else {
    echo "Class not found\n";
}

Output on main when testing in CloudCommonProtos:

Class exists
Found in: /usr/local/google/home/sofialeon/google-cloud-php/CloudCommonProtos/metadata/Rpc/Context/AttributeContext.php

However, CloudCommonProtos lacks the src class (Google\Rpc\Context\AttributeContext), which relies entirely on CommonProtos. Removing this duplicate file ensures the metadata is correctly loaded from CommonProtos, resolving the shadow collision. Librarian correctly flagged this duplicate file for deletion.

BREAKING_CHANGE_REASON=Removing legacy orphaned proto files that were left behind by OwlBot.

For googleapis/librarian#7366

The `AttributeContext` proto correctly belongs to `CommonProtos`, not `CloudCommonProtos`. During the migration of common-protos to this repository in PR #7554, the metadata file was accidentally duplicated here, but the actual source classes were correctly placed in `CommonProtos`. This removes the useless orphaned metadata file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant