Skip to content

ci: keep the R8 mapping.txt per build and release (#181) - #183

Merged
compot-dev merged 2 commits into
v2from
ci/r8-mapping-181
Oct 15, 2026
Merged

compot-dev merged 2 commits into
v2from
ci/r8-mapping-181

Conversation

@compot-dev

@compot-dev compot-dev commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Release stack traces (from Crash.java / logcat) show only R8 names like a.a0, and the CI did not keep the mapping that turns them back into class and method names.

  • Every build uploads app/build/outputs/mapping/release/mapping.txt as the workflow artifact <name>-mapping (e.g. decoder-v2-mapping). A build without minify has no mapping: the build step prints a warning and the upload uses if-no-files-found: warn, so neither fails.
  • latest release: the mapping goes next to the APK as decoder-v2-mapping.txt (a missing file is skipped).
  • Versioned v2.xx release: created with the APK and mapping-<version>.txt. A release counts as complete only with the APK and, when the build has one, the mapping (Qodo): a rerun of the build of the tagged commit uploads whichever is missing; a build of another commit only warns. Existing releases are not changed, so v2.07 and older stay without a mapping (a later build of 2.07 only prints a warning).

Workflow only, no app change, so no version bump. APK size impact: 0. No -keepattributes SourceFile,LineNumberTable: that would add a few KB to the APK.

Checked on this branch: the build uploaded decoder-ci-r8-mapping-181-mapping (mapping.txt, 711,824 B, R8 8.13.17) next to the APK artifact.

Part of #181

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Preserve R8 mappings as build artifacts and release assets

⚙️ Configuration changes ✨ Enhancement 🕐 10-20 Minutes

Grey Divider

AI Description

• Preserve each available R8 mapping as a workflow artifact for stack-trace retracing.
• Attach mappings to latest releases and new versioned v2 releases alongside their APKs.
• Warn rather than fail when a build produces no mapping.
Diagram

graph TD
  Build["Release build"] --> Mapping["R8 mapping"] --> Staged["Staged mapping"] --> Artifact["Workflow artifact"]
  Staged --> Latest["Latest release"]
  Staged --> Versioned["Versioned v2 release"]
Loading
High-Level Assessment

Keep mapping preservation in the workflow: it uses R8’s existing output without changing the APK, and the optional upload handles builds without minification. A Gradle-side packaging change would add complexity without improving release attachment.

Files changed (1) +30 / -4

Other (1) +30 / -4
build.ymlArchive R8 mappings and attach them to matching releases +30/-4

Archive R8 mappings and attach them to matching releases

• Copies the release mapping beside the APK when available and uploads it as a per-build workflow artifact, warning when absent. Adds it to latest releases and includes a version-named copy when creating a v2 release or repairing one whose APK is missing; existing releases with an APK remain unchanged.

.github/workflows/build.yml

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. A failed upload leaves releases unmapped ✓ Resolved
Description
has_apk treats a versioned release as complete when its APK exists, even though the new ASSETS
list also includes a mapping file. If release creation uploads the APK but fails before uploading
the mapping, a rerun exits through the existing-release path without restoring the missing file.
Code

.github/workflows/build.yml[R158-160]

+          if [ -f decoder-v2-mapping.txt ]; then
+            cp decoder-v2-mapping.txt "$MAP"
+            ASSETS+=("$MAP")
Evidence
The changed lines add the mapping to the files intended for versioned release upload. The completion
test checks only the APK, and the existing-release branch skips uploading anything when that test
succeeds; this makes a partial upload unrecoverable by a rerun.

.github/workflows/build.yml[156-164]
.github/workflows/build.yml[165-185]
.github/workflows/build.yml[195-201]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A partial versioned-release upload can leave the APK present and its mapping absent; a rerun treats the release as complete.
## Fix Focus Areas
- .github/workflows/build.yml[156-170]
- .github/workflows/build.yml[177-185]
- .github/workflows/build.yml[195-201]
## Recommended Fix
Check whether each expected asset exists after release creation and on reruns. When the mapping is missing, upload it only after verifying that the release tag points to the commit that produced the current build; leave releases from other commits unchanged.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can hide the parts of a finding you never read, like the evidence or the agent prompt

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread .github/workflows/build.yml
…e tagged build adds whichever is missing (Qodo on #183)
@compot-dev
compot-dev merged commit ff946ef into v2 Oct 15, 2026
4 checks passed
@compot-dev
compot-dev deleted the ci/r8-mapping-181 branch October 15, 2026 12:00
compot-dev pushed a commit that referenced this pull request Oct 15, 2026
…e tagged build adds whichever is missing (Qodo on #183)
compot-dev added a commit that referenced this pull request Oct 15, 2026
ci: keep the R8 mapping.txt per build and release (#181)
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