[#463] Github Action: Generate and add "release notes" when distributing new builds on Firebase (staging and production)#629
Conversation
📝 WalkthroughWalkthroughAdds a new GitHub Actions workflow to deploy production APKs to Firebase App Distribution and refactors the existing staging workflow to remove production steps. Both workflows now support manual dispatch with testerGroups input and generate release notes from git history; build, static analysis, and test steps are standardized. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer (push / dispatch)
participant GH as GitHub Actions
participant Runner as Actions Runner (ubuntu)
participant Build as Gradle Build (JDK 17)
participant QA as Static Analysis / Tests (Detekt, Kover)
participant Firebase as Firebase App Distribution
Dev->>GH: push to main / workflow_dispatch
GH->>Runner: start job
Runner->>Build: setup JDK 17, checkout (fetch-depth:0)
Runner->>Build: restore Gradle caches
Runner->>QA: run Detekt -> archive reports
Runner->>QA: run Kover tests -> archive coverage
Runner->>Build: assemble production pre-release APK
Runner->>GH: generate release notes from git -> output RELEASE_NOTES
Runner->>Firebase: deploy APK (+ SERVICE_ACCOUNT, testerGroups, RELEASE_NOTES)
Firebase-->>Dev: notify testers / release published
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
.cicdtemplate/.github/workflows/deploy_production_to_firebase_app_distribution.yml (1)
20-24:actions/setup-java@v3is two major versions behind (current: v5).The official documentation examples for
actions/setup-javanow reference@v5. v4 updated the Node.js runtime to version 20 instead of 16, and v5 has further improvements. Using@v3runs on an EOL Node 16 runtime.- uses: actions/setup-java@v3 + uses: actions/setup-java@v5🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.cicdtemplate/.github/workflows/deploy_production_to_firebase_app_distribution.yml around lines 20 - 24, The workflow uses actions/setup-java@v3 which pins an old major version and runs on EOL Node 16; update the action reference to actions/setup-java@v5 in the job step that currently reads "Set up JDK 17" (the step using actions/setup-java@v3) so the workflow uses the latest supported runtime and improvements; verify the existing with keys (distribution: 'temurin' and java-version: '17') remain valid under v5 and adjust any required inputs per the v5 docs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
@.cicdtemplate/.github/workflows/deploy_production_to_firebase_app_distribution.yml:
- Around line 65-70: The generate-release-notes step fails when no git tags
exist because `git describe --abbrev=0 --tags` exits non‑zero; modify the step
(id: generate-release-notes) to guard that command by capturing a fallback value
and using it conditionally — e.g. set TAG=$(git describe --abbrev=0 --tags
2>/dev/null || echo "") and then run git log using either "$TAG..HEAD" when TAG
is nonempty or just HEAD (or the initial commit via `$(git rev-list
--max-parents=0 HEAD)`) when TAG is empty, then echo the resulting release notes
to $GITHUB_OUTPUT as before so the step doesn't fail on repos without tags.
- Around line 7-12: The workflow defines a workflow_dispatch input named
testerGroups but never uses it; update the Firebase App Distribution step to
reference the input (e.g., use ${{ inputs.testerGroups }} with a fallback to
vars.TESTER_GROUPS or a sensible default) instead of the hardcoded groups:
testers value so the groups field consumes the testerGroups input from
workflow_dispatch; locate the workflow_dispatch section and the action that sets
groups and replace the hardcoded 'testers' with the input expression.
In
@.cicdtemplate/.github/workflows/deploy_staging_to_firebase_app_distribution.yml:
- Around line 9-14: The testerGroups workflow_dispatch input is never used;
update the Deploy staging step so its groups field reads the input with
github.event.inputs.testerGroups (falling back to vars.TESTER_GROUPS or to
"testers" if needed). Locate the workflow_dispatch inputs block (testerGroups)
and the Deploy staging step where groups: "testers" is hardcoded, replace the
hardcoded value with an expression that prefers
github.event.inputs.testerGroups, then vars.TESTER_GROUPS, then the literal
"testers" as the final default.
- Around line 70-75: The "Generate release notes" step (id:
generate-release-notes) currently inverts the conditional and emits an empty
string when bracketed ticket lines exist; update the run block so that it first
attempts to extract the bracketed lines with git log -1 --merges piped to grep
"\[" and, if that succeeds, echo those lines to $GITHUB_OUTPUT, otherwise echo
the full commit body from git log -1 --merges --format=%B; in short, swap the
branches of the current &&/|| or replace the pipeline so success prints the grep
results and failure falls back to the full commit message.
---
Nitpick comments:
In
@.cicdtemplate/.github/workflows/deploy_production_to_firebase_app_distribution.yml:
- Around line 20-24: The workflow uses actions/setup-java@v3 which pins an old
major version and runs on EOL Node 16; update the action reference to
actions/setup-java@v5 in the job step that currently reads "Set up JDK 17" (the
step using actions/setup-java@v3) so the workflow uses the latest supported
runtime and improvements; verify the existing with keys (distribution: 'temurin'
and java-version: '17') remain valid under v5 and adjust any required inputs per
the v5 docs.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.cicdtemplate/.github/workflows/deploy_production_to_firebase_app_distribution.yml.cicdtemplate/.github/workflows/deploy_staging_to_firebase_app_distribution.yml
.cicdtemplate/.github/workflows/deploy_production_to_firebase_app_distribution.yml
Show resolved
Hide resolved
.cicdtemplate/.github/workflows/deploy_production_to_firebase_app_distribution.yml
Show resolved
Hide resolved
.cicdtemplate/.github/workflows/deploy_staging_to_firebase_app_distribution.yml
Show resolved
Hide resolved
.cicdtemplate/.github/workflows/deploy_staging_to_firebase_app_distribution.yml
Show resolved
Hide resolved
Kover report for template-compose:🧛 Template - Compose Unit Tests Code Coverage:
|
| File | Coverage |
|---|
Modified Files Not Found In Coverage Report:
deploy_production_to_firebase_app_distribution.yml
deploy_staging_and_production_to_firebase_app_distribution.yml
Codebase cunningly covered by count Shroud 🧛
Generated by 🚫 Danger
…r distribution build on Firebase
6d6ab08 to
057bd23
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
.cicdtemplate/.github/workflows/deploy_staging_to_firebase_app_distribution.yml (1)
70-75:⚠️ Potential issue | 🟠 MajorRelease notes command is broken and flips the fallback.
$((...))is arithmetic expansion, so the pipeline won’t execute as intended; the logic also yields empty notes when bracketed lines exist.🐛 Proposed fix
- name: Generate release notes id: generate-release-notes run: | echo 'RELEASE_NOTES<<EOF' >> $GITHUB_OUTPUT - echo "$((git log -1 --merges | grep "\[") | grep . && echo "" || echo $(git log -1 --merges --format=%B))" >> $GITHUB_OUTPUT + FILTERED=$(git log -1 --merges | grep "\[" || true) + echo "${FILTERED:-$(git log -1 --merges --format=%B)}" >> $GITHUB_OUTPUT echo 'EOF' >> $GITHUB_OUTPUT🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.cicdtemplate/.github/workflows/deploy_staging_to_firebase_app_distribution.yml around lines 70 - 75, The release notes step (id: generate-release-notes) uses arithmetic expansion `$((...))` causing the pipeline not to run and inverts the fallback logic; replace `$((git log -1 --merges | grep "\[") | grep . && echo "" || echo $(git log -1 --merges --format=%B))` with a proper shell conditional or command substitution so the pipeline actually runs and yields bracketed merge lines when present, otherwise falls back to the commit body: e.g., use command substitution $(git log -1 --merges | grep "\[" ) and test its output (or use `if git log -1 --merges | grep -q "\["; then ...; else ...; fi`) before echoing into the RELEASE_NOTES<<EOF block to ensure correct behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In
@.cicdtemplate/.github/workflows/deploy_staging_to_firebase_app_distribution.yml:
- Around line 70-75: The release notes step (id: generate-release-notes) uses
arithmetic expansion `$((...))` causing the pipeline not to run and inverts the
fallback logic; replace `$((git log -1 --merges | grep "\[") | grep . && echo ""
|| echo $(git log -1 --merges --format=%B))` with a proper shell conditional or
command substitution so the pipeline actually runs and yields bracketed merge
lines when present, otherwise falls back to the commit body: e.g., use command
substitution $(git log -1 --merges | grep "\[" ) and test its output (or use `if
git log -1 --merges | grep -q "\["; then ...; else ...; fi`) before echoing into
the RELEASE_NOTES<<EOF block to ensure correct behavior.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.cicdtemplate/.github/workflows/deploy_production_to_firebase_app_distribution.yml.cicdtemplate/.github/workflows/deploy_staging_to_firebase_app_distribution.yml
🚧 Files skipped from review as they are similar to previous changes (1)
- .cicdtemplate/.github/workflows/deploy_production_to_firebase_app_distribution.yml
#463
What happened 👀
stagingandproductionindividuallyworkflow_dispatchfetch-depth: 0to checkout step to avoid missing release notes on when fetching the huge changes on base branchInsight 📝
N/A
Proof Of Work 📹
The changes is on
cicdtemplatefolder so we can't verify the result. Actually the step to generate release notes is running on our other projects ✅Summary by CodeRabbit