Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .generator/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -996,8 +996,11 @@ def _run_nox_sessions(library_id: str, repo: str, is_mono_repo: bool):
is_mono_repo(bool): True if the current repository is a mono-repo.
"""
session_runtime = "3.14"
# TODO(https://github.com/googleapis/google-cloud-python/issues/14992): Switch the protobuf
# implementation back to upb once we identify the root cause of the crash that occurs during testing.
# It's not trivial to debug this since it only happens in cloud build.
sessions = [
f"unit-{session_runtime}(protobuf_implementation='upb')",
f"unit-{session_runtime}(protobuf_implementation='python')",
]
Comment on lines +999 to 1004
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To make this temporary change more explicit and easier to revert, consider extracting the protobuf_implementation value into a variable. This isolates the temporary value and makes the code's intent clearer.

Suggested change
# TODO(https://github.com/googleapis/google-cloud-python/issues/14992): Switch the protobuf
# implementation back to upb once we identify the root cause of the crash that occurs during testing.
# It's not trivial to debug this since it only happens in cloud build.
sessions = [
f"unit-{session_runtime}(protobuf_implementation='upb')",
f"unit-{session_runtime}(protobuf_implementation='python')",
]
# TODO(https://github.com/googleapis/google-cloud-python/issues/14992): Switch the protobuf
# implementation back to upb once we identify the root cause of the crash that occurs during testing.
# It's not trivial to debug this since it only happens in cloud build.
protobuf_implementation = "python" # Revert to "upb" once the issue is resolved.
sessions = [
f"unit-{session_runtime}(protobuf_implementation='{protobuf_implementation}')",
]

current_session = None
try:
Expand Down
4 changes: 2 additions & 2 deletions .generator/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,15 +794,15 @@ def test_run_nox_sessions_success(
mock_run_individual_session = mocker.patch("cli._run_individual_session")

sessions_to_run = [
f"unit-{nox_session_python_runtime}(protobuf_implementation='upb')",
f"unit-{nox_session_python_runtime}(protobuf_implementation='python')",
]
_run_nox_sessions("mock-library", "repo", is_mono_repo)

assert mock_run_individual_session.call_count == len(sessions_to_run)
mock_run_individual_session.assert_has_calls(
[
mocker.call(
f"unit-{nox_session_python_runtime}(protobuf_implementation='upb')",
f"unit-{nox_session_python_runtime}(protobuf_implementation='python')",
Comment on lines +797 to +805
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The session string f"unit-{nox_session_python_runtime}(protobuf_implementation='python')" is duplicated here and on line 805. To improve maintainability and avoid potential inconsistencies, consider extracting it into a variable.

For example:

session_name = f"unit-{nox_session_python_runtime}(protobuf_implementation='python')"
sessions_to_run = [session_name]
# ...
mocker.call(session_name, ...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ack. I'm going to skip this for now as I want to minimize changes while debugging #14992

"mock-library",
"repo",
is_mono_repo,
Expand Down
Loading