Fix part of #6106: Implement generate changelog workflow and update bazel setup step - #6341
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: Team 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 |
Coverage ReportResultsNumber of files assessed: 4 Passing coverageFiles with passing code coverage
Exempted coverageFiles exempted from coverage
|
adhiamboperes
left a comment
There was a problem hiding this comment.
Thanks @Sandesh282, everything LGTM
|
Unassigning @adhiamboperes since they have already approved the PR. |
|
Hi @Sandesh282, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to merge this PR once the CI checks pass and you're happy with it. Thanks! |
|
@adhiamboperes Disabling auto-merge since Sean requested some changes. |
Coverage ReportResultsNumber of files assessed: 362 Passing coverageFiles with passing code coverage
Exempted coverageFiles exempted from coverage
|
|
Unassigning @adhiamboperes since they have already approved the PR. |
|
Hi @Sandesh282, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to merge this PR once the CI checks pass and you're happy with it. Thanks! |
Coverage ReportResultsNumber of files assessed: 362 Passing coverageFiles with passing code coverage
Exempted coverageFiles exempted from coverage
|
Fixes part of #6106
Explanation
This PR introduces generate changelog workflow, the GitHub Actions workflow that automates changelog generation whenever the minor version is bumped in
version.bzl. Additionally, this PR removes the placeholder changelog 0.18.md file and removesautomated-changeloglabel from generate changelog script. Along with that this PR also updates build_and_sign workflows' bazel setup step to use version instead of commit sha.The workflow triggers on any push to develop that touches
version.bzl(and can also be triggered manually viaworkflow_dispatch). It authenticates to GCP via Workload Identity Federation, obtains a short-lived access token, and runs theGenerateChangelogsKotlin script. The script determines the previous version fromversion.bzl, collects merged PRs between the two most recent release branches, calls Vertex AI to generate a 2-3 sentence user-facing summary, and opens a PR addingconfig/changelogs/<version>.md. If the Vertex AI call fails, the PR is still created with a raw commit list and an<!-- LLM generation failed -->marker for the coordinator to fill in manually.Three non-sensitive configuration values (
GCP_PROJECT,GCP_LOCATION,VERTEX_MODEL) are expected as GitHub Actions repository variables (Settings → Variables → Actions) rather than secrets, since they do not need to be masked in logs.Infrastructure Prerequisites
Before this workflow is functional, the following one-time GCP setup is required:
roles/aiplatform.useron the specific Vertex model resource (not the whole project).This keeps the blast radius of a compromised changelog workflow limited to Vertex AI calls; it cannot touch signing keys, Play Console, or artifact registry.attribute.job_workflow_refso GCP will only federate a token whengenerate_changelog.ymlis specifically the workflow running:GCP_CHANGELOG_SERVICE_ACCOUNTas a secret in theoppia-android-automation-envGitHub environment (the email of the SA created in step 1).
Disclosure of LLM Usage
AI was used for debugging, code-completion and research.
Essential Checklist