Skip to content

Add CI workflows for building and running the example app#6

Merged
kinyoklion merged 3 commits intomainfrom
devin/1772582080-add-ci-workflows
Mar 4, 2026
Merged

Add CI workflows for building and running the example app#6
kinyoklion merged 3 commits intomainfrom
devin/1772582080-add-ci-workflows

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Mar 3, 2026

Summary

Adds two GitHub Actions CI workflows to hello-android-java, mirroring the equivalent workflows recently merged into hello-android (Kotlin):

  • build.yml — Checks out the repo, sets up Java 11 (Temurin), and runs ./gradlew assembleDebug.
  • run.yml — Fetches the LaunchDarkly mobile key and flag key from AWS SSM via release-secrets, injects them into the Java source files with sed, builds the APK, launches it on an Android emulator (API 29, x86_64), and validates that the UI displays a successful flag evaluation via uiautomator dump.

All actions are pinned to specific SHAs with version comments and reference links.

Key differences from the Kotlin (hello-android) workflows:

  • Java 11 instead of Java 17 — this project uses Gradle 6.7 / AGP 4.1.3, which only support up to Java 15.
  • Targeted sed for flag key — only the first occurrence of my-boolean-flag is replaced (the constant declaration on line 21). The second occurrence on line 29 is an == guard that shows an AlertDialog; replacing it too would cause the guard to pass (Java string interning makes == true for identical literals), displaying a dialog that blocks the uiautomator validation.
  • 30-second sleep instead of 15 — the older SDK (4.2.2 vs 5.11.0) and emulator startup may need more time for initialization.
  • UI dump saved to file before grepping, so the full XML is visible in CI logs on failure.

Action versions used

Action Version SHA Reference
actions/checkout v4.2.2 11bd71901bbe5b1630ceea73d27597364c9af683 release
actions/setup-java v4.7.1 c5195efecf7bdfc987ee8bae7a71cb8b11521c00 release
launchdarkly/gh-actions/actions/release-secrets release-secrets-v1.2.0 bbbbbda684f500766264e7fe327668094ba83d1c release
jlumbroso/free-disk-space v1.3.1 54081f138730dfa15788a46383842cd2f914a1be release
reactivecircus/android-emulator-runner v2.34.0 324029e2f414c084d8b15ba075288885e74aef9c release

Review & Testing Checklist for Human

  • Targeted sed for flag key is fragile: The sed '0,/my-boolean-flag/{s/...}' only replaces the first occurrence to avoid triggering the == guard on line 29 of MainActivity.java. This works because the constant declaration (line 21) comes before the comparison (line 29). If the source file is reordered, the wrong occurrence could be replaced. Consider whether the app code should use .equals() instead of == for these checks (separate issue).
  • Grep pattern assumes flag value: The validation grep -oi 'Feature flag.*is true' assumes the flag evaluates to true. If the flag configuration in LaunchDarkly changes to return false, this will cause CI to fail even though the app is working correctly. Monitor the flag configuration or adjust the validation to accept both values.
  • Verify AWS_ROLE_ARN repository variable: The run workflow requires vars.AWS_ROLE_ARN to be set in the repo settings for OIDC-based AWS authentication. This worked in CI, but confirm it's properly documented in repo settings.
  • Test plan: Wait for the next PR to verify both workflows run end-to-end. On this PR, both build and run workflows passed CI, which is a good initial sign, but you should validate at least once after merge that ongoing CI remains stable.

Notes

  • Both workflows passed CI on this PR after fixing Java version compatibility (11 vs 17) and sed targeting issues.
  • SDK key retrieval follows the standard release-secrets pattern used across LaunchDarkly hello-app repos.
  • The project uses LaunchDarkly Android SDK 4.2.2 (older than the Kotlin version's 5.11.0). Future updates may require re-testing these workflows.

Link to Devin Session: https://app.devin.ai/sessions/0b2bb3fc4f5845238a581c78eefd5369
Requested by: rlamb@launchdarkly.com

Co-Authored-By: rlamb@launchdarkly.com <rlamb@launchdarkly.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration bot and others added 2 commits March 3, 2026 23:57
Co-Authored-By: rlamb@launchdarkly.com <rlamb@launchdarkly.com>
Co-Authored-By: rlamb@launchdarkly.com <rlamb@launchdarkly.com>
@kinyoklion kinyoklion marked this pull request as ready for review March 4, 2026 00:09
@kinyoklion kinyoklion requested a review from a team as a code owner March 4, 2026 00:09
@kinyoklion kinyoklion merged commit e693c9c into main Mar 4, 2026
4 checks passed
@kinyoklion kinyoklion deleted the devin/1772582080-add-ci-workflows branch March 4, 2026 18:30
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.

2 participants