Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Owlbot/Java] Owlbot README updates for libraries-bom version incorrect #1844

Open
kolea2 opened this issue Aug 1, 2023 · 7 comments
Open
Assignees
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@kolea2
Copy link
Collaborator

kolea2 commented Aug 1, 2023

Hi, we've noticed the libraries-bom version owlbot picks for the README file in java-bigtable is mismatched/incorrect. See the following update: googleapis/java-bigtable@f9464e2

It's adding two different versions, 26.20.0 and 26.21.0 in different places. I tried to fix it by hand but rerunning owlbot just reverted back to this incorrect state.

@kolea2 kolea2 added the type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. label Aug 1, 2023
@SurferJeffAtGoogle SurferJeffAtGoogle added the priority: p2 Moderately-important priority. Fix may not be included in next release. label Aug 2, 2023
@SurferJeffAtGoogle
Copy link
Contributor

@suztomo This issue will fall out of SLO in 6 days.

@suztomo
Copy link
Member

suztomo commented Oct 25, 2023

Checking

@suztomo
Copy link
Member

suztomo commented Oct 25, 2023

The template (

<version>{{ metadata['latest_bom_version'] }}</version>
) has

      <version>{{ metadata['latest_bom_version'] }}</version>
implementation platform('com.google.cloud:libraries-bom:{{metadata['latest_bom_version']}}')

They both reference the same value. The commit googleapis/java-bigtable@f9464e2 does not make sense.

Fortunately (?), the problem has been happening in the main branch too:
image

@suztomo
Copy link
Member

suztomo commented Oct 25, 2023

does not make sense.

Actually the first one comes from {{ metadata['snippets'][metadata['repo']['api_shortname'] + '_install_with_bom'] }} .

The value comes from https://github.com/googleapis/java-bigtable/blob/0830fa5dad0a2ba1d6abf9883162dbb13ef6a8e1/samples/snippets/pom.xml#L33

  <!-- [START bigtable_install_with_bom] -->
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>libraries-bom</artifactId>
        <version>26.20.0</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

Root Cause

The root cause of the discrepancy is that, for a split repository (such as java-bigtable),

  • the BOM usage comes from samples/snippets/pom.xml. RenovateBot is responsible to update the version value. RenovateBot seems to have stopped updating the value since 3 months ago.
  • the Gradle usage comes from the README template {{ metadata['latest_bom_version'] }}. OwlBot Java postprocessor is responsible to fill the version value.

Retriggering RenovateBot

RenovateBot pull request has been paused in googleapis/java-bigtable#332

Screenshot 2023-10-25 at 5 16 53 PM

I just clicked the checkbox.

@suztomo
Copy link
Member

suztomo commented Oct 26, 2023

That checkbox doesn't create a pull request. Why?

Why doesn't RenovateBot work for the libraries-bom in java-bigtable?

image

RenovateBot log: The log https://developer.mend.io/github/googleapis/java-bigtable/

https://developer.mend.io/github/googleapis/java-bigtable/-/job/5d71915d-5fd5-4510-b6ed-0d5eddda14ef

DEBUG: syncBranchState() (branch="renovate/com.google.cloud-libraries-bom-26.x")
DEBUG: getBranchPr(renovate/com.google.cloud-libraries-bom-26.x) (branch="renovate/com.google.cloud-libraries-bom-26.x")
DEBUG: findPr(renovate/com.google.cloud-libraries-bom-26.x, undefined, open) (branch="renovate/com.google.cloud-libraries-bom-26.x")
DEBUG: findPr(renovate/com.google.cloud-libraries-bom-26.x, undefined, closed) (branch="renovate/com.google.cloud-libraries-bom-26.x")
DEBUG: branchExists=true (branch="renovate/com.google.cloud-libraries-bom-26.x")
DEBUG: dependencyDashboardCheck=rebase (branch="renovate/com.google.cloud-libraries-bom-26.x")
DEBUG: Check for closed PR because recreating closed PRs is disabled. (branch="renovate/com.google.cloud-libraries-bom-26.x")
DEBUG: findPr(renovate/com.google.cloud-libraries-bom-26.x, chore(deps): update dependency com.google.cloud:libraries-bom to v26.26.0, !open) (branch="renovate/com.google.cloud-libraries-bom-26.x")
DEBUG: prAlreadyExisted=false (branch="renovate/com.google.cloud-libraries-bom-26.x")
DEBUG: Checking if PR has been edited (branch="renovate/com.google.cloud-libraries-bom-26.x")
DEBUG: branch.isModified(): using cached result "true" (branch="renovate/com.google.cloud-libraries-bom-26.x")
DEBUG: findPr(renovate/com.google.cloud-libraries-bom-26.x, undefined, !open) (branch="renovate/com.google.cloud-libraries-bom-26.x")
DEBUG: Found PR #1868 (branch="renovate/com.google.cloud-libraries-bom-26.x")
DEBUG: Found old PR but the SHA is different (branch="renovate/com.google.cloud-libraries-bom-26.x")
{
  "oldPrNumber": 1868
  "oldPrSha": "7ce7ab94eed1b645c7e060c66dd40fc42c6c82df"
  "branchSha": "7dff6f7f60010a9e2fc7140499fc540152b36052"
}

suztomo added a commit to suztomo/java-bigtable that referenced this issue Oct 26, 2023
Somehow the RenovateBot stopped working for libraries-bom
in this repository. Troubleshooting:
googleapis/synthtool#1844

Followed https://github.com/googleapis/java-bigtable/pull/1868/files
@suztomo suztomo added priority: p3 Desirable enhancement or fix. May not be included in next release. and removed priority: p2 Moderately-important priority. Fix may not be included in next release. labels Oct 27, 2023
@suztomo
Copy link
Member

suztomo commented Oct 27, 2023

Changed priority to avoid OOSLO alert.

@suztomo
Copy link
Member

suztomo commented Oct 27, 2023

Solution

If the Maven configuration section is actually the same across split repo libraries, there's no point to use the value from samples/snippets/pom.xml.

Shall we replace the {{ metadata['snippets'][metadata['repo']['api_shortname'] + '_install_with_bom'] }] with actual Maven pom parts if that's the case?

Things to survey: among the split repositories that use the README.md template, which ones are ok to show the Maven configuration and which ones need customized code from samples/snippets/pom.xml?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

4 participants