Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the new client library package google-cloud-agentregistryendpoint, which implements the localized dataplane API for Agent Registry. The changes include the generated GAPIC client code, documentation, unit tests, and samples, along with updates to the repository's release configuration files. The review feedback correctly identifies a PEP 8 violation in rest.py where a bare except: clause is used, and recommends catching Exception instead to prevent catching system-exiting exceptions.
| method = transcoded_request["method"] | ||
| try: | ||
| request_payload = type(request).to_json(request) | ||
| except: |
There was a problem hiding this comment.
This line uses a bare except: clause, which is a violation of PEP 8 style guidelines. Bare except: clauses catch all exceptions, including SystemExit, KeyboardInterrupt, and GeneratorExit, which can make it difficult to interrupt the program (e.g., via Ctrl+C) and can hide unexpected bugs. It is highly recommended to catch Exception instead, or specific exceptions like AttributeError or TypeError since to_json might not be available or fail to serialize.
| except: | |
| except Exception: |
References
- PEP 8: Programming Recommendations - When catching exceptions, mention specific exceptions whenever possible instead of using a bare except: clause. (link)
c8606f8 to
1617805
Compare
…19322) ## Context & Problem Libraries that import google.cloud.agentregistry.v1 proto types (such as google-cloud-agentregistryendpoint in #19314) are missing google-cloud-agentregistry in generated setup.py and testing constraint files because _pypi_packages.j2 does not map this API yet. ## Summary of Changes - Add ("google", "cloud", "agentregistry", "v1") mapped to google-cloud-agentregistry (>= 0.1.2, < 1.0.0) in packages/gapic-generator/gapic/templates/_pypi_packages.j2, matching #18826 and #19022. ## Why This Approach Declaring cross-API PyPI packages in _pypi_packages.j2 lets setup.py.j2 and the testing constraint templates emit the dependency automatically during regeneration instead of maintaining per-package post-processing overrides. ## Intentionally Out of Scope - Bumping the pinned gapic-generator commit SHA in librarian.yaml or regenerating google-cloud-agentregistryendpoint (handled separately after merge). - Adding a temporary post-processing override in .librarian/generator-input/client-post-processing/add-missing-dependencies-to-setup-py-constraints.yaml. ## Verification nox -s lint mypy-3.14 unit-3.14 passed in packages/gapic-generator.
|
Hi @suztomo, presubmits are failing with To unblock this PR (and your stacked #19315 / #19317) right away without waiting for a repo-wide generator bump, could you apply the same bridge used for
Once CI is green, happy to approve! |
1617805 to
d21128c
Compare
Onboard google/cloud/agentregistryendpoint/v1 API (google-cloud-agentregistryendpoint).
Internal tracking bug http://b/590946763
PiperOrigin-RevId: 1030994426
Debug Info
System Details
Commands Executed
go run github.com/googleapis/librarian/cmd/librarian@v0.54.0 installgo run github.com/googleapis/librarian/cmd/librarian@v0.54.0 add google/cloud/agentregistryendpoint/v1go run github.com/googleapis/librarian/cmd/librarian@v0.54.0 generate -v google-cloud-agentregistryendpointgo run github.com/googleapis/librarian/cmd/librarian@v0.54.0 tidygit add -Agit commit -m "feat(google/cloud/agentregistryendpoint/v1): add google-cloud-agentregistryendpoint"