Skip to content

feat(google/cloud/universalledger/v1): add google-cloud-universalledger - #19315

Open
suztomo wants to merge 1 commit into
onboard-agentregistryendpointfrom
onboard-universalledger
Open

suztomo wants to merge 1 commit into
onboard-agentregistryendpointfrom
onboard-universalledger

Conversation

@suztomo

@suztomo suztomo commented Dec 2, 2026

Copy link
Copy Markdown
Member

Onboard google/cloud/universalledger/v1 API (google-cloud-universalledger).

Internal tracking bug http://b/590858913

PiperOrigin-RevId: 1030812305

Debug Info

System Details

  • Python version: Python 3.13.18
  • OS: Linux 7.1.6-1rodete1-amd64 x86_64
  • Librarian version: v0.54.0

Commands Executed

  • go run github.com/googleapis/librarian/cmd/librarian@v0.54.0 install
  • go run github.com/googleapis/librarian/cmd/librarian@v0.54.0 add google/cloud/universalledger/v1
  • go run github.com/googleapis/librarian/cmd/librarian@v0.54.0 generate -v google-cloud-universalledger
  • go run github.com/googleapis/librarian/cmd/librarian@v0.54.0 tidy
  • git add -A
  • git commit -m "feat(google/cloud/universalledger/v1): add google-cloud-universalledger"

@suztomo
suztomo added this pull request to stack #19316 December 2, 2026 19:25

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the new google-cloud-universalledger client library, including GAPIC-generated client code, gRPC/REST transports, types, documentation, and samples. During the review, a recurring bug was identified in the REST transport (rest.py) across several methods: the response logging blocks incorrectly attempt to serialize the raw requests.Response object instead of the parsed protobuf message, which causes serialization to fail and always log the payload as None. Additionally, the reviewer recommended replacing bare except: clauses with except Exception: to comply with PEP 8 guidelines.

Comment on lines +720 to +723
try:
response_payload = universalledger.Endpoint.to_json(response)
except:
response_payload = None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

In the REST transport, the response payload logging attempts to serialize the requests.Response object (response) instead of the parsed protobuf message instance (resp). This will always raise an exception and result in response_payload being None. It should serialize resp instead. Additionally, catching all exceptions with a bare except: should be avoided; use except Exception: instead.

Suggested change
try:
response_payload = universalledger.Endpoint.to_json(response)
except:
response_payload = None
try:
response_payload = universalledger.Endpoint.to_json(resp)
except Exception:
response_payload = None
References
  1. PEP 8 recommends avoiding bare except clauses because they catch SystemExit and KeyboardInterrupt exceptions, making it harder to interrupt a program with Control-C, and can disguise other problems. (link)
  2. For telemetry and observability logging, use broad exception handling (e.g., except Exception: pass) to ensure a fail-open contract where telemetry failures do not disrupt the main application flow or pollute user logs with warnings.

Comment on lines +868 to +873
)
except:
response_payload = None
http_response = {
"payload": response_payload,
"headers": dict(response.headers),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

In the REST transport, the response payload logging attempts to serialize the requests.Response object (response) instead of the parsed protobuf message instance (resp). This will always raise an exception and result in response_payload being None. It should serialize resp instead. Additionally, catching all exceptions with a bare except: should be avoided; use except Exception: instead.

                try:
                    response_payload = universalledger.ListEndpointsResponse.to_json(
                        resp
                    )
                except Exception:
                    response_payload = None
References
  1. PEP 8 recommends avoiding bare except clauses because they catch SystemExit and KeyboardInterrupt exceptions, making it harder to interrupt a program with Control-C, and can disguise other problems. (link)
  2. For telemetry and observability logging, use broad exception handling (e.g., except Exception: pass) to ensure a fail-open contract where telemetry failures do not disrupt the main application flow or pollute user logs with warnings.

Comment on lines +1014 to +1019
response
)
except:
response_payload = None
http_response = {
"payload": response_payload,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

In the REST transport, the response payload logging attempts to serialize the requests.Response object (response) instead of the parsed protobuf message instance (resp). This will always raise an exception and result in response_payload being None. It should serialize resp instead. Additionally, catching all exceptions with a bare except: should be avoided; use except Exception: instead.

                try:
                    response_payload = universalledger.QueryAccountResponse.to_json(
                        resp
                    )
                except Exception:
                    response_payload = None
References
  1. PEP 8 recommends avoiding bare except clauses because they catch SystemExit and KeyboardInterrupt exceptions, making it harder to interrupt a program with Control-C, and can disguise other problems. (link)
  2. For telemetry and observability logging, use broad exception handling (e.g., except Exception: pass) to ensure a fail-open contract where telemetry failures do not disrupt the main application flow or pollute user logs with warnings.

Comment on lines +1161 to +1166
try:
response_payload = universalledger.QueryDataResponse.to_json(
response
)
except:
response_payload = None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

In the REST transport, the response payload logging attempts to serialize the requests.Response object (response) instead of the parsed protobuf message instance (resp). This will always raise an exception and result in response_payload being None. It should serialize resp instead. Additionally, catching all exceptions with a bare except: should be avoided; use except Exception: instead.

Suggested change
try:
response_payload = universalledger.QueryDataResponse.to_json(
response
)
except:
response_payload = None
try:
response_payload = universalledger.QueryDataResponse.to_json(
resp
)
except Exception:
response_payload = None
References
  1. PEP 8 recommends avoiding bare except clauses because they catch SystemExit and KeyboardInterrupt exceptions, making it harder to interrupt a program with Control-C, and can disguise other problems. (link)
  2. For telemetry and observability logging, use broad exception handling (e.g., except Exception: pass) to ensure a fail-open contract where telemetry failures do not disrupt the main application flow or pollute user logs with warnings.

Comment on lines +1314 to +1319
try:
response_payload = (
universalledger.QueryTransactionStateResponse.to_json(response)
)
except:
response_payload = None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

In the REST transport, the response payload logging attempts to serialize the requests.Response object (response) instead of the parsed protobuf message instance (resp). This will always raise an exception and result in response_payload being None. It should serialize resp instead. Additionally, catching all exceptions with a bare except: should be avoided; use except Exception: instead.

Suggested change
try:
response_payload = (
universalledger.QueryTransactionStateResponse.to_json(response)
)
except:
response_payload = None
try:
response_payload = (
universalledger.QueryTransactionStateResponse.to_json(resp)
)
except Exception:
response_payload = None
References
  1. PEP 8 recommends avoiding bare except clauses because they catch SystemExit and KeyboardInterrupt exceptions, making it harder to interrupt a program with Control-C, and can disguise other problems. (link)
  2. For telemetry and observability logging, use broad exception handling (e.g., except Exception: pass) to ensure a fail-open contract where telemetry failures do not disrupt the main application flow or pollute user logs with warnings.

Comment on lines +1470 to +1477
try:
response_payload = (
universalledger.SubmitOperationalTransactionResponse.to_json(
response
)
)
except:
response_payload = None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

In the REST transport, the response payload logging attempts to serialize the requests.Response object (response) instead of the parsed protobuf message instance (resp). This will always raise an exception and result in response_payload being None. It should serialize resp instead. Additionally, catching all exceptions with a bare except: should be avoided; use except Exception: instead.

Suggested change
try:
response_payload = (
universalledger.SubmitOperationalTransactionResponse.to_json(
response
)
)
except:
response_payload = None
try:
response_payload = (
universalledger.SubmitOperationalTransactionResponse.to_json(
resp
)
)
except Exception:
response_payload = None
References
  1. PEP 8 recommends avoiding bare except clauses because they catch SystemExit and KeyboardInterrupt exceptions, making it harder to interrupt a program with Control-C, and can disguise other problems. (link)
  2. For telemetry and observability logging, use broad exception handling (e.g., except Exception: pass) to ensure a fail-open contract where telemetry failures do not disrupt the main application flow or pollute user logs with warnings.

Comment on lines +1624 to +1629
): # pragma: NO COVER
try:
response_payload = (
universalledger.SubmitTransactionResponse.to_json(response)
)
except:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

In the REST transport, the response payload logging attempts to serialize the requests.Response object (response) instead of the parsed protobuf message instance (resp). This will always raise an exception and result in response_payload being None. It should serialize resp instead. Additionally, catching all exceptions with a bare except: should be avoided; use except Exception: instead.

                try:
                    response_payload = (
                        universalledger.SubmitTransactionResponse.to_json(resp)
                    )
                except Exception:
                    response_payload = None
References
  1. PEP 8 recommends avoiding bare except clauses because they catch SystemExit and KeyboardInterrupt exceptions, making it harder to interrupt a program with Control-C, and can disguise other problems. (link)
  2. For telemetry and observability logging, use broad exception handling (e.g., except Exception: pass) to ensure a fail-open contract where telemetry failures do not disrupt the main application flow or pollute user logs with warnings.

@suztomo
suztomo force-pushed the onboard-universalledger branch from cd792f6 to 6cb7f4a Compare December 2, 2026 23:26
@suztomo
suztomo marked this pull request as ready for review December 2, 2026 23:27
@suztomo
suztomo requested review from a team as code owners December 2, 2026 23:27
@snippet-bot

snippet-bot Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 14 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

@suztomo
suztomo force-pushed the onboard-universalledger branch from 6cb7f4a to 5cb9c6b Compare December 3, 2026 02:05

This branch has not been deployed

No deployments
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