Skip to content

ci: update sdk-platform-java templates and tests for monorepo migration#12831

Open
suztomo wants to merge 1 commit intomainfrom
update-sdk-platform-java-templates
Open

ci: update sdk-platform-java templates and tests for monorepo migration#12831
suztomo wants to merge 1 commit intomainfrom
update-sdk-platform-java-templates

Conversation

@suztomo
Copy link
Copy Markdown
Member

@suztomo suztomo commented Apr 17, 2026

This PR updates the templates and tests in sdk-platform-java to reflect its new location in the google-cloud-java monorepo. It also switches the unmanaged dependency check to track gapic-libraries-bom. b/503444342

@suztomo suztomo requested a review from a team as a code owner April 17, 2026 15:13
Copy link
Copy Markdown
Contributor

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

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 updates repository references from googleapis/sdk-platform-java to googleapis/google-cloud-java across various configuration files, tests, and scripts, reflecting a move to a monorepo structure. It also includes minor CI script adjustments like removing a maven mirror setup and adding debug diffs. Feedback suggests ensuring that workflow templates are updated to match the new paths in update_generation_config.sh and renovate.json to prevent failures. Additionally, it is recommended to rename the SDK_PLATFORM_JAVA constant and associated test methods to accurately reflect the new repository name for better maintainability.


# Update composite action version to latest gapic-generator-java version
update_action "googleapis/sdk-platform-java/.github/scripts" \
update_action "googleapis/google-cloud-java/sdk-platform-java/.github/scripts" \
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.

high

The update_action call is updated to search for the new monorepo path. If the workflow templates (e.g., in .github/workflows/) still reference the old googleapis/sdk-platform-java path, this script will fail to find and update the action version. The workflow files should be updated to use the new path to ensure the generation process continues to work correctly.

],
"matchStrings": [
"uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v(?<currentValue>.+?)\\n"
"uses: googleapis/google-cloud-java/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@v(?<currentValue>.+?)\\n"
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.

high

The regex in matchStrings is updated to look for the new monorepo path. If the workflow files in the template still use the old path, Renovate will fail to match and update these dependencies. The workflow files should be updated to use the new path in conjunction with this change.

self.assertEqual(test_input + "\n", result)

def test_get_library_repository_with_common_protos_returns_sdk_platform_java(self):
config = self.__get_a_gen_config(3)
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

The test method name is now inconsistent with the updated assertion on line 186. Renaming it to reflect the new expected repository name would improve maintainability.

Suggested change
config = self.__get_a_gen_config(3)
def test_get_library_repository_with_common_protos_returns_google_cloud_java(self):


script_dir = os.path.dirname(os.path.realpath(__file__))
SDK_PLATFORM_JAVA = "googleapis/sdk-platform-java"
SDK_PLATFORM_JAVA = "googleapis/google-cloud-java"
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

The constant name SDK_PLATFORM_JAVA is now misleading as it points to the monorepo google-cloud-java. Since sdk-platform-java is now a subdirectory, renaming this constant to something like GOOGLE_CLOUD_JAVA_REPO would be more accurate and avoid confusion for future maintainers.

@suztomo suztomo force-pushed the update-sdk-platform-java-templates branch from 6f44ad4 to 3a7d92b Compare April 17, 2026 15:27
Update templates for update_generation_config.sh and renovate.json to
use the new action paths and gapic-libraries-bom.
Update SDK_PLATFORM_JAVA constant and related tests/goldens.

b/503444342
@suztomo suztomo force-pushed the update-sdk-platform-java-templates branch from 6f44ad4 to 9862492 Compare April 17, 2026 15:29
@suztomo
Copy link
Copy Markdown
Member Author

suztomo commented Apr 17, 2026

Working on this error https://github.com/googleapis/google-cloud-java/pull/12831/checks?check_run_id=71851340776:

F
======================================================================
FAIL: test_monorepo_generation (integration_tests.IntegrationTest.test_monorepo_generation)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/workspace/sdk-platform-java/.cloudbuild/library_generation/scripts/integration_tests.py", line 91, in test_monorepo_generation
    self.assertTrue(
AssertionError: False is not true :   The generated java-apigee-connect/.repo-metadata.json is different from golden.
----------------------------------------------------------------------
Ran 1 test in 0.021s
FAILED (failures=1)
**************************************************
Checking for differences in 'java-apigee-connect'.
  The expected library is in /workspace/golden/java-apigee-connect.
  The actual library is in /workspace/google-cloud-java/java-apigee-connect.
  No differences found in java-apigee-connect

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.

2 participants