Skip to content

[#463] Github Action: Generate and add "release notes" when distributing new builds on Firebase (staging and production)#629

Merged
hoangnguyen92dn merged 1 commit intodevelopfrom
chore/463-generate-and-add-release-notes-when-distributing-new-builds-on-firebase
Feb 27, 2026
Merged

[#463] Github Action: Generate and add "release notes" when distributing new builds on Firebase (staging and production)#629
hoangnguyen92dn merged 1 commit intodevelopfrom
chore/463-generate-and-add-release-notes-when-distributing-new-builds-on-firebase

Conversation

@hoangnguyen92dn
Copy link
Copy Markdown
Contributor

@hoangnguyen92dn hoangnguyen92dn commented Feb 24, 2026

#463

What happened 👀

  • Split build to support for staging and production individually
  • Support trigger build manually by adding workflow_dispatch
  • Add the release notes generation step in the staging and production workflow
  • Add fetch-depth: 0 to checkout step to avoid missing release notes on when fetching the huge changes on base branch

Insight 📝

N/A

Proof Of Work 📹

The changes is on cicdtemplate folder so we can't verify the result. Actually the step to generate release notes is running on our other projects ✅

Summary by CodeRabbit

  • Chores
    • Added an automated production deployment pipeline to Firebase App Distribution, including build, static analysis, testing, and release-note generation.
    • Updated the staging deployment pipeline to generate release notes, accept tester group input with sensible fallback, improve checkout depth/caching, and streamline build & deployment steps.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 24, 2026

📝 Walkthrough

Walkthrough

Adds 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

Cohort / File(s) Summary
New Production Workflow
.cicdtemplate/.github/workflows/deploy_production_to_firebase_app_distribution.yml
Adds a dedicated production deployment workflow: JDK 17 setup, timezone, full checkout, Gradle cache, Detekt static analysis (reports archived), Kover unit tests (coverage archived), release-notes generation, build APK, and deploy to Firebase App Distribution using service credentials and tester group.
Staging Workflow (modified)
.cicdtemplate/.github/workflows/deploy_staging_to_firebase_app_distribution.yml
Refactors staging workflow: renamed trigger, adds workflow_dispatch with testerGroups input, uses full fetch (fetch-depth: 0), adds release-notes generation, removes production deployment steps, and uses dynamic tester group input or fallback variable for Firebase deployment.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 I nibbled through commits at dawn,
Built an APK on dewy lawn,
Detekt and Kover kept me bright,
I hopped releases into flight,
Testers cheered — deployment delight! 🚀

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding release notes generation to Firebase distribution workflows for both staging and production builds.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/463-generate-and-add-release-notes-when-distributing-new-builds-on-firebase

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai bot temporarily deployed to template-compose February 24, 2026 09:08 Inactive
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (1)
.cicdtemplate/.github/workflows/deploy_production_to_firebase_app_distribution.yml (1)

20-24: actions/setup-java@v3 is two major versions behind (current: v5).

The official documentation examples for actions/setup-java now reference @v5. v4 updated the Node.js runtime to version 20 instead of 16, and v5 has further improvements. Using @v3 runs 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

📥 Commits

Reviewing files that changed from the base of the PR and between d3fe052 and 6d6ab08.

📒 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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 24, 2026

15 Warnings
⚠️ Please add labels to this PR
⚠️ Uh oh! Your project is under 80% coverage!
⚠️ template-compose/gradle/libs.versions.toml#L10 - A newer version of androidx.compose:compose-bom than 2025.02.00 is available: 2026.02.00
⚠️ template-compose/gradle/libs.versions.toml#L12 - A newer version of androidx.navigation:navigation-compose than 2.5.3 is available: 2.9.7
⚠️ template-compose/gradle/libs.versions.toml#L13 - A newer version of androidx.core:core-ktx than 1.15.0 is available: 1.17.0
⚠️ template-compose/gradle/libs.versions.toml#L14 - A newer version of androidx.datastore:datastore-preferences than 1.1.3 is available: 1.2.0
⚠️ template-compose/gradle/libs.versions.toml#L17 - A newer version of com.android.application than 8.8.2 is available: 9.0.1
⚠️ template-compose/gradle/libs.versions.toml#L17 - A newer version of com.android.library than 8.8.2 is available: 9.0.1
⚠️ template-compose/gradle/libs.versions.toml#L19 - A newer version of androidx.hilt:hilt-navigation-compose than 1.2.0 is available: 1.3.0
⚠️ template-compose/gradle/libs.versions.toml#L25 - A newer version of org.jetbrains.kotlinx:kotlinx-coroutines-core than 1.7.3 is available: 1.10.2
⚠️ template-compose/gradle/libs.versions.toml#L25 - A newer version of org.jetbrains.kotlinx:kotlinx-coroutines-test than 1.7.3 is available: 1.10.2
⚠️ template-compose/gradle/libs.versions.toml#L28 - A newer version of androidx.lifecycle:lifecycle-runtime-compose than 2.8.7 is available: 2.10.0
⚠️ template-compose/gradle/libs.versions.toml#L28 - A newer version of androidx.lifecycle:lifecycle-runtime-ktx than 2.8.7 is available: 2.10.0
⚠️ template-compose/gradle/libs.versions.toml#L35 - A newer version of androidx.security:security-crypto than 1.0.0 is available: 1.1.0
⚠️ template-compose/gradle/libs.versions.toml#L36 - A newer version of androidx.test:core-ktx than 1.6.1 is available: 1.7.0

Kover report for template-compose:

🧛 Template - Compose Unit Tests Code Coverage: 73.20%

Coverage of Modified Files:

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

@hoangnguyen92dn hoangnguyen92dn force-pushed the chore/463-generate-and-add-release-notes-when-distributing-new-builds-on-firebase branch from 6d6ab08 to 057bd23 Compare February 24, 2026 09:26
@coderabbitai coderabbitai bot temporarily deployed to template-compose February 24, 2026 09:28 Inactive
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
.cicdtemplate/.github/workflows/deploy_staging_to_firebase_app_distribution.yml (1)

70-75: ⚠️ Potential issue | 🟠 Major

Release 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

📥 Commits

Reviewing files that changed from the base of the PR and between 6d6ab08 and 057bd23.

📒 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

@hoangnguyen92dn hoangnguyen92dn merged commit 9be7229 into develop Feb 27, 2026
5 of 6 checks passed
@hoangnguyen92dn hoangnguyen92dn deleted the chore/463-generate-and-add-release-notes-when-distributing-new-builds-on-firebase branch February 27, 2026 09:17
This was referenced Feb 27, 2026
@hoangnguyen92dn hoangnguyen92dn self-assigned this Feb 27, 2026
@hoangnguyen92dn hoangnguyen92dn added this to the 3.33.0 milestone Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants