Skip to content

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

Open
jomen-adfa wants to merge 4 commits into
stagefrom
fix/ADFA-3960-build-speedup
Open

fix/ADFA-3960 run bundlellamaassets for release builds only otherwise skip#1299
jomen-adfa wants to merge 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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1cfafccd-8f63-478b-96ea-598434df44b0

📥 Commits

Reviewing files that changed from the base of the PR and between 8eeaa44 and 55f944d.

📒 Files selected for processing (3)
  • .github/workflows/debug.yml
  • .github/workflows/release.yml
  • app/build.gradle.kts
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/debug.yml
  • app/build.gradle.kts

📝 Walkthrough
  • Run llama asset bundling only for release builds by introducing and using the INCLUDE_LLAMA_ASSETS environment variable.

    • .github/workflows/release.yml sets INCLUDE_LLAMA_ASSETS: "true" so release APK builds include llama assets.
    • .github/workflows/debug.yml sets INCLUDE_LLAMA_ASSETS: "false" so debug builds skip llama asset bundling.
    • generate_assets.yml invokes :app:assetsDownloadDebug but does not set INCLUDE_LLAMA_ASSETS, so it will default to skipping llama asset bundling.
    • app/build.gradle.kts now derives behavior from INCLUDE_LLAMA_ASSETS; debug assemble tasks gate bundle/dependency tasks (bundleLlamaV*Assets and assetsDownloadDebug) on the include flag and CI detection.
  • ⚠️ Risks & Best-Practice Notes

    • Confusing/inverted logic: the Gradle variable is named skipLlamaAssets but is computed from INCLUDE_LLAMA_ASSETS with negation (!System.getenv("INCLUDE_LLAMA_ASSETS")), making the control flow hard to read and error-prone. Recommend renaming to includeLlamaAssets and computing it directly (e.g., val includeLlamaAssets = System.getenv("INCLUDE_LLAMA_ASSETS")?.equals("true", ignoreCase = true) == true).
    • Semantic mismatch between env var name and internal variable increases risk of developer mistakes; align names and polarity.
    • Ensure CI docs, logs, and any automation that referenced SKIP_LLAMA_ASSETS are updated to use INCLUDE_LLAMA_ASSETS to avoid regressions.
    • Validate generate-assets and other automation that call assetsDownloadDebug explicitly if they should ever include assets (they currently will skip by default when INCLUDE_LLAMA_ASSETS is unset).

Walkthrough

Workflows now 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 only add the assetsDownloadDebug dependency when not running in 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 (inverted/default)
  BuildScript->>GradleBuild: conditionally add assetsDownloadDebug if !isCiCd && !skipLlamaAssets
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • hal-eisen-adfa
  • itsaky-adfa
  • Daniel-ADFA

Poem

🐰 I hop through CI and whisper true/false,

INCLUDE flags guide which treats to keep,
Debug tucks snacks when told to rest,
Release lays out the final feast,
A tiny hop — the build wakes light and neat.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: running bundlellamaassets only for release builds and skipping otherwise, which aligns with the changeset modifications.
Description check ✅ Passed The description directly relates to the changeset, explaining that bundlellamaassets runs only for release builds while debug builds and generate-assets-zip will 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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ADFA-3960-build-speedup

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 from 8eeaa44 to 55f944d Compare May 13, 2026 17:32
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