-
Notifications
You must be signed in to change notification settings - Fork 379
chore: Release 5.4.4 #1945
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
chore: Release 5.4.4 #1945
Changes from all commits
1404a9a
c2fc48f
050baa5
d916896
1d1c777
e3f787f
fc6f934
264249a
894f2ee
c4f024a
0c9e735
040f7d8
1c18077
2c11b8c
aeb4372
1a955c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -92,8 +92,8 @@ | |
|
|
||
| # Get versions from target branch (not the release branch) | ||
| CURRENT_VERSION=$(git show origin/${{ inputs.target_branch }}:package.json | jq -r .version) | ||
| ANDROID_VERSION=$(git show origin/${{ inputs.target_branch }}:android/build.gradle | grep "com.onesignal:OneSignal:" | sed -E "s/.*OneSignal:([0-9.]+).*/\1/") | ||
| IOS_VERSION=$(git show origin/${{ inputs.target_branch }}:react-native-onesignal.podspec | grep "OneSignalXCFramework" | sed -E "s/.*'([0-9.]+)'.*/\1/") | ||
| ANDROID_VERSION=$(git show origin/${{ inputs.target_branch }}:android/build.gradle | grep "com.onesignal:OneSignal:" | sed -E "s/.*OneSignal:([^\"']+).*/\1/") | ||
| IOS_VERSION=$(git show origin/${{ inputs.target_branch }}:react-native-onesignal.podspec | grep "OneSignalXCFramework" | sed -E "s/.*'([^']+)'.*/\1/") | ||
|
|
||
| echo "rn_from=$CURRENT_VERSION" >> $GITHUB_OUTPUT | ||
| echo "android_from=$ANDROID_VERSION" >> $GITHUB_OUTPUT | ||
|
|
@@ -105,20 +105,23 @@ | |
| VERSION="${{ inputs.android_version }}" | ||
|
|
||
| # Validate version exists on GitHub | ||
| RELEASE=$(curl -s -H "Authorization: token ${{ github.token }}" \ | ||
| "https://api.github.com/repos/OneSignal/OneSignal-Android-SDK/releases/tags/${VERSION}") | ||
| # -sf: silent + fail on HTTP >= 400 so RELEASE stays empty | ||
| # on 404, otherwise GitHub's JSON error body would defeat the | ||
| # `[ -z ]` guard below. | ||
| RELEASE=$(curl -sf -H "Authorization: token ${{ github.token }}" \ | ||
| "https://api.github.com/repos/OneSignal/OneSignal-Android-SDK/releases/tags/${VERSION}" || true) | ||
|
|
||
|
|
||
| if [ -z "$RELEASE" ]; then | ||
| echo "✗ Android SDK version ${VERSION} not found" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Update Android SDK version in build.gradle (handles both api '...' and api('...') syntax) | ||
| sed -i '' -E "s/(com\.onesignal:OneSignal:)[0-9.]+/\1$VERSION/" android/build.gradle | ||
| sed -i '' -E "s/(com\.onesignal:OneSignal:)[^\"']+/\1$VERSION/" android/build.gradle | ||
| echo "✓ Updated android/build.gradle with Android SDK ${VERSION}" | ||
|
|
||
| # Only commit if there are changes | ||
|
Check warning on line 124 in .github/workflows/create-release-pr.yml
|
||
| git add -A | ||
| git diff --staged --quiet && exit 0 | ||
| git commit -m "Update Android SDK to ${VERSION}" && git push | ||
|
|
@@ -129,8 +132,11 @@ | |
| VERSION="${{ inputs.ios_version }}" | ||
|
|
||
| # Validate version exists on GitHub | ||
| RELEASE=$(curl -s -H "Authorization: token ${{ github.token }}" \ | ||
| "https://api.github.com/repos/OneSignal/OneSignal-iOS-SDK/releases/tags/${VERSION}") | ||
| # -sf: silent + fail on HTTP >= 400 so RELEASE stays empty | ||
| # on 404, otherwise GitHub's JSON error body would defeat the | ||
| # `[ -z ]` guard below. | ||
| RELEASE=$(curl -sf -H "Authorization: token ${{ github.token }}" \ | ||
| "https://api.github.com/repos/OneSignal/OneSignal-iOS-SDK/releases/tags/${VERSION}" || true) | ||
|
|
||
| if [ -z "$RELEASE" ]; then | ||
| echo "✗ iOS SDK version ${VERSION} not found" | ||
|
|
@@ -152,11 +158,54 @@ | |
| # Update package.json version | ||
| npm pkg set version="$NEW_VERSION" | ||
|
|
||
| # Update the wrapper version literal reported to OneSignal's backend. | ||
| # Format is MMmmpp (zero-padded major/minor/patch); strip any pre-release suffix. | ||
| CORE_VERSION=${NEW_VERSION%%-*} | ||
| CORE_VERSION=${CORE_VERSION%%+*} | ||
| IFS='.' read -r MAJOR MINOR PATCH <<< "$CORE_VERSION" | ||
| PADDED_VERSION=$(printf "%02d%02d%02d" "$MAJOR" "$MINOR" "$PATCH") | ||
|
|
||
| ANDROID_FILE=android/src/main/java/com/onesignal/rnonesignalandroid/RNOneSignal.java | ||
| sed -i '' -E "s/(OneSignalWrapper\.setSdkVersion\(\")[0-9]+(\"\))/\1${PADDED_VERSION}\2/" "$ANDROID_FILE" | ||
| if ! grep -q "OneSignalWrapper.setSdkVersion(\"${PADDED_VERSION}\")" "$ANDROID_FILE"; then | ||
| echo "::error::Failed to update wrapper version in ${ANDROID_FILE} to ${PADDED_VERSION}" | ||
| exit 1 | ||
| fi | ||
| echo "✓ Updated RNOneSignal.java wrapper version to ${PADDED_VERSION}" | ||
|
|
||
| IOS_FILE=ios/RCTOneSignal/RCTOneSignal.mm | ||
| sed -i '' -E "s/(OneSignalWrapper\.sdkVersion = @\")[0-9]+(\";)/\1${PADDED_VERSION}\2/" "$IOS_FILE" | ||
| if ! grep -q "OneSignalWrapper.sdkVersion = @\"${PADDED_VERSION}\";" "$IOS_FILE"; then | ||
| echo "::error::Failed to update wrapper version in ${IOS_FILE} to ${PADDED_VERSION}" | ||
| exit 1 | ||
| fi | ||
| echo "✓ Updated RCTOneSignal.mm wrapper version to ${PADDED_VERSION}" | ||
|
|
||
|
fadi-george marked this conversation as resolved.
|
||
| # Only commit if there are changes | ||
| git add -A | ||
| git diff --staged --quiet && exit 0 | ||
| git commit -m "Release $NEW_VERSION" && git push | ||
|
|
||
| - name: Refresh demo Podfile.lock | ||
| run: | | ||
| # Runs after all version edits (package.json + podspec) so the | ||
| # repacked SDK tarball and OneSignalXCFramework pin both reflect | ||
| # the new release. pod install regenerates Podfile.lock entries | ||
| # for the path-based react-native-onesignal pod and any changed | ||
| # native pins in a single resolve. | ||
| ( | ||
| cd examples/demo | ||
| vp run setup | ||
| cd ios | ||
| pod install | ||
| ) | ||
| echo "✓ Refreshed examples/demo/ios/Podfile.lock" | ||
|
|
||
| # Only commit if there are changes | ||
| git add -A | ||
|
Check warning on line 205 in .github/workflows/create-release-pr.yml
|
||
|
Comment on lines
+196
to
+205
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Forward-looking nit: the new "Refresh demo Podfile.lock" step at create-release-pr.yml:189-207 runs Extended reasoning...What is wrongThe new "Refresh demo Podfile.lock" step at This is the same class of race the verifier flagged for Code path that triggers it
Why nothing prevents it
Why this is genuinely a nit (not a blocker) and not a duplicate
How to fixAdd a - name: Resolve OneSignal iOS SDK version
id: ios-sdk-version
run: |
VERSION=$(grep "OneSignalXCFramework" react-native-onesignal.podspec | sed -E "s/.*'([^']+)'.*/\1/")
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Wait for OneSignalXCFramework on CocoaPods trunk
uses: OneSignal/sdk-shared/.github/actions/wait-for-pod-trunk@main
with:
pod: OneSignalXCFramework
version: ${{ steps.ios-sdk-version.outputs.version }}If no for i in 1 2 3 4 5; do
if pod install; then break; fi
echo "pod install failed (attempt $i); waiting 30s for CDN propagation"
sleep 30
doneStep-by-step proofSuppose the iOS SDK team
Severitynit — narrow, forward-looking race window. CocoaPods trunk indexing is typically fast and 5.5.1 has long since propagated, so no immediate impact for this PR. But the new step is the symmetric iOS counterpart of the 🔬 also observed by previous_4 |
||
| git diff --staged --quiet && exit 0 | ||
| git commit -m "Update demo Podfile.lock" && git push | ||
|
|
||
| create-pr: | ||
| needs: [prep, update_version] | ||
| uses: OneSignal/sdk-shared/.github/workflows/create-release.yml@main | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,7 @@ | |
| ONESIGNAL_APP_ID=your-onesignal-app-id | ||
| ONESIGNAL_API_KEY=your-onesignal-api-key | ||
| E2E_MODE=false | ||
|
|
||
| # Optional: Android Notification Channel ID for the WITH SOUND test notification. | ||
| # Create one in your OneSignal dashboard under Settings > Android Notification Categories. | ||
| ONESIGNAL_ANDROID_CHANNEL_ID= | ||
|
Check notice on line 8 in examples/demo/.env.example
|
||
|
Comment on lines
+5
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟣 Pre-existing nit (lines 1–2 aren't in the diff, but this PR adds an adjacent line that pairs cleanly with the correct pattern, so it's a natural fold-in). Extended reasoning...What is wrongThree pieces of code disagree about whether
The result: a developer who follows the documented onboarding flow ( Addressing the refutationThe refuting verifier argues the file deliberately mixes two conventions: placeholder-must-replace for required values ( Why this PR is the natural place to fix itLines 1–2 are pre-existing — not in the diff. But this PR adds Impact
How to fixEither: -# Default App ID (used if ONESIGNAL_APP_ID is empty): 77e32082-ea27-42e3-a898-c72e141824ef
-ONESIGNAL_APP_ID=your-onesignal-app-id
+# Default App ID (used if ONESIGNAL_APP_ID is empty): 77e32082-ea27-42e3-a898-c72e141824ef
+ONESIGNAL_APP_ID=(matches line 8 Step-by-step proof
Severity
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
🟡 Forward-looking nit: this PR added
grep -qpost-substitution verification to the wrapper-version sed inUpdate sdk version(lines 170-173, 178-181), but the parallelUpdate Android SDK version(line 121, which this PR just touched to broaden[0-9.]+→[^"']+) andUpdate iOS SDK version(line 146) seds still rely on the unverifiedsed → echo "✓ Updated" → git diff --staged --quiet && exit 0pattern. BSDsed -iexits 0 on zero matches, so a future reformat ofandroid/build.gradle(e.g. catalog/multi-line) or the podspec (e.g.s.dependency('OneSignalXCFramework', "5.5.1")) would silently no-op while the log lies — and since neither step has a prior mutation, the staged diff guard firesexit 0cleanly, leaving the release with a bumpedpackage.jsonbut a stale native pin. Current files match losslessly so no immediate impact; mirroring the existing wrapper-versiongrep -qFpattern to both earlier seds (two lines per step) closes the same class of bug symmetrically.Extended reasoning...
What is asymmetric
This PR closed a silent-sed-miss gap in the wrapper-version block at
.github/workflows/create-release-pr.yml:168-181by adding post-substitutiongrep -qchecks:But the structurally-identical seds in the two earlier steps in the same job — both of which this PR actively touched (broadened the regexes from
[0-9.]+to[^"']+/[^']+) — got no analogous verification:Update Android SDK version):sed -i '' -E "s/(com\.onesignal:OneSignal:)[^\"']+/\1$VERSION/" android/build.gradlefollowed only by an unconditionalecho "✓ Updated …"andgit add -A; git diff --staged --quiet && exit 0.Update iOS SDK version):sed -i '' "s/s\.dependency 'OneSignalXCFramework', '[^']*'/.../" react-native-onesignal.podspecwith the same unverified pattern.Why the existing guard does not save these
BSD
sed -i ''(job runs onmacos-latest) exits 0 even when the pattern matches zero lines. Theecho "✓ Updated …"is unconditional so the log lies. And critically, unlike the wrapper-version step, neither of these earlier steps has a prior mutation likenpm pkg set version. So when the sed misses, the staged diff is genuinely empty andgit diff --staged --quiet && exit 0exits the step cleanly with success status — no commit, no error, no signal that anything went wrong.Failure mode (Android — most exposed)
android/build.gradle— e.g. moves the dep into alibs.versions.tomlcatalog and references it asapi libs.onesignal, or splits the literal across multiple lines.android_version: 5.9.0. The newcurl -sfvalidates that release exists. Good.sedruns against the reformattedbuild.gradle. Thecom.onesignal:OneSignal:[^"']+pattern matches zero lines. BSDsed -iexits 0.echo "✓ Updated android/build.gradle with Android SDK 5.9.0"— workflow log claims success.git add -A; git diff --staged --quiet && exit 0— staged diff empty, step exits 0.Update sdk versionbumpspackage.json+ wrapper literal.Refresh demo Podfile.lockregenerates the lock against the still-stale gradle line. Final commits pushed.rel/5.9.0ships withpackage.jsonat 5.9.0 butandroid/build.gradlestill pinning the prior Android SDK — exactly the failure mode the wrapper-version verification was added to prevent.The iOS branch is structurally more brittle: the regex requires exact
s.dependency+ space + single-quoted args + comma-space syntax. A future podspec refactor to parens (s.dependency('OneSignalXCFramework', '5.5.1')) or double-quoted version produces zero matches with the same silent-exit-0 outcome. The downstreamRefresh demo Podfile.lockstep does not catch it either —pod installresolves against the stale podspec and produces a self-consistent lock at the old version.Why nothing else catches it
curl -sfvalidates the GitHub release tag exists; it has no opinion on whether sed matched.pod installresolves whatever the podspec says, so a missed iOS sed produces a self-consistent (but stale) lock.rel/**may pass if the previously-pinned native SDK is still live on Maven Central / CocoaPods trunk.Step-by-step proof — Android branch
com.onesignal:OneSignal:5.8.0no longer appears on a single line inandroid/build.gradle.android_version: 5.9.0.sed -i '' -E "s/(com\.onesignal:OneSignal:)[^\"']+/\15.9.0/" android/build.gradle— pattern matches zero lines. BSD sed exits 0.echo "✓ Updated android/build.gradle with Android SDK 5.9.0"— log says success.git add -A— nothing new to stage.git diff --staged --quiet && exit 0— empty diff, exits 0.package.jsonand wrapper literal.How to fix
Mirror the wrapper-version pattern (~4 lines per step):
and analogously for the iOS podspec sed.
grep -qF(fixed-string) is sufficient since we are matching the exact value just substituted in.Severity
nit — current pins (Android 5.8.0, iOS 5.5.1) match the regexes losslessly so there is no immediate impact. Worth flagging because (a) this PR has been twice-revised to harden this very script (curl
-sf, wrapper-versiongrep -q), and (b) the parallel gap in the two earlier seds leaves the same class of silent-drift bug open. Mirroring the new pattern symmetrically while it is fresh costs 4 lines per step.