Skip to content

fix/ADFA-3960 run bundlellamaassets for release builds only otherwise skip#1299

Merged
jomen-adfa merged 4 commits into
stagefrom
fix/ADFA-3960-build-speedup
May 18, 2026
Merged

fix/ADFA-3960 run bundlellamaassets for release builds only otherwise skip#1299
jomen-adfa merged 4 commits into
stagefrom
fix/ADFA-3960-build-speedup

Conversation

@jomen-adfa
Copy link
Copy Markdown
Contributor

Run bundlellamaassets for release builds only otherwise skip. Debug builds and generate assets zips will skip.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Workflows set INCLUDE_LLAMA_ASSETS for release and debug builds. The Gradle build script computes skipLlamaAssets from that env var with inverted/default semantics. V7/V8 debug assemble tasks add assetsDownloadDebug only when not CI and when llama assets are not skipped.

Changes

Llama Asset Bundling Workflow

Layer / File(s) Summary
Llama asset skip flag logic
app/build.gradle.kts
skipLlamaAssets is redefined to read INCLUDE_LLAMA_ASSETS via System.getenv() with inverted/default semantics. Lifecycle logging updated.
Debug build task dependency conditioning
app/build.gradle.kts
V8 and V7 debug assemble task configurations conditionally add assetsDownloadDebug only when not in CI (!isCiCd) AND when llama assets are not skipped (!skipLlamaAssets).
Release workflow env var setup
.github/workflows/release.yml
The "Assemble Release APK" step sets INCLUDE_LLAMA_ASSETS: "true" at step level, exposing it to the Gradle build.
Debug workflow env var change
.github/workflows/debug.yml
The build_apk job env now sets INCLUDE_LLAMA_ASSETS: "false" where previously SKIP_LLAMA_ASSETS: "true" was used.

Sequence Diagram

sequenceDiagram
  participant ReleaseWorkflow
  participant DebugWorkflow
  participant GradleBuild
  participant BuildScript
  ReleaseWorkflow->>GradleBuild: step env INCLUDE_LLAMA_ASSETS="true"
  DebugWorkflow->>GradleBuild: job env INCLUDE_LLAMA_ASSETS="false"
  GradleBuild->>BuildScript: expose env INCLUDE_LLAMA_ASSETS
  BuildScript->>BuildScript: compute skipLlamaAssets = !INCLUDE_LLAMA_ASSETS.equals("true")
  BuildScript->>GradleBuild: add assetsDownloadDebug if !isCiCd && !skipLlamaAssets
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • hal-eisen-adfa
  • Daniel-ADFA

Poem

🐰 I nibble flags in workflows bright,

INCLUDE whispers, false or true,
Debugs tuck snacks when told goodnight,
Releases lay the feast in view,
A hop, a build, the assets due.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: controlling when bundlellamaassets runs (release builds only, skipped for debug and assets-zip).
Description check ✅ Passed The description directly relates to the changeset, clearly stating that bundlellamaassets should run only for release builds while debug builds and generate-assets-zip skip it.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ADFA-3960-build-speedup

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.

Copy link
Copy Markdown
Contributor

@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: 1

🧹 Nitpick comments (2)
app/build.gradle.kts (2)

776-780: 💤 Low value

Simplify the skipLlamaAssets expression.

The chained ?.equals(...)?.not() ?: true is correct but harder to read than a direct comparison. A more idiomatic form:

♻️ Suggested refactor
-val skipLlamaAssets: Boolean =
-    System.getenv("SKIP_LLAMA_ASSETS")
-        ?.equals("false", ignoreCase = true)
-        ?.not()
-        ?: true
+val skipLlamaAssets: Boolean =
+    !System.getenv("SKIP_LLAMA_ASSETS").equals("false", ignoreCase = true)

String?.equals(other, ignoreCase = true) on a null receiver returns false, so when the env var is unset this yields !false = true (skip), matching the intended default. This also keeps the semantics in one line and avoids the Elvis fallback that depends on chained nullable returns.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/build.gradle.kts` around lines 776 - 780, The skipLlamaAssets expression
is overly verbose; replace the chained nullable calls with a single logical
negation of the env var equality check: compute skipLlamaAssets by checking if
System.getenv("SKIP_LLAMA_ASSETS") equals "false" (ignore case) and negating
that result so unset/null yields true; update the binding of skipLlamaAssets
accordingly (refer to the skipLlamaAssets variable and the SKIP_LLAMA_ASSETS env
var).

782-786: 💤 Low value

Lifecycle log can be misleading when env var is unset.

With the new default semantics, skipLlamaAssets is true even when SKIP_LLAMA_ASSETS is not set, but the log at line 783 says "SKIP_LLAMA_ASSETS enabled - ...", implying the env var is set. Consider phrasing the message around the resulting behavior rather than the env var, e.g.:

♻️ Suggested wording
-if (skipLlamaAssets) {
-	project.logger.lifecycle("SKIP_LLAMA_ASSETS enabled - debug assemble tasks will skip llama asset bundling.")
-} else {
-    project.logger.lifecycle("SKIP_LLAMA_ASSETS is disabled - assemble tasks will do llama asset bundling.")
-}
+if (skipLlamaAssets) {
+	project.logger.lifecycle("Llama asset bundling will be SKIPPED (set SKIP_LLAMA_ASSETS=false to enable).")
+} else {
+	project.logger.lifecycle("Llama asset bundling is ENABLED.")
+}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/build.gradle.kts` around lines 782 - 786, The lifecycle log messages
around the skipLlamaAssets conditional are misleading because they reference the
env var instead of the actual behavior; update the messages in the if/else that
checks skipLlamaAssets so they state the resulting behavior (e.g., "llama asset
bundling will be skipped" when skipLlamaAssets is true and "llama asset bundling
will run" when false) rather than asserting the env var is enabled/disabled;
modify the project.logger.lifecycle calls in that block (the conditional that
uses skipLlamaAssets) to use the new behavior-focused phrasing.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/build.gradle.kts`:
- Around line 870-872: The task dependency currently gates the general debug
asset downloader (assetsDownloadDebug) behind skipLlamaAssets; change it so
assetsDownloadDebug remains conditioned only on !isCiCd while the llama-only
dependencies (bundleLlamaV7Assets / bundleLlamaV8Assets) remain gated by
!skipLlamaAssets; update the two occurrences that use
dependsOn("assetsDownloadDebug") so they no longer check skipLlamaAssets and
ensure only the llama bundling lines keep the skipLlamaAssets guard.

---

Nitpick comments:
In `@app/build.gradle.kts`:
- Around line 776-780: The skipLlamaAssets expression is overly verbose; replace
the chained nullable calls with a single logical negation of the env var
equality check: compute skipLlamaAssets by checking if
System.getenv("SKIP_LLAMA_ASSETS") equals "false" (ignore case) and negating
that result so unset/null yields true; update the binding of skipLlamaAssets
accordingly (refer to the skipLlamaAssets variable and the SKIP_LLAMA_ASSETS env
var).
- Around line 782-786: The lifecycle log messages around the skipLlamaAssets
conditional are misleading because they reference the env var instead of the
actual behavior; update the messages in the if/else that checks skipLlamaAssets
so they state the resulting behavior (e.g., "llama asset bundling will be
skipped" when skipLlamaAssets is true and "llama asset bundling will run" when
false) rather than asserting the env var is enabled/disabled; modify the
project.logger.lifecycle calls in that block (the conditional that uses
skipLlamaAssets) to use the new behavior-focused phrasing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4e49c9e5-4eb8-46ff-8208-4616db6e6388

📥 Commits

Reviewing files that changed from the base of the PR and between e144365 and 4381839.

📒 Files selected for processing (2)
  • .github/workflows/release.yml
  • app/build.gradle.kts

Comment thread app/build.gradle.kts
@jomen-adfa jomen-adfa requested review from a team, Daniel-ADFA and jatezzz May 13, 2026 02:28
Comment thread .github/workflows/release.yml Outdated
@jomen-adfa jomen-adfa requested a review from hal-eisen-adfa May 13, 2026 04:33
Copy link
Copy Markdown
Contributor

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/build.gradle.kts`:
- Around line 776-780: The skipLlamaAssets boolean is inverted due to a double
negation around the INCLUDE_LLAMA_ASSETS check; update the expression that
computes skipLlamaAssets (the val skipLlamaAssets using
System.getenv("INCLUDE_LLAMA_ASSETS")) to remove the unnecessary .not() so the
logic becomes a single negation of the equals result, yielding "true"→false
(don’t skip), "false"→true (skip), and unset→true (default skip).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2ea2109b-0a52-4134-bc29-6ff86b312494

📥 Commits

Reviewing files that changed from the base of the PR and between 4381839 and b7797d8.

📒 Files selected for processing (3)
  • .github/workflows/debug.yml
  • .github/workflows/release.yml
  • app/build.gradle.kts
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/debug.yml

Comment thread app/build.gradle.kts Outdated
@jomen-adfa jomen-adfa force-pushed the fix/ADFA-3960-build-speedup branch 2 times, most recently from 55f944d to 15a5794 Compare May 16, 2026 22:22
@jomen-adfa jomen-adfa force-pushed the fix/ADFA-3960-build-speedup branch from 15a5794 to 731f352 Compare May 18, 2026 20:16
@jomen-adfa jomen-adfa merged commit 7199e68 into stage May 18, 2026
2 checks passed
@jomen-adfa jomen-adfa deleted the fix/ADFA-3960-build-speedup branch May 18, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants