Skip to content

fix(ci): reject bare version strings in Firebase release notes - #291

Merged
libravault-xyz merged 3 commits into
devfrom
fix/firebase-invite-notes-autolink
Aug 19, 2026
Merged

libravault-xyz merged 3 commits into
devfrom
fix/firebase-invite-notes-autolink

Conversation

@libravault-xyz

Copy link
Copy Markdown
Collaborator

What

Adds a validation step to android-firebase-distribution.yml that fails the workflow_dispatch run early (before build/signing) if release_notes contains a bare, dotted version-like string (e.g. v0.4.6.1-alpha).

Why

Firebase App Distribution's tester invite page auto-linkifies any dot-separated, domain-shaped token in the release notes text — without validating a real TLD or requiring a scheme — so a mention like v0.4.6.1-alpha renders as a dead link to http://0.4.6.1-alpha. This is exactly what happened on the build 12 invite (reported by user, confirmed via job logs on run 32177679056).

Firebase's own page heading ("Release notes for 0.4.6.1-alpha (12)") already shows the version + build number, so restating it in the notes body is both redundant and broken — the fix is to just not do that, enforced in CI so it can't silently recur on a future manual trigger.

What this does NOT fix

Firebase's own auto-generated heading is templated from the APK's versionName/versionCode by Firebase's closed-source tester page, not from any text we submit — it shows the same broken-link styling regardless of our release notes content. That's not fixable from this repo; it needs a Firebase Console feedback report (requires human Console access). Documented as a known, tracked limitation in #290 rather than silently left unaddressed.

Testing

Regex verified locally against the actual RELEASE_NOTES value from run 32177679056 (blocks) and several safe notes strings including the workflow's own default and numbers-with-no-dots / plain issue references (pass) — see PR description commit for cases exercised.

Closes #290

🤖 Generated with Claude Code

Firebase App Distribution's tester invite page auto-linkifies any
dot-separated, domain-shaped token in the release notes text, without
validating a real TLD or requiring a scheme. A note like
"v0.4.6.1-alpha" renders as a dead link to http://0.4.6.1-alpha.

Firebase's own page heading already shows the build's version + build
number, so restating it in the notes body is redundant as well as
broken. Add a validation step that fails the workflow_dispatch run
early -- before build/signing -- if release_notes contains a bare
version-like token.

Firebase's own auto-generated heading link is a separate, upstream-only
issue (closed-source tester page template, not fixable from this repo);
tracked but not resolved by this change.

Fixes #290

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions github-actions Bot added the risk:high Touches a sensitive path or exceeds diff-size threshold — always human merge label Aug 19, 2026
@libravault-pipeline-bot libravault-pipeline-bot Bot added the status:needs-qa PR open, awaiting qa-agent verification label Aug 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR was opened outside the automated pipeline (author isn't libravault-pipeline-bot[bot]), so dev-agent.yml's own end-of-run classification step never ran for it — it would otherwise have sat with no risk/status label and nothing downstream would pick it up (see issue #223's actual history). This deterministic backstop (pr-intake.yml) classified its risk and applied status:needs-qa to route it into the normal pipeline from here.

@github-actions

Copy link
Copy Markdown
Contributor

📱 iOS Build Status: PASSED

✅ iOS Simulator Build & Unit Tests - success
✅ Android Core Modules - success

iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those.

View run details

@claude

claude Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

QA verification — PR #291 vs issue #290

Issue type: bug report (no acceptance checklist) → checklist is "repro no longer reproduces" + "a regression test proves it."

Repro no longer reproduces — PASS

Extracted the validation regex from the new workflow step and ran it against the actual RELEASE_NOTES string from the incident run (32177679056):

Security fix (v0.4.6.1-alpha): creating an Encrypted Vault or setting a vault PIN could fail on some devices due to an Android Keystore compatibility bug introduced in 0.4.6-alpha.

→ BLOCK (matches). Also confirmed the workflow's own default release-notes value ("Beta build via GitHub Actions") and plain issue-reference text ("Fixes some bugs, see #290 and #285") both ALLOW. The new step runs immediately after checkout, before signing/build, matching the PR's "fail fast" claim. YAML parses cleanly (python3 -c "import yaml; yaml.safe_load(...)") and the env:-var pattern for RELEASE_NOTES matches the existing safe pattern already used later in the same file (no new injection surface).

Regression test proves it — FAIL

No test was added — gh pr view --json files shows only .github/workflows/android-firebase-distribution.yml changed. The PR's "Testing" section describes only ad hoc local grep verification, not a committed, re-runnable check.

This repo already has an established, in-tree pattern for exactly this situation — CI-shell validation logic with no JVM/gradle harness to hook into: .github/scripts/resolve_linked_issue.sh + .github/scripts/test_resolve_linked_issue.sh (a standalone script that sources the logic and asserts against canned inputs, explicitly documented as "no CI job wires this in yet"). AGENTS.md's testing section requires "at least one test that fails on the pre-fix code (regression guard)" for bug fixes, and is explicit that this bar applies to agents same as humans. The dev agent should have followed the same pattern here: extract the grep condition into a small .github/scripts/validate_release_notes.sh (sourceable function) and add .github/scripts/test_validate_release_notes.sh asserting on the incident string (blocks) and the safe defaults/issue-reference text (pass) — i.e., commit the exact checks I just did by hand, so they don't regress silently on a future edit to the regex.

Secondary observation (non-blocking, worth a follow-up)

The regex over-blocks on legitimate decimal numbers and IPs, e.g. "Reduced memory usage by 12.5 percent." and "Fixed connectivity issue with 192.168.1.1 proxies." both trip it. This fails safe (blocks the workflow_dispatch run with a clear ::error:: rather than shipping something broken), so it's not a correctness bug for the issue's own repro — but worth a follow-up if it causes false-positive friction in practice.

Test suite

./gradlew testDebugUnitTest --continue — BUILD SUCCESSFUL in 9m20s, 438 actionable tasks (338 executed, 100 from cache), no failures. Expected/unsurprising since this PR touches only workflow YAML, no JVM/Android source — run as a regression sanity check per QA checklist step 2.

AGENTS.md conventions

Verdict

The fix itself is functionally correct and well-targeted, but ships with no automated regression coverage despite a clear, directly-analogous precedent already in this repo for testing exactly this kind of CI validation logic. Sending back for a test to be added.

QA verdict: FAIL

@github-actions github-actions Bot removed the status:needs-qa PR open, awaiting qa-agent verification label Aug 19, 2026
@libravault-pipeline-bot libravault-pipeline-bot Bot added the status:in-progress Dev agent is actively implementing label Aug 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor
QA failed its first round — routing back to the dev agent for one automated retry.

…tion

QA flagged PR #291 for shipping the issue #290 fix with no committed,
re-runnable regression test -- only ad hoc local grep verification.
Extract the validation regex into a sourceable
validate_release_notes.sh (same script/no-CI-harness pattern already
used by resolve_linked_issue.sh) and add
test_validate_release_notes.sh asserting on the actual build-12
incident string plus the workflow's safe defaults.
@github-actions

Copy link
Copy Markdown
Contributor

Addressed QA feedback

QA's only gap: no committed regression test for the release-notes validation logic (functional correctness was already confirmed PASS).

Fixed by extracting the validation regex out of the workflow YAML into a sourceable script, following the exact resolve_linked_issue.sh / test_resolve_linked_issue.sh pattern QA pointed to:

  • .github/scripts/validate_release_notes.sh — the release_notes_contains_bare_version() function (sourceable, no gh/network calls) plus a thin CI-step wrapper that reads RELEASE_NOTES and prints the same ::error:: annotation as before.
  • .github/scripts/test_validate_release_notes.sh — standalone regression test (same "no CI job wires this in yet" convention as its sibling), asserting on the actual issue Firebase App Distribution tester invite: bare version string renders as a dead link #290 incident string (blocks) and the workflow's safe defaults / plain issue-reference text (pass).
  • android-firebase-distribution.yml's validation step now just calls validate_release_notes.sh instead of an inline grep — same behavior, verified byte-identical stdout/exit code for both the blocked and safe cases locally, and confirmed the YAML still parses.

Not in scope for this round (QA flagged as non-blocking, a follow-up worth filing separately): the regex over-blocking on legitimate decimals/IPs like "12.5 percent" or "192.168.1.1" — that's an existing, fail-safe behavior carried over unchanged from the original fix, not something QA asked to be fixed here.

🤖 Generated with Claude Code

@github-actions github-actions Bot removed the status:in-progress Dev agent is actively implementing label Aug 19, 2026
@libravault-pipeline-bot libravault-pipeline-bot Bot added the status:needs-qa PR open, awaiting qa-agent verification label Aug 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📱 iOS Build Status: PASSED

✅ iOS Simulator Build & Unit Tests - success
✅ Android Core Modules - success

iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those.

View run details

@claude

claude Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

QA verification — PR #291 vs issue #290

Issue type: bug report (no acceptance-criteria checklist). Checklist used: the repro steps in #290 no longer reproduce, backed by a regression test.

Repro check

  • Bug no longer reproduces. The exact RELEASE_NOTES string from the broken build-12 invite (Security fix (v0.4.6.1-alpha): creating an Encrypted Vault..., from run 32177679056, quoted verbatim in Firebase App Distribution tester invite: bare version string renders as a dead link #290) is now rejected by .github/scripts/validate_release_notes.sh with a non-zero exit and a ::error:: annotation, wired in as a workflow step that runs before signing/build in android-firebase-distribution.yml (fails fast, no wasted build/signing on a doomed invite).
  • Regression test committed and re-runnable, not just ad hoc verification (this was the exact gap flagged in the prior QA round on this same PR — see commit 3a3a788, which extracted the regex out of the workflow into a sourceable script + added test_validate_release_notes.sh, following the existing resolve_linked_issue.sh / test_resolve_linked_issue.sh pattern in the same directory).
  • Safe defaults still pass: the workflow's own default ("Beta build via GitHub Actions") and plain issue-reference text ("Fixes some bugs, see #290 and #285") are not blocked.
  • Scope is honestly bounded: Firebase's own auto-generated page heading (templated by Firebase itself, not from submitted text) is explicitly called out in both the issue and the PR description as not fixable from this repo — correctly not claimed as fixed.

What I ran

  • bash .github/scripts/test_validate_release_notes.sh → all 5 checks pass (All checks passed., exit 0).
  • Manually re-ran the script standalone against both the real incident string and the safe default via RELEASE_NOTES=... bash validate_release_notes.sh — matches expected exit codes (1 for the bad string, 0 for safe).
  • Proved the test can actually fail (AGENTS.md requirement): temporarily broke the regex's suffix group in validate_release_notes.sh, re-ran the test script, got 2 check(s) failed (including the real incident-string case), then restored the file (git status clean afterward, verified). This is a real regression guard, not a trivially-true assertion.
  • bash -n on both scripts: syntax OK. shellcheck 0.9.0 on both scripts: zero warnings.
  • ./gradlew testDebugUnitTest --continue: BUILD SUCCESSFUL in 6m 39s, 438 actionable tasks (338 executed, 100 from cache), no failures. (Diff is CI/shell-only and touches no Kotlin/Gradle code, so this is a no-regression check rather than a direct exercise of the change, but it's clean.)
  • Confirmed neither new script is wired into any workflow's CI harness yet — this matches the pre-existing, explicitly-cited resolve_linked_issue.sh/test_resolve_linked_issue.sh precedent in this same directory, so it's not a new deviation from repo convention, just a pattern this repo already accepts for standalone-run scripts.

AGENTS.md conventions

  • Tests committed alongside the fix (was the exact thing flagged and fixed in the previous QA round).
  • No hardcoded versions introduced by this diff.
  • Conventional commit messages (fix(ci): …, test(ci): …), branch name follows fix/… convention.

Minor, non-blocking observation

The regex (\bv?[0-9]+(\.[0-9]+){1,3}(-[A-Za-z0-9]+)?\b) will also block legitimate multi-segment decimal mentions unrelated to versions (e.g. "reduced battery drain by 12.5.3%" — contrived, but the shape matches). Given the workflow fails fast with a clear ::error:: telling the human exactly what to edit and re-run, this is an acceptable false-positive-favors-safety tradeoff, not a defect — flagging for awareness only, not requesting a change.

No gaps found against the issue's contract.

QA verdict: PASS

@github-actions github-actions Bot removed the status:needs-qa PR open, awaiting qa-agent verification label Aug 19, 2026
@libravault-pipeline-bot libravault-pipeline-bot Bot added the status:needs-review QA passed, awaiting principal-review-agent label Aug 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Principal review — PR #291

Verdict: human-merge (routing on the risk:high label alone — no CONFIRMED findings that would block the change on its own merits).

Risk classification

Re-ran .github/scripts/classify_pr_risk.py origin/dev HEAD against the current head commit (3a3a788, no commits landed after the label was last set). It reproduces risk:high, correctly triggered by .github/workflows/android-firebase-distribution.yml matching the .github/workflows/** sensitive-path glob. Label is accurate and current.

Verification performed

  • Read the full diff (all three files, 108/108 added lines accounted for): validate_release_notes.sh, test_validate_release_notes.sh, and the workflow hunk.
  • Ran test_validate_release_notes.sh for real — all 5 checks pass.
  • Proved the test isn't vacuous: temporarily replaced the regex with a non-matching pattern and reran — 2 of the 5 checks correctly went red (AGENTS.md's "prove a new test can fail" rule), then restored the file and confirmed git status is clean.
  • Confirmed both new scripts carry the executable bit (100755), matching the existing resolve_linked_issue.sh pattern the PR claims to follow.
  • Confirmed the workflow passes release_notes via env: rather than interpolating ${{ inputs.release_notes }} directly into the run: block — avoids the classic Actions script-injection footgun. No new networking call or dependency introduced.
  • Confirmed the workflow's own default ("Beta build via GitHub Actions") passes validation, so this doesn't self-brick the workflow's default path.
  • Checked issue Firebase App Distribution tester invite: bare version string renders as a dead link #290 and PR fix(ci): reject bare version strings in Firebase release notes #291 for status:blocked — neither carries it, pipeline is clear to proceed.

Finding (PLAUSIBLE, not blocking on its own)

The regex (\bv?[0-9]+(\.[0-9]+){1,3}(-[A-Za-z0-9]+)?\b) is broader than "a version string" — it also blocks plain decimal numbers, percentages, and IP addresses that have nothing to do with versioning. Verified by hand:

  • "Now requires Android 8.0 or higher" → blocks
  • "Improved battery usage by 12.5 percent" → blocks
  • "Fixed connection issue with 192.168.1.1 proxy" → blocks

The ::error:: message ("release_notes contains a bare version string") is misleading for these cases — a release engineer writing ordinary notes that happen to include an OS version requirement or a percentage will hit a confusing CI failure on a manual workflow_dispatch run. Given the PR's own description says Firebase's autolinker doesn't validate a TLD and will linkify any dot-separated token, this breadth may be intentional/defensible (better to over-block than ship another dead link) — I can't verify against live Firebase behavior, so I'm not treating it as CONFIRMED. Worth a human judgment call on whether the message should be reworded (e.g. "a dot-separated token that looks like it could be auto-linkified") or the regex narrowed, but it's not a defect that should block this PR — worst case is a re-run with edited notes text, no data loss, no broken build.

No CONFIRMED findings. Tests are real and were shown to be capable of failing. Recommending this route to a human purely on the risk:high / sensitive-path label per policy, not because anything here is broken.

@github-actions github-actions Bot added status:needs-human-merge Principal review done, requires human merge decision and removed status:needs-review QA passed, awaiting principal-review-agent labels Aug 19, 2026
Addresses the non-blocking PLAUSIBLE finding from principal review on
PR #291: the version-string regex is broader than "a version string" --
it also catches ordinary numbers that happen to be dot-separated (an OS
version, a percentage, an IP). The error message read as if it had
misidentified the input.

We can't inspect Firebase's actual autolink heuristic, so narrowing the
regex risks reintroducing the original bug (a real version mention that
slips past a too-narrow pattern). Erring broad is the safer tradeoff --
worst case is a re-run with reworded notes, not another dead link
shipped to testers.

Instead of narrowing, make the tradeoff explicit and tested:
- Reworded the ::error:: message to say what actually triggered it and
  to stop implying high confidence it's a version string.
- Added regression tests asserting the over-block cases (Android 8.0,
  a percentage, an IP) block by design, so a future reader sees this is
  a documented decision, not an unnoticed bug.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

📱 iOS Build Status: PASSED

✅ iOS Simulator Build & Unit Tests - success
✅ Android Core Modules - success

iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those.

View run details

@libravault-xyz
libravault-xyz merged commit 267e82b into dev Aug 19, 2026
7 checks passed
@libravault-xyz
libravault-xyz deleted the fix/firebase-invite-notes-autolink branch August 19, 2026 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high Touches a sensitive path or exceeds diff-size threshold — always human merge status:needs-human-merge Principal review done, requires human merge decision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Firebase App Distribution tester invite: bare version string renders as a dead link

2 participants