Skip to content

Commit b6844f0

Browse files
Merge branch 'stage' into ADFA-5446-Extension-Manager-uninstall-broken
2 parents 6588402 + aec2f14 commit b6844f0

763 files changed

Lines changed: 114937 additions & 6058 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/analyze.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ jobs:
105105
# the unit-test compile path.
106106
FIREBASE_CONSOLE_URL: ${{ secrets.FIREBASE_CONSOLE_URL }}
107107
GLITCHTIP_DSN: ${{ secrets.GLITCHTIP_DSN }}
108+
# The aapt2/d8/Compose regression tests (ADFA-4128 bugs 5/6/8) are
109+
# assumption-guarded, so on a runner without an Android SDK they would skip
110+
# green and take that coverage with them. This turns an absent toolchain
111+
# into a hard failure instead. The runner does have an SDK - Assemble V8
112+
# Debug above could not run otherwise.
113+
REQUIRE_BUILD_TOOLCHAIN: "1"
108114
run: flox activate -d flox/base -- ./gradlew :testing:tooling:assemble :testing:common:assemble sonarqube --info --no-build-cache -x lint --continue
109115

110116
- name: Upload JaCoCo report

‎.github/workflows/debug.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,15 +466,15 @@ jobs:
466466
467467
echo "Found Jira ticket: $JIRA_TICKET"
468468
469-
# Validate NEXT_RELEASE_VERSION exists and exactly two digits, dot, two digits
469+
# Validate NEXT_RELEASE_VERSION format
470470
if [ -z "$NEXT_RELEASE_VERSION" ]; then
471471
echo "ERROR: NEXT_RELEASE_VERSION variable is not set"
472472
exit 1
473473
fi
474474
475-
if [[ ! "$NEXT_RELEASE_VERSION" =~ ^[0-9]{2}\.[0-9]{2}$ ]]; then
475+
if [[ ! "$NEXT_RELEASE_VERSION" =~ ^[0-9]{2}\.[0-9]{2}(\.[0-9]+)?$ ]]; then
476476
echo "ERROR: NEXT_RELEASE_VERSION format is invalid: $NEXT_RELEASE_VERSION"
477-
echo "Expected format: YY.ww (two digits, dot, two digits, e.g., 25.50)"
477+
echo "Expected format: YY.ww[.patch] (e.g., 25.50 or 25.50.1)"
478478
exit 1
479479
fi
480480

‎.github/workflows/release.yml‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ on:
99
schedule:
1010
- cron: '0 12 * * *' # Daily at 12:00 PM UTC
1111
workflow_dispatch:
12+
inputs:
13+
hotfix_version:
14+
description: 'Version stamp for an off-cycle release (e.g. 26.38.1). Still merges stage into main and builds main.'
15+
required: false
16+
type: string
1217

1318
env:
1419
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -485,15 +490,15 @@ jobs:
485490
486491
- name: Validate release version
487492
env:
488-
NEXT_RELEASE_VERSION: ${{ vars.NEXT_RELEASE_VERSION }}
493+
NEXT_RELEASE_VERSION: ${{ github.event.inputs.hotfix_version || vars.NEXT_RELEASE_VERSION }}
489494
run: |
490495
if [ -z "$NEXT_RELEASE_VERSION" ]; then
491496
echo "ERROR: NEXT_RELEASE_VERSION variable is not set"
492497
exit 1
493498
fi
494-
if [[ ! "$NEXT_RELEASE_VERSION" =~ ^[0-9]{2}\.[0-9]{2}$ ]]; then
499+
if [[ ! "$NEXT_RELEASE_VERSION" =~ ^[0-9]{2}\.[0-9]{2}(\.[0-9]+)?$ ]]; then
495500
echo "ERROR: NEXT_RELEASE_VERSION format is invalid: $NEXT_RELEASE_VERSION"
496-
echo "Expected format: YY.ww (two digits, dot, two digits, e.g., 25.50)"
501+
echo "Expected format: YY.ww[.patch] (e.g., 25.50 or 25.50.1)"
497502
exit 1
498503
fi
499504
echo "Validated NEXT_RELEASE_VERSION: $NEXT_RELEASE_VERSION"
@@ -505,7 +510,7 @@ jobs:
505510
- name: Assemble Release APK
506511
env:
507512
INCLUDE_LLAMA_ASSETS: "true"
508-
NEXT_RELEASE_VERSION: ${{ vars.NEXT_RELEASE_VERSION }}
513+
NEXT_RELEASE_VERSION: ${{ github.event.inputs.hotfix_version || vars.NEXT_RELEASE_VERSION }}
509514
run: |
510515
variant_upper=$(echo "${{ matrix.variant }}" | tr '[:lower:]' '[:upper:]')
511516
flox activate -d flox/base -- ./gradlew :app:assemble${variant_upper}Release --no-daemon \
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Spotless apply
2+
3+
# For contributors without a shell (e.g. editing in the GitHub web UI): runs spotlessApply on a
4+
# branch and appends the result as a standalone commit. The push uses GITHUB_TOKEN, so it does not
5+
# start other workflows.
6+
7+
permissions:
8+
contents: write
9+
10+
on:
11+
workflow_dispatch:
12+
inputs:
13+
branch:
14+
description: 'Branch to format (not stage or main)'
15+
required: true
16+
type: string
17+
18+
concurrency:
19+
group: spotless-apply-${{ inputs.branch }}
20+
cancel-in-progress: false
21+
22+
jobs:
23+
spotless_apply:
24+
name: Run spotlessApply and commit
25+
runs-on: self-hosted
26+
timeout-minutes: 30
27+
env:
28+
BRANCH: ${{ inputs.branch }}
29+
30+
steps:
31+
- name: Refuse protected branches
32+
run: |
33+
case "$BRANCH" in
34+
stage|main)
35+
echo "::error::Refusing to push to '$BRANCH'."
36+
exit 1
37+
;;
38+
esac
39+
40+
# fetch-depth 0: the Spotless ratchet compares against origin/stage.
41+
- name: Checkout branch
42+
uses: actions/checkout@v4
43+
with:
44+
ref: ${{ inputs.branch }}
45+
fetch-depth: 0
46+
47+
- name: Check if Nix is installed
48+
run: |
49+
if command -v nix >/dev/null 2>&1; then
50+
echo "nix_installed=true" >> $GITHUB_ENV
51+
else
52+
echo "nix_installed=false" >> $GITHUB_ENV
53+
fi
54+
55+
- name: Install Flox
56+
if: env.nix_installed == 'false'
57+
uses: flox/install-flox-action@v2
58+
59+
- name: Run spotlessApply
60+
run: |
61+
flox activate -d flox/base -- ./gradlew spotlessApply --no-daemon
62+
63+
- name: Commit and push
64+
run: |
65+
if git diff --quiet; then
66+
echo "::notice::Already formatted. Nothing to commit."
67+
exit 0
68+
fi
69+
git config user.name "ADFA"
70+
git config user.email "dev-team@appdevforall.org"
71+
git commit -am "style: spotless reformat, no functional change"
72+
git push origin "HEAD:refs/heads/$BRANCH"
73+
echo "::notice::Pushed $(git rev-parse --short HEAD) to $BRANCH."

‎.github/workflows/weekly-release.yml‎

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: Weekly release (manual)
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
hotfix_version:
7+
description: 'Version for an off-cycle release (e.g. 26.38.1). Publishes the current build under this version instead of the CalVer week.'
8+
required: false
9+
type: string
510

611
permissions:
712
contents: read
@@ -27,12 +32,26 @@ jobs:
2732

2833
- name: Compute CalVer version
2934
id: compute
35+
env:
36+
HOTFIX_VERSION: ${{ github.event.inputs.hotfix_version }}
3037
run: |
31-
VERSION=$(date -u +%g.%V)
38+
if [[ -n "$HOTFIX_VERSION" ]]; then
39+
if [[ ! "$HOTFIX_VERSION" =~ ^[0-9]{2}\.[0-9]{2}(\.[0-9]+)?$ ]]; then
40+
echo "::error::Invalid hotfix version format: $HOTFIX_VERSION"
41+
exit 1
42+
fi
43+
VERSION="$HOTFIX_VERSION"
44+
else
45+
VERSION=$(date -u +%g.%V)
46+
fi
3247
NEXT_VERSION=$(date -u -d "+7 days" +%g.%V)
3348
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
3449
echo "next_version=$NEXT_VERSION" >> "$GITHUB_OUTPUT"
35-
echo "Releasing $VERSION (next will be $NEXT_VERSION)"
50+
if [[ -n "$HOTFIX_VERSION" ]]; then
51+
echo "Releasing hotfix $VERSION (NEXT_RELEASE_VERSION left unchanged)"
52+
else
53+
echo "Releasing $VERSION (next will be $NEXT_VERSION)"
54+
fi
3655
3756
- name: Look up previous CalVer tag
3857
id: previous
@@ -41,7 +60,7 @@ jobs:
4160
shell: flox activate -d flox/base -- bash -eo pipefail {0}
4261
run: |
4362
PREVIOUS_TAG=$(gh release list --json tagName \
44-
--jq '[.[] | select(.tagName | test("^[0-9]+\\.[0-9]+$"))] | .[0].tagName // ""')
63+
--jq '[.[] | select(.tagName | test("^[0-9]+\\.[0-9]+(\\.[0-9]+)?$"))] | .[0].tagName // ""')
4564
echo "previous_tag=$PREVIOUS_TAG" >> "$GITHUB_OUTPUT"
4665
echo "Previous CalVer tag: ${PREVIOUS_TAG:-none}"
4766
@@ -198,20 +217,20 @@ jobs:
198217
exit 0
199218
fi
200219
220+
# A hotfix cut against a superseded release must not steal the "Latest"
221+
# badge from the newer release that is already published.
222+
IS_LATEST=true
223+
if [[ -n "$PREVIOUS_TAG" ]] \
224+
&& [[ "$(printf '%s\n%s\n' "$VERSION" "$PREVIOUS_TAG" | sort -V | tail -n1)" != "$VERSION" ]]; then
225+
IS_LATEST=false
226+
fi
227+
echo "Marking $VERSION as latest: $IS_LATEST (previous tag: ${PREVIOUS_TAG:-none})"
228+
229+
ARGS=(--target "$GITHUB_SHA" --latest="$IS_LATEST" --title "$VERSION" --generate-notes)
201230
if [[ -n "$PREVIOUS_TAG" && "$PREVIOUS_TAG" != "$VERSION" ]]; then
202-
gh release create "$VERSION" \
203-
--target "$GITHUB_SHA" \
204-
--latest \
205-
--title "$VERSION" \
206-
--generate-notes \
207-
--notes-start-tag "$PREVIOUS_TAG"
208-
else
209-
gh release create "$VERSION" \
210-
--target "$GITHUB_SHA" \
211-
--latest \
212-
--title "$VERSION" \
213-
--generate-notes
231+
ARGS+=(--notes-start-tag "$PREVIOUS_TAG")
214232
fi
233+
gh release create "$VERSION" "${ARGS[@]}"
215234
216235
upload-r2:
217236
needs: [prepare, pull-apk]
@@ -294,6 +313,7 @@ jobs:
294313
private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
295314

296315
- name: Set NEXT_RELEASE_VERSION repo variable
316+
if: ${{ github.event.inputs.hotfix_version == '' }}
297317
env:
298318
GH_TOKEN: ${{ steps.app-token.outputs.token }}
299319
NEXT_VERSION: ${{ needs.prepare.outputs.next_version }}

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ sentry.properties
109109
/composite-builds/build-deps/build/
110110

111111
/app/google-services.json
112+
/app/keystore-debug.jks
113+
112114

113115
# Written by the gradle-plugin tests, not by a Gradle task: writeInitScript() in
114116
# gradle-plugin/src/test/.../utils.kt resolves FileProvider.testHomeDir() and creates

0 commit comments

Comments
 (0)