Skip to content

fix: include mismatched PHP namespaces in package error - #853

Open
amarkdotdev wants to merge 4 commits into
googleapis:mainfrom
amarkdotdev:fix/668-namespace-mismatch-error
Open

amarkdotdev wants to merge 4 commits into
googleapis:mainfrom
amarkdotdev:fix/668-namespace-mismatch-error

Conversation

@amarkdotdev

Copy link
Copy Markdown

Summary

  • Improve the package PHP namespace mismatch error to include the package name, distinct namespaces, and per-file namespace mapping.
  • Add a unit test covering the richer error details.

Fixes #668

Notes

  • Contributor will sign the Google CLA if required for this repository.

Test plan

  • Review updated exception text in CodeGenerator
  • Run tests/Unit/CodeGeneratorNamespaceTest.php (or full unit suite) in CI

@amarkdotdev
amarkdotdev requested a review from a team as a code owner August 9, 2026 19:50
@amarkdotdev

Copy link
Copy Markdown
Author

integration test failure looks like infra — bazel can't fetch zlib (checksum mismatch from zlib.net), not related to this change

Surface the package name, distinct namespaces, and per-file namespace
mapping so casing typos are easier to locate in large proto packages.

Signed-off-by: amarkdotdev <amarkdotdev@users.noreply.github.com>

Signed-off-by: Aaron <amark@g.jct.ac.il>
@amarkdotdev
amarkdotdev force-pushed the fix/668-namespace-mismatch-error branch from a24b325 to 924d9f9 Compare August 29, 2026 18:35
@amarkdotdev

Copy link
Copy Markdown
Author

rebased onto main

@amarkdotdev

Copy link
Copy Markdown
Author

Friendly ping for merge when someone from the approver group has a moment. Presubmit was green last I checked.

@bshaffer

Copy link
Copy Markdown
Collaborator

@amarkdotdev looks like we have some test failures

Signed-off-by: Aaron <amark@g.jct.ac.il>
@amarkdotdev

Copy link
Copy Markdown
Author

@bshaffer good catch. CI was failing because FakeMessage::mergeFromString did not match the protobuf 5.x signature. Updated tests/Unit/autoload.php to use the $data / $recursion_limit parameters and pushed. Should be green on the next run.

@amarkdotdev

Copy link
Copy Markdown
Author

@bshaffer Merge ping when convenient. PHPUnit fix for protobuf 5.x is on the branch; multi-approvers/presubmit look like infra gates on my last run.

@amarkdotdev

Copy link
Copy Markdown
Author

Synced with main again; watching CI.

@amarkdotdev

Copy link
Copy Markdown
Author

Hi, I see some CI red (multi-approvers, gapic-generator-php-presubmit (gapic-images)). I am happy to dig in or push a fix; shout if there is something upstream side blocking fork runs.

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.

gapic: update namespce mismatch error to include mismatched namespaces

2 participants