Fix part of #6106: Implement GenerateChangelogs script with Vertex AI integration#6313
Fix part of #6106: Implement GenerateChangelogs script with Vertex AI integration#6313Sandesh282 wants to merge 13 commits into
Conversation
…eration Introduces a narrow VertexAiClient interface abstracting Vertex AI text generation calls, and a FakeVertexAiClient for unit testing. The fake records all received prompts, supports a configurable shouldFail flag (auto-resets after each throw), and exposes a reset() helper — matching the same pattern as FakePlayConsoleClient and FakeCloudSigner. Part of fix #6106 (M2 PR 2.1 — GenerateChangelogs script).
Implements VertexAiClient using OkHttp + Moshi to call the Vertex AI generateContent REST endpoint. Auth is via a GCP Bearer token obtained through Workload Identity Federation in CI. Key details: - Sends synchronous HTTP POST to the generateContent endpoint - Parses candidates[0].content.parts[0].text from the JSON response - Fails with a descriptive message on non-2xx status or empty response - apiBaseUrl is a companion object var, overridable in tests to point at a local MockWebServer without subclassing Part of fix #6106 (M2 PR 2.1 — GenerateChangelogs script).
…og PRs Implements the GenerateChangelogs.kt script that: 1. Reads MAJOR/MINOR_VERSION from version.bzl to derive the previous version whose changelog needs to be generated (e.g. bump 0.17→0.18 generates 0.17) 2. Finds the commit range between the two most recent release branch merge-bases 3. Collects merged PRs (via 'git log --oneline') and parses Fixes/Closes #NNNN issue references from commit subjects 4. Invokes Vertex AI (Gemini) with a structured prompt to produce a 2-3 sentence user-facing summary of the release 5. Falls back to a raw commit list with a <!-- LLM generation failed --> marker if the Vertex AI call throws, so the PR is still created for human review 6. Creates/updates a PR on 'automated/changelog-<version>' branch via 'gh pr create' with links to all reference material in the PR body Also adds Bazel library and binary targets for all new source files, following the same visibility pattern as the existing release automation targets. Part of fix #6106 (M2 PR 2.1 — GenerateChangelogs script).
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Will be adding unit test suite soon! |
Coverage ReportResultsNumber of files assessed: 4 Failure Cases
|
|
Hi @Sandesh282, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue. |
Coverage ReportResultsNumber of files assessed: 11 Passing coverageFiles with passing code coverage
Exempted coverageFiles exempted from coverage
|
Coverage ReportResultsNumber of files assessed: 11 Passing coverageFiles with passing code coverage
Exempted coverageFiles exempted from coverage
|
Fixes part of #6106
Explanation
Adds the GenerateChangelogs.kt script that automates changelog generation between release branches. The script collects commits and linked GitHub issues between two release branches, sends them to Vertex AI (Gemini) to generate a human-readable changelog, writes the output to config/changelogs/, and opens a GitHub PR with the result. Includes LLM fallback logic for when the API is unavailable.
Files modified
Files created
Essential Checklist