-
Notifications
You must be signed in to change notification settings - Fork 1.4k
chore: changelog in beta release #6899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
WalkthroughThe PR implements automated changelog generation integrated into the mobile CI/CD pipeline. A new workflow generates changelogs from commits since the latest tag, which is then conditionally downloaded and processed during Android and iOS builds, with truncation logic applied before uploading to Play Store and TestFlight. Changes
Sequence Diagram(s)sequenceDiagram
participant GH as GitHub Actions
participant GC as generate-changelog
participant AB as android-build
participant IB as ios-build
participant AUA as upload-android
participant IUA as upload-ios
participant PS as Play Store
participant TF as TestFlight
GH->>GC: Trigger on develop
GC->>GC: Collect commits since latest tag
GC->>GC: Generate changelog.txt
GC->>GH: Upload release-changelog artifact
par Android Path
GH->>AB: Build (depends on generate-changelog)
AB->>AB: Create APK/AAB
GH->>AUA: Run upload action
AUA->>GH: Download release-changelog
AUA->>AUA: Prepare metadata (truncate to 497 bytes)
AUA->>PS: Upload with changelog via Fastlane
and iOS Path
GH->>IB: Build (depends on generate-changelog)
IB->>IB: Create IPA
GH->>IUA: Run upload action
IUA->>GH: Download release-changelog
IUA->>IUA: Truncate to 4000 chars
IUA->>TF: Upload with changelog via Fastlane
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
|
Android Build Available Rocket.Chat 4.69.0.108001 Internal App Sharing: https://play.google.com/apps/test/RQQ8k09hlnQ/ahAO29uNQhoTsxmapo5mj98NNCxxdSnrKUTquuEmOiE-fiFX3p3KdkvRRkxg1jfZRWQlLJJvPEewrRjZVX9uX-wG4h |
|
Android Build Available Rocket.Chat 4.69.0.108124 Internal App Sharing: https://play.google.com/apps/test/RQQ8k09hlnQ/ahAO29uNSV2gEI6TCh7ghPqnic_xI-vXidHbOjKj9Wr0znBv18AEK8pv0ql-nwpNH17zORH1TAsZC0KeNzyCSs7okb |
|
Android Build Available Rocket.Chat Experimental 4.69.0.108127 Internal App Sharing: https://play.google.com/apps/test/RQVpXLytHNc/ahAO29uNTLjf15VmIQmjjtsjvFhrbNCvEF8qSn5_WCpWXUKBuXLWVrX0nbcfqEBuN8Fya3Vy84CdsRCh08m-O5cX3B |
|
iOS Build Available Rocket.Chat Experimental 4.69.0.108125 |
|
Android Build Available Rocket.Chat 4.69.0.108124 |
|
Android Build Available Rocket.Chat Experimental 4.69.0.108127 |
|
iOS Build Available Rocket.Chat 4.69.0.108126 |
| name: Upload | ||
| runs-on: ubuntu-latest | ||
| needs: [upload-hold] | ||
| needs: [build-android, upload-hold] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change has been made, so I can access BUILD_VERSION from the build-android step
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @.github/actions/upload-android/action.yml:
- Around line 62-81: The changelog handling uses byte-based wc -c/head -c and
unquoted $BUILD_VERSION which can break UTF-8 and fail for names with spaces;
update the script to perform character-based truncation (e.g., use a UTF-8 aware
tool such as awk/printf or a short python/perl one-liner to take the first 500
characters and append "..." only when truncated) instead of wc -c/head -c, and
always quote variables and paths (use "$BUILD_VERSION", quote file expansions
like "android/fastlane/metadata/android/en-US/changelogs/$BUILD_VERSION.txt" and
"changelog.txt") so multi-byte characters remain valid and filenames with
special characters are safe.
In @.github/workflows/generate-changelog.yml:
- Around line 17-26: The workflow currently sets LATEST_RELEASE_TAG and always
runs git log "$LATEST_RELEASE_TAG"..HEAD which expands to an empty range when
there are no tags; modify the "Generate changelog" step to check if
LATEST_RELEASE_TAG is empty and use a different git-log invocation in that case
(e.g., git log --pretty=format:"- %s" --no-merges HEAD > changelog.txt),
otherwise keep the existing git log "$LATEST_RELEASE_TAG"..HEAD > changelog.txt;
ensure the guard uses the LATEST_RELEASE_TAG variable and still writes a
fallback "- Improvements and bug fixes" to changelog.txt if the resulting file
is empty.
🧹 Nitpick comments (3)
.github/actions/upload-ios/action.yml (1)
112-116: Consider adding a descriptive step name for clarity in workflow logs.The step works correctly but lacks a
namefield, which makes debugging workflow runs harder.Suggested improvement
- - uses: actions/download-artifact@v4 + - name: Download release changelog + uses: actions/download-artifact@v4 if: ${{ inputs.type == 'official' && inputs.trigger == 'develop' }} with: name: release-changelog path: .ios/fastlane/Fastfile (1)
57-57: Consider extracting the hardcoded group name.The "External Testers" group name is hardcoded. If this needs to change or vary by environment, consider extracting it to an environment variable or constant.
.github/actions/upload-android/action.yml (1)
56-61: Consider handling missing artifact gracefully.If the
release-changelogartifact is missing or thegenerate-changelogjob failed, this step will fail the entire workflow. Consider addingcontinue-on-error: trueif a fallback changelog is acceptable, since line 77 already handles the missingchangelog.txtcase.💡 Optional: Add continue-on-error for graceful fallback
- uses: actions/download-artifact@v4 if: ${{ inputs.trigger == 'develop' }} + continue-on-error: true with: name: release-changelog path: .
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (7)
.github/actions/upload-android/action.yml.github/actions/upload-ios/action.yml.github/workflows/build-develop.yml.github/workflows/build-official-android.yml.github/workflows/generate-changelog.ymlandroid/fastlane/Fastfileios/fastlane/Fastfile
🧰 Additional context used
🪛 RuboCop (1.82.1)
ios/fastlane/Fastfile
[warning] 39-39: Useless assignment to variable - api_key.
(Lint/UselessAssignment)
🔇 Additional comments (9)
android/fastlane/Fastfile (1)
81-85: LGTM! Upload options align with changelog strategy.The configuration correctly enables changelog upload (
skip_upload_changelogs: false) while skipping unnecessary metadata, images, and screenshots. This aligns with the PR's goal of including release notes in the beta channel..github/workflows/generate-changelog.yml (1)
28-33: Artifact configuration looks good.The 15-day retention is reasonable for CI artifacts, and the artifact name
release-changelogmatches what the downstream iOS and Android upload actions expect.ios/fastlane/Fastfile (3)
32-37: Changelog handling logic is correct.The path resolution and truncation to 4000 characters (App Store limit) with proper ellipsis handling looks good. The conditional assignment correctly returns
nilwhen the file doesn't exist.
39-44: Static analysis false positive -api_keyis used implicitly.The
app_store_connect_api_keyaction stores the key in Fastlane's lane context, making it automatically available to subsequent actions likepilot. This is standard Fastlane behavior.
46-60: Pilot options configuration is well-structured.The conditional logic correctly:
- Waits for build processing only when external distribution is needed (
!(options[:official] && changelog))- Enables external distribution with proper notification settings when a changelog exists for official builds
.github/workflows/build-official-android.yml (1)
75-88: LGTM! Dependency chain and BUILD_VERSION sourcing are correct.The changes properly:
- Add explicit dependency on
build-androidto ensure the build completes before upload- Source
BUILD_VERSIONdirectly frombuild-android.outputsrather than through the passthrough inupload-hold, which is cleaner and more maintainableThe conditional logic on line 76 correctly handles both manual approval (PR trigger) and automatic flow (develop trigger) scenarios.
.github/workflows/build-develop.yml (2)
22-60: LGTM! Build job dependencies updated correctly.All four build jobs (
android-build-experimental-store,android-build-official-store,ios-build-experimental-store,ios-build-official-store) now correctly depend on bothrun-eslint-and-testandgenerate-changelog, ensuring the changelog artifact is available before builds start.
17-20: LGTM! New changelog generation job is well-structured.The job correctly depends on
run-eslint-and-testand references the reusable workflow. The workflow does not requiresecrets: inherit—it uses only standard GitHub Actions (checkout, git commands, artifact upload) that work with default permissions..github/actions/upload-android/action.yml (1)
83-95: LGTM! Fastlane upload logic correctly handles all trigger/type combinations.The conditional structure covers all expected cases:
prtrigger → beta lanedevelop+experimental→ experimental_productiondevelop+official→ official_open_testing
| - name: Prepare Play Store changelog metadata | ||
| if: ${{ inputs.trigger == 'develop' }} | ||
| run: | | ||
| mkdir -p android/fastlane/metadata/android/en-US/changelogs | ||
| if [ -f changelog.txt ]; then | ||
| size=$(wc -c < changelog.txt) | ||
| if [ "$size" -gt 500 ]; then | ||
| head -c 497 changelog.txt > android/fastlane/metadata/android/en-US/changelogs/$BUILD_VERSION.txt | ||
| printf "..." >> android/fastlane/metadata/android/en-US/changelogs/$BUILD_VERSION.txt | ||
| else | ||
| cat changelog.txt > android/fastlane/metadata/android/en-US/changelogs/$BUILD_VERSION.txt | ||
| fi | ||
| else | ||
| printf "Internal improvements and bug fixes" > android/fastlane/metadata/android/en-US/changelogs/$BUILD_VERSION.txt | ||
| fi | ||
| shell: bash | ||
| env: | ||
| BUILD_VERSION: ${{ inputs.BUILD_VERSION }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UTF-8 truncation may produce invalid characters; variables should be quoted.
Two issues:
-
Byte vs character mismatch: Play Store limit is 500 characters, but
wc -ccounts bytes andhead -ctruncates at byte boundaries. For multi-byte UTF-8 characters (e.g., emojis, accented letters), this could:- Truncate mid-character, producing invalid UTF-8
- Under-count actual characters, leaving room unused
-
Unquoted variables:
$BUILD_VERSIONshould be quoted to handle unexpected characters safely.
🔧 Proposed fix with character-based truncation
- name: Prepare Play Store changelog metadata
if: ${{ inputs.trigger == 'develop' }}
run: |
mkdir -p android/fastlane/metadata/android/en-US/changelogs
if [ -f changelog.txt ]; then
- size=$(wc -c < changelog.txt)
+ # Count characters, not bytes (for UTF-8 safety)
+ char_count=$(wc -m < changelog.txt)
- if [ "$size" -gt 500 ]; then
- head -c 497 changelog.txt > android/fastlane/metadata/android/en-US/changelogs/$BUILD_VERSION.txt
- printf "..." >> android/fastlane/metadata/android/en-US/changelogs/$BUILD_VERSION.txt
+ if [ "$char_count" -gt 500 ]; then
+ # Truncate by characters to avoid breaking UTF-8
+ cut -c1-497 changelog.txt > "android/fastlane/metadata/android/en-US/changelogs/${BUILD_VERSION}.txt"
+ printf "..." >> "android/fastlane/metadata/android/en-US/changelogs/${BUILD_VERSION}.txt"
else
- cat changelog.txt > android/fastlane/metadata/android/en-US/changelogs/$BUILD_VERSION.txt
+ cat changelog.txt > "android/fastlane/metadata/android/en-US/changelogs/${BUILD_VERSION}.txt"
fi
else
- printf "Internal improvements and bug fixes" > android/fastlane/metadata/android/en-US/changelogs/$BUILD_VERSION.txt
+ printf "Internal improvements and bug fixes" > "android/fastlane/metadata/android/en-US/changelogs/${BUILD_VERSION}.txt"
fi
shell: bash
env:
BUILD_VERSION: ${{ inputs.BUILD_VERSION }}🤖 Prompt for AI Agents
In @.github/actions/upload-android/action.yml around lines 62 - 81, The
changelog handling uses byte-based wc -c/head -c and unquoted $BUILD_VERSION
which can break UTF-8 and fail for names with spaces; update the script to
perform character-based truncation (e.g., use a UTF-8 aware tool such as
awk/printf or a short python/perl one-liner to take the first 500 characters and
append "..." only when truncated) instead of wc -c/head -c, and always quote
variables and paths (use "$BUILD_VERSION", quote file expansions like
"android/fastlane/metadata/android/en-US/changelogs/$BUILD_VERSION.txt" and
"changelog.txt") so multi-byte characters remain valid and filenames with
special characters are safe.
| - name: Generate changelog | ||
| shell: bash | ||
| run: | | ||
| LATEST_RELEASE_TAG=$(git tag --sort=-creatordate | head -n 1) | ||
| git log "$LATEST_RELEASE_TAG"..HEAD --pretty=format:"- %s" --no-merges > changelog.txt | ||
| if [ ! -s changelog.txt ]; then | ||
| echo "- Improvements and bug fixes" > changelog.txt | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handle the case when no tags exist in the repository.
If the repository has no tags, LATEST_RELEASE_TAG will be empty, causing git log ""..HEAD to output the entire commit history, which could be unexpectedly large. Consider adding a guard:
Proposed fix
run: |
LATEST_RELEASE_TAG=$(git tag --sort=-creatordate | head -n 1)
+ if [ -z "$LATEST_RELEASE_TAG" ]; then
+ echo "- Improvements and bug fixes" > changelog.txt
+ exit 0
+ fi
+
git log "$LATEST_RELEASE_TAG"..HEAD --pretty=format:"- %s" --no-merges > changelog.txt
if [ ! -s changelog.txt ]; then
echo "- Improvements and bug fixes" > changelog.txt
fi🤖 Prompt for AI Agents
In @.github/workflows/generate-changelog.yml around lines 17 - 26, The workflow
currently sets LATEST_RELEASE_TAG and always runs git log
"$LATEST_RELEASE_TAG"..HEAD which expands to an empty range when there are no
tags; modify the "Generate changelog" step to check if LATEST_RELEASE_TAG is
empty and use a different git-log invocation in that case (e.g., git log
--pretty=format:"- %s" --no-merges HEAD > changelog.txt), otherwise keep the
existing git log "$LATEST_RELEASE_TAG"..HEAD > changelog.txt; ensure the guard
uses the LATEST_RELEASE_TAG variable and still writes a fallback "- Improvements
and bug fixes" to changelog.txt if the resulting file is empty.
Proposed changes
This PR introduce the change where, when a pull request is merged into the develop branch, the CI pipeline will:
Build PR Action: https://github.com/RocketChat/Rocket.Chat.ReactNative/actions/runs/20957468091
Build Develop Action: https://github.com/RocketChat/Rocket.Chat.ReactNative/actions/runs/20957466882
Issue(s)
https://rocketchat.atlassian.net/browse/CORE-1634
How to test or reproduce
Screenshots
Types of changes
Checklist
Further comments
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.