Skip to content

test(tooling): reuse mobile release ref lifecycle fixtures - #134367

Merged
steipete merged 1 commit into
mainfrom
codex/test-mobile-release-ref-lifecycle
Aug 31, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-mobile-release-ref-lifecycle

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Three mobile release-ref tests repeatedly create the same real Git history. Their fixture allocates a temporary directory before the caller obtains its cleanup callback, so a Git setup failure leaves that directory until the test process exits.

Why this approach?

Use one real lifecycle to record and resolve an iOS ref, reject an Android SHA mismatch, and resolve the original iOS SHA through the CLI after HEAD advances. Register temporary roots with the canonical cleanup tracker immediately on allocation. Remove two repeated repositories and one redundant record operation: 20 Git process starts.

User impact

Test-only change; production +0/-0, tests +81/-113. All 15 assertion sites remain. The five cases retain numeric validation, immutable refs, idempotence, real CLI output and paths containing spaces.

Evidence

Focused mobile and iOS/Android caller tests pass: 39 before, 37 after because three fixture cases become one. Full changed-file checks and Codex autoreview pass.

A temporary fault at the first Git setup call produces the same exit-97 failure on both versions. Before: its directory still exists after per-test cleanup. After: the cleanup hook already removed it. The runner later removes the baseline process directory, so this proves earlier cleanup, not a persistent leak. Both probes restored exact source bytes and verified child-process shutdown.

node scripts/run-vitest.mjs test/scripts/mobile-release-ref.test.ts test/scripts/android-release-fastlane-gates.test.ts test/scripts/ios-release-fastlane-gates.test.ts

@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 31, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 2:49 PM ET / 18:49 UTC.

ClawSweeper review

What this changes

This PR replaces repeated temporary Git-repository setup in mobile release-reference tests with one auto-cleaned fixture lifecycle while retaining the iOS, Android, CLI, and path-with-spaces checks.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open for maintainer handling: the test-only refactor is coherent and no introduced correctness or security defect was found, while member authorship and the protected maintainer label require a human landing decision.

Priority: P3
Reviewed head: 6d0cb0de9314f48922d299ca02dd7c2aa8b46a34
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative test refactor that reuses the established cleanup abstraction and retains the production-boundary assertions.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a maintainer-authored test-only refactor; contributor real-behavior proof is not required. The PR body supplies a focused test command and fault-probe claim, but no target code was executed because this review must keep the checkout byte-clean.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-authored test-only refactor; contributor real-behavior proof is not required. The PR body supplies a focused test command and fault-probe claim, but no target code was executed because this review must keep the checkout byte-clean.
Evidence reviewed 5 items Introduced cleanup ownership: The PR registers a suite cleanup tracker before fixture creation and allocates each fixture through it, so a setup failure after allocation remains owned by the after-each cleanup path.
Existing cleanup owner: The reused helper registers its tracker cleanup with the supplied hook and returns a maker that records directories immediately after allocation.
Production boundary remains exercised: The consolidated test still covers immutable-record behavior, SHA-conflict rejection after HEAD advances, and CLI resolution; the production script itself is unchanged.
Findings None None.
Security None None.

How this fits together

iOS and Android release lanes call a shared script to record immutable Git references for mobile builds. The changed test creates a local bare remote and checkout to verify that script, then delegates temporary-root cleanup to the shared test helper.

flowchart LR
  A[Mobile release lanes] --> B[Release reference script]
  B --> C[Git remote references]
  D[Lifecycle test fixture] --> B
  D --> E[Temporary-root cleanup]
Loading

Decision needed

Question Recommendation
Should this maintainer-owned test cleanup be landed after confirming the latest ClawSweeper Rank-up moves? Confirm and land: Read the latest ClawSweeper comment, confirm no unresolved rank-up move applies, and land this test-only cleanup.

Why: The patch is a protected maintainer item; the supplied review context does not expose the newest bot comment required by repository policy before landing.

Before merge

  • Resolve merge risk (P1) - The newest ClawSweeper comment's Rank-up moves were omitted from the supplied context and could not be fetched because GitHub network lookup failed; a maintainer should confirm them before landing.
Agent review details

Security

None.

PR surface

Tests -32. Total -32 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 81 113 -32
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 81 113 -32

Review metrics

Metric Value Why it matters
Production versus test delta production +0/-0; tests +81/-113 (net -32) The change reduces test fixture duplication without altering the release-reference runtime.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the single lifecycle fixture and shared cleanup owner while preserving the direct iOS idempotence, Android conflict, and CLI-resolution assertions.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the single lifecycle fixture and shared cleanup owner while preserving the direct iOS idempotence, Android conflict, and CLI-resolution assertions.

Do we have a high-confidence way to reproduce the issue?

Yes. On the base version, a Git setup failure after mkdtempSync occurs before the fixture value and its caller-owned finally cleanup exist; the new tracked allocation establishes the missing ownership boundary.

Is this the best way to solve the issue?

Yes. Reusing the existing tracker is the narrow maintainable repair because it records ownership at allocation rather than adding another local cleanup mechanism.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 40f11b0ac96c.

Labels

Label justifications:

  • P3: This is low-risk test-maintenance cleanup with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a maintainer-authored test-only refactor; contributor real-behavior proof is not required. The PR body supplies a focused test command and fault-probe claim, but no target code was executed because this review must keep the checkout byte-clean.

Evidence

What I checked:

  • Introduced cleanup ownership: The PR registers a suite cleanup tracker before fixture creation and allocates each fixture through it, so a setup failure after allocation remains owned by the after-each cleanup path. (test/scripts/mobile-release-ref.test.ts:15, 6d0cb0de9314)
  • Existing cleanup owner: The reused helper registers its tracker cleanup with the supplied hook and returns a maker that records directories immediately after allocation. (test/helpers/temp-dir.ts:85, 8572655924bf)
  • Production boundary remains exercised: The consolidated test still covers immutable-record behavior, SHA-conflict rejection after HEAD advances, and CLI resolution; the production script itself is unchanged. (scripts/mobile-release-ref.ts:278, 6d0cb0de9314)
  • Current-main comparison: Fetched current main retains the prior untracked mkdtemp fixture and per-test cleanup callback, so it does not already contain this cleanup refactor. (test/scripts/mobile-release-ref.test.ts:29, 40f11b0ac96c)
  • Caller context: Android release tooling invokes the unchanged mobile-release-reference script through its Fastlane wrapper; the test remains at the script's real CLI boundary. (apps/android/fastlane/Fastfile:367, 6d0cb0de9314)

Likely related people:

  • unknown: The blamed commit carries this line unchanged from a recorded parent; no introducing author is attributed. (role: carried-forward source line; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Confirm the newest ClawSweeper Rank-up moves before landing.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-31T18:23:28.045Z sha 6d0cb0d :: needs maintainer review before merge. :: none

@steipete

Copy link
Copy Markdown
Contributor Author

I read both current ClawSweeper comments, including the full 18:23 UTC review. The earlier comment is only acknowledgement; the current review has no concrete Rank-up moves or code findings. That resolves its P1 request to inspect the latest comment, and maintainer landing review is complete.

All 37 resulting mobile/iOS/Android gate tests pass (39 before consolidation), with all 15 original assertion sites retained. The injected first-Git-setup failure reproduced per-test fixture retention before and showed cleanup before wrapper teardown after; both probes restored exact source bytes and joined their processes. Full changed checks, Codex autoreview, exact-head CI and Workflow Sanity pass. Production +0/-0; tests +81/-113. Proceeding through native landing gates.

@steipete
steipete merged commit 33029a1 into main Aug 31, 2026
149 checks passed
@steipete
steipete deleted the codex/test-mobile-release-ref-lifecycle branch August 31, 2026 18:50
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant