Skip to content

feat(librarian): parse gapic_metadata for API version release notes#2815

Merged
noahdietz merged 10 commits intogoogleapis:mainfrom
noahdietz:librarian-gapic-metadata
Nov 17, 2025
Merged

feat(librarian): parse gapic_metadata for API version release notes#2815
noahdietz merged 10 commits intogoogleapis:mainfrom
noahdietz:librarian-gapic-metadata

Conversation

@noahdietz
Copy link
Copy Markdown
Contributor

@noahdietz noahdietz commented Nov 6, 2025

Add logic to extract API Version information from gapic_metadata.json found in the generated client sources and generate an API version information subsection for the change log. This is not integrated with any of the release flows yet, pending resolution of #2683.

The logic is isolated to the newly added gapic_metadata.go file so as to not pollute the other release-related functions with this currently unused logic.

Updates #2760

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 6, 2025

Codecov Report

❌ Patch coverage is 83.05085% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.32%. Comparing base (53bdb77) to head (6330a9c).
⚠️ Report is 72 commits behind head on main.

Files with missing lines Patch % Lines
internal/librarian/gapic_metadata.go 83.05% 5 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2815      +/-   ##
==========================================
- Coverage   86.50%   83.32%   -3.19%     
==========================================
  Files         120      134      +14     
  Lines       10232    10985     +753     
==========================================
+ Hits         8851     9153     +302     
- Misses        977     1414     +437     
- Partials      404      418      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@noahdietz noahdietz marked this pull request as ready for review November 6, 2025 23:49
@noahdietz noahdietz requested a review from a team as a code owner November 6, 2025 23:49
@noahdietz
Copy link
Copy Markdown
Contributor Author

Note: I will work on the coverage once I have green light on the implementation approach

@ldetmer
Copy link
Copy Markdown
Contributor

ldetmer commented Nov 7, 2025

I would like to understand the design for the actual text (let's sync offline), but a couple of other things I would like you to confirm.

This only updates the description on the release PR, which will then be used to generate the release notes in tag_and_release. Can you confirm that your changes won't break this process until you update this logic to handle the new format?

We also have a concept of bulk commits (where we associate 1 commit with several APIs and it follows a different format). Will we not display services for bulk commits?

@noahdietz noahdietz marked this pull request as draft November 7, 2025 18:01
@noahdietz
Copy link
Copy Markdown
Contributor Author

Spoke offline with @ldetmer and we are going to hold off on changing the release flow until there is more clarity on #2683.

This PR will be refactored to only include the gapic_metadata.go file and tests, but not touch any of the release artifact steps.

@noahdietz noahdietz marked this pull request as ready for review November 7, 2025 18:18
@noahdietz
Copy link
Copy Markdown
Contributor Author

Spoke offline with @ldetmer and we are going to hold off on changing the release flow until there is more clarity on #2683.

This PR will be refactored to only include the gapic_metadata.go file and tests, but not touch any of the release artifact steps.

This is done, the PR only includes gapic_metadata.json parsing and related logic.

@ldetmer
Copy link
Copy Markdown
Contributor

ldetmer commented Nov 7, 2025

/gemini review

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 introduces new functionality to parse gapic_metadata.json files and extract API version information for release notes. The logic is well-isolated in a new file, gapic_metadata.go, and is accompanied by a comprehensive set of tests in gapic_metadata_test.go.

The implementation is solid, but I have a couple of suggestions for improvement. One is a high-priority fix to ensure deterministic output in the release notes by sorting service versions, which will also prevent flaky tests. The other is a medium-priority suggestion to improve code readability and maintainability by removing a magic number and simplifying some logic.

Overall, this is a great addition. Once these points are addressed, the code will be more robust and maintainable.

@noahdietz
Copy link
Copy Markdown
Contributor Author

/gemini review

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 introduces new functionality to parse gapic_metadata.json files to extract API version information for release notes. The logic is well-contained within the new gapic_metadata.go file and is accompanied by a comprehensive set of tests in gapic_metadata_test.go. The code is clean and follows good practices. I have a few suggestions to improve robustness and clarity.

@noahdietz
Copy link
Copy Markdown
Contributor Author

/gemini review

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 introduces new functionality to parse gapic_metadata.json files and extract API version information for use in release notes. The new logic is well-contained in gapic_metadata.go and is accompanied by a comprehensive set of tests in gapic_metadata_test.go. The implementation is solid, with good error handling and deterministic sorting of results. I have one suggestion to improve the purity of the formatAPIVersionReleaseNotes function by avoiding modification of its input parameters. Overall, this is a great addition.

Copy link
Copy Markdown
Contributor

@jskeet jskeet left a comment

Choose a reason for hiding this comment

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

An initial incomplete pass - I haven't reviewed the tests yet. I strongly suspect this basically does what we want it to do though.

@noahdietz noahdietz requested a review from jskeet November 10, 2025 20:10
@jskeet
Copy link
Copy Markdown
Contributor

jskeet commented Nov 12, 2025

Just as a heads-up, I'm unlikely to get to this today, which means it'll be Monday as I'm OOO Thursday/Friday.

@ldetmer ldetmer self-requested a review November 13, 2025 15:00
ldetmer
ldetmer previously approved these changes Nov 13, 2025
@noahdietz
Copy link
Copy Markdown
Contributor Author

Just as a heads-up, I'm unlikely to get to this today, which means it'll be Monday as I'm OOO Thursday/Friday.

Monday is fine, not in a huge rush to submit this as the integration work is blocked until change log generation is redesigned.

@noahdietz noahdietz requested a review from ldetmer November 17, 2025 17:22
@noahdietz noahdietz removed the request for review from jskeet November 17, 2025 17:25
@noahdietz noahdietz merged commit 7ee0328 into googleapis:main Nov 17, 2025
8 checks passed
@noahdietz noahdietz deleted the librarian-gapic-metadata branch November 17, 2025 17:26
ldetmer added a commit that referenced this pull request Nov 20, 2025
PR created by the Librarian CLI to initialize a release. Merging this PR
will auto trigger a release.

Librarian Version: not available
Language Image:
us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/librarian-release-container:latest
<details><summary>librarian: 0.7.0</summary>

##
[0.7.0](v0.6.0...v0.7.0)
(2025-11-20)

### Features

* add command execution package with logging (#2968)
([12f4e94](12f4e949))

* add branch support to RepositoryConfig (#2906)
([2cab5d6](2cab5d65))

* add image sha as a config in repositories config (#2954)
([3d1f537](3d1f5375))

* add initial config (#2965)
([502b063](502b063c))

* add fetch package (#2964)
([53de44d](53de44d8))

* parse gapic_metadata for API version release notes (#2815)
([7ee0328](7ee03283))

* onboard 25 repositories to automation for publish-release (#2907)
([87fae04](87fae04a))

* add version command (#2894)
([8f85be0](8f85be09))

* add RequireCommand test helper (#2978)
([a820a71](a820a710))

* add initial command (#2961)
([c959aea](c959aeae))

* add `stage-release` command (#2902)
([ee05006](ee050065))

### Bug Fixes

* require git v2.28.0 (#2963)
([265ee47](265ee47f))

* enums referenced outside the package (#2952)
([7331816](73318169))

</details>
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.

3 participants