Skip to content

chore(AnalyticsAdmin): remove orphaned files from previous proto refactors - #9520

Open
sofisl wants to merge 1 commit into
mainfrom
chore/remove-orphaned-analytics-admin-files
Open

chore(AnalyticsAdmin): remove orphaned files from previous proto refactors#9520
sofisl wants to merge 1 commit into
mainfrom
chore/remove-orphaned-analytics-admin-files

Conversation

@sofisl

@sofisl sofisl commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

This PR removes legacy/orphaned PHP files in AnalyticsAdmin that no longer correspond to upstream googleapis definitions.

Historically, when proto files or messages were renamed/moved in googleapis, the PHP generator (via OwlBot) successfully generated the new files but failed to delete the old ones, leaving dead code in the repository. We discovered these while testing the new Librarian migration tool, which strictly cleans output directories and correctly flags these as deletions.

Evidence & Tracing:

  1. ConnectedSiteTag and AutomatedGa4ConfigurationOptOut resources and methods

    • Origin: Generated from google/analytics/admin/v1alpha/analytics_admin.proto.
    • The Change: In googleapis commit 2032c33b2df0fd3b2dc9bfcb6fc747e139a0d87d, the upstream team explicitly removed ConnectedSiteTag and its related RPCs (e.g., CreateConnectedSiteTag, DeleteConnectedSiteTag) and resources.
    • Result: OwlBot generated the new files successfully, but left behind the old ConnectedSiteTag.php and its request/response classes, along with their samples.
  2. UserLink methods

    • Origin: Generated from google/analytics/admin/v1alpha/analytics_admin.proto.
    • The Change: In googleapis commit a3006dd1ff2e3c7f4ff7e7538af8adf2ea9e815b, the upstream team deleted all UserLink methods (e.g., BatchDeleteUserLinks, CreateUserLink, AuditUserLinks).
    • Result: The old samples for these methods were left behind.
  3. CreateSubproperty

Removing these 29 obsolete files cleans up dead code and enables accurate 0-diff parity testing.
\n\nSafety / Backwards Compatibility Note:\nAny customer code attempting to use these deleted classes is already broken and crashing in production. \nBecause the upstream .proto definitions were removed, the protobuf compiler previously removed these classes from the generated GPBMetadata descriptor pool. Because OwlBot left the PHP class files behind, they can still be referenced in code, but attempting to instantiate them immediately throws a Fatal PHP Exception before any API call is made.\n\nExample instantiation of an orphaned class:\nphp\n<?php\nrequire __DIR__ . '/vendor/autoload.php';\nuse Google\Analytics\Admin\V1alpha\ConnectedSiteTag;\n\n$tag = new ConnectedSiteTag();\n\nOutput:\n\nPHP Fatal error: Uncaught InvalidArgumentException: Google\Analytics\Admin\V1alpha\ConnectedSiteTag is not found in descriptor pool. Only generated classes may derive from Message.\n\nDeleting these files simply cleans up the dead code and allows static analysis tools to correctly flag them as non-existent.\n\nBREAKING_CHANGE_REASON=Removing legacy orphaned proto files that were left behind by OwlBot to ensure accurate 0-diff parity testing.

For googleapis/librarian#7366

@sofisl
sofisl requested a review from a team as a code owner August 20, 2026 21:25
@product-auto-label product-auto-label Bot added the api: analyticsadmin Issues related to the Analytics Admin API API. label Aug 20, 2026
@snippet-bot

snippet-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

Here is the summary of changes.

You are about to delete 17 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@sofisl

sofisl commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

will wait till I get a review to add

BREAKING_CHANGE_REASON=Removing legacy orphaned proto files that were left behind by OwlBot to ensure accurate 0-diff parity testing.

@sofisl

sofisl commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

For reviewers concerned about backwards compatibility:

Any customer code attempting to use these deleted classes is already broken and crashing in production.

Because the upstream .proto definitions were removed, the protobuf compiler previously removed these classes from the generated GPBMetadata descriptor pool. Because OwlBot left the PHP class files behind, they can still be referenced in code, but attempting to instantiate them immediately throws a Fatal PHP Exception before any API call is made.

Example instantiation of an orphaned class:

$request = new \Google\Analytics\Admin\V1alpha\CreateConnectedSiteTagRequest();

Output:

PHP Fatal error:  Uncaught InvalidArgumentException: Google\Analytics\Admin\V1alpha\CreateConnectedSiteTagRequest is not found in descriptor pool. Only generated classes may derive from Message.

Deleting these files simply cleans up the dead code and allows static analysis tools to correctly flag them as non-existent.

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

Labels

api: analyticsadmin Issues related to the Analytics Admin API API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant