Skip to content

Conversation

@suztomo
Copy link
Member

@suztomo suztomo commented Nov 27, 2025

  • fix: hermetic build to create one line per new library
  • format
  • fix: fix_poms.py to add one line in versions.txt for new library

@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Nov 27, 2025
@suztomo
Copy link
Member Author

suztomo commented Dec 2, 2025

https://pantheon.corp.google.com/cloud-build/builds;region=us-central1/cdd4796e-db91-4dd1-9a1f-5468ddccc0e4;step=5?project=java-hermetic-build-prod failed at https://github.com/googleapis/sdk-platform-java/blob/main/.cloudbuild/library_generation/scripts/integration_tests.py#L97 :

            self.assertFalse(
                self.compare_xml(
                    f"{golden_dir}/gapic-libraries-bom/pom.xml",
                    f"{repo_dest}/gapic-libraries-bom/pom.xml",
                    False,
                )
only in /workspace/golden/gapic-libraries-bom/pom.xml
--
  | //project/version=1.36.0-SNAPSHOT: 1
  | //project/parent/version=1.36.0-SNAPSHOT: 1
  | only in /workspace/google-cloud-java/gapic-libraries-bom/pom.xml
  | //project/version=0.20.0-SNAPSHOT: 1
  | //project/parent/version=0.20.0-SNAPSHOT: 1
  | F
  | ======================================================================
  | FAIL: test_monorepo_generation (integration_tests.IntegrationTest.test_monorepo_generation)
  | ----------------------------------------------------------------------
  | Traceback (most recent call last):
  | File "/workspace/.cloudbuild/library_generation/scripts/integration_tests.py", line 97, in test_monorepo_generation
  | self.assertFalse(
  | AssertionError: True is not false
  |  
  | ----------------------------------------------------------------------
  | Ran 1 test in 0.030s

``

@suztomo
Copy link
Member Author

suztomo commented Dec 2, 2025

https://github.com/googleapis/sdk-platform-java/actions/runs/19856753643/job/56896501729?pr=3994

FAIL: test_generate_postprocessing_prerequisite_files_monorepo_success (library_generation.tests.utilities_unit_tests.UtilitiesTest.test_generate_postprocessing_prerequisite_files_monorepo_success)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/google/home/suztomo/sdk-platform-java/hermetic_build/library_generation/tests/utilities_unit_tests.py", line 214, in test_generate_postprocessing_prerequisite_files_monorepo_success
    file_comparator.compare_files(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        f"{library_path}/owlbot.py", f"{library_path}/owlbot-golden.py"
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/google/home/suztomo/sdk-platform-java/hermetic_build/library_generation/tests/test_utils.py", line 29, in compare_files
    self.assertEqual(
    ~~~~~~~~~~~~~~~~^
        first=[], second=diff, msg="Unexpected file contents:\n" + "".join(diff)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
AssertionError: Lists differ: [] != ['--- \n', '+++ \n', '@@ -21,16 +21,19 @@\[829 chars])\n']

Second list contains 35 additional elements.
First extra element 0:
'--- \n'

Diff is 986 characters long. Set self.maxDiff to None to see it. : Unexpected file contents:
--- 
+++ 
@@ -21,16 +21,19 @@
     s.move(library)
 
 s.remove_staging_dirs()
-java.common_templates(monorepo=True, excludes=[
-    ".github/*",
-    ".kokoro/*",
-    "samples/*",
-    "CODE_OF_CONDUCT.md",
-    "CONTRIBUTING.md",
-    "LICENSE",
-    "SECURITY.md",
-    "java.header",
-    "license-checks.xml",
-    "renovate.json",
-    ".gitignore"
-])+java.common_templates(
+    monorepo=True,
+    excludes=[
+        ".github/*",
+        ".kokoro/*",
+        "samples/*",
+        "CODE_OF_CONDUCT.md",
+        "CONTRIBUTING.md",
+        "LICENSE",
+        "SECURITY.md",
+        "java.header",
+        "license-checks.xml",
+        "renovate.json",
+        ".gitignore",
+    ],
+)


(.venv) suztomo@suztomo:~/sdk-platform-java$ python -m unittest discover -s hermetic_build -p '*unit_tests.py' can reproduce the issue.

It looks formating difference.

:

java.common_templates(monorepo=True, excludes=[
    ".github/*",

monorepo=True is in the same line as java.common_templates(, while

{% if should_include_templates %}java.common_templates(monorepo=True, {% if template_excludes %}excludes=[
has:

{% if should_include_templates %}java.common_templates(monorepo=True, {% if template_excludes %}excludes=[

monorepo=True is in the same line as java.common_templates(.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant