Skip to content

fix(shared): drop cloudflared releases below the minimum version - #40835

Open
ahm0xc wants to merge 1 commit into
pingdotgg:mainfrom
ahm0xc:fix/cloudflared-prune-below-min
Open

ahm0xc wants to merge 1 commit into
pingdotgg:mainfrom
ahm0xc:fix/cloudflared-prune-below-min

Conversation

@ahm0xc

@ahm0xc ahm0xc commented Nov 22, 2026

Copy link
Copy Markdown

Problem

pruneManagedVersions keeps the newest older managed cloudflared release unconditionally (olderManagedVersions.slice(1)). When that release is below CLOUDFLARED_MIN_VERSION, resolve() rejects it, so it can never run: it is disk kept for a rollback that cannot happen. With tools/cloudflared/2026.10.0 beside the pinned 2026.10.4 and a minimum of 2026.10.3, 2026.10.0 is retained forever.

This is the cloudflared path from #40805 that #40817 intentionally left unchanged.

Change

  • Retain the newest older release only when it still meets CLOUDFLARED_MIN_VERSION; remove every older release that cannot run.
  • A compatible previous release is still retained for rollback, so the one-previous-copy behavior is unchanged whenever that previous release is usable.
  • Added a regression test with a pinned 2026.10.4 and an outdated 2026.10.0; it fails on main (the outdated directory survives) and passes with the change. Updated the existing rollback test to keep a compatible 2026.10.3 and prune a below-minimum 2026.10.2.

Scope

Bug fix in packages/shared only. Related to #40805, whose runtime and staging paths are fixed by #40817. chrome-headless-shell still keeps one previous copy, as #40817 states; this PR does not touch it. No UI changes.

Verification

  • vp test run packages/shared/src/relayClient.test.ts — 21 passed.
  • Confirmed the new regression test fails on main with the outdated release still present, and passes with the fix.
  • vp run check:changed — format, lint, knip, typecheck (37 packages), and tests all pass.

Made with DeepSeek V4.1 Flash in T3 Code.

…sion

pruneManagedVersions kept the newest older release unconditionally. When that release is below CLOUDFLARED_MIN_VERSION, resolve() can never use it, so it sat on disk forever. Keep the newest older release only when it is still compatible and remove the rest.
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 22, 2026
@ahm0xc
ahm0xc marked this pull request as ready for review November 22, 2026 12:17
@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

pruneManagedVersions now retains the newest older managed release that meets CLOUDFLARED_MIN_VERSION and removes other older releases. Tests cover pruning, version selection, and fallback to PATH.

Changes: Managed release pruning

Layer / File(s) Summary
Pruning rule and tests
packages/shared/src/relayClient.ts, packages/shared/src/relayClient.test.ts
The pruning logic selects the newest older release at or above CLOUDFLARED_MIN_VERSION for retention. Tests check compatible release selection, removal of a below-minimum release, and fallback behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

Possibly related PRs

  • pingdotgg/t3code#17275: Defines the earlier rule to retain the newest older release; this PR changes the same pruneManagedVersions behavior.
  • pingdotgg/t3code#26040: Sets CLOUDFLARED_MIN_VERSION, which this PR uses to determine which older releases to retain.

Suggested reviewers: project516

Merge Risk: Minimal · up to 3ab02

Pruning now removes outdated cloudflared releases that could not be used for rollback anyway, and keeps the newest compatible one. The change is small and covered by tests, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(shared): drop cloudflared releases below the minimum version" matches the main change. pruneManagedVersions now removes older managed cloudflared releases that fall below CLOUDFLARED_MI…
Description check Passed The description follows the repository template. It has Problem, Change, Scope, and Verification sections. The Problem section explains the retained below-minimum release and gives a concrete example …
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.
Full details: Title check

Explanation

The title "fix(shared): drop cloudflared releases below the minimum version" matches the main change. pruneManagedVersions now removes older managed cloudflared releases that fall below CLOUDFLARED_MIN_VERSION, and it keeps the newest older release only when that release meets the minimum. The title is specific and follows conventional commit form.

Full details: Description check

Explanation

The description follows the repository template. It has Problem, Change, Scope, and Verification sections. The Problem section explains the retained below-minimum release and gives a concrete example (2026.10.0 with pinned 2026.10.4 and minimum 2026.10.3). The Change section explains the new retention rule and the regression test. The Scope section links related issue #40805 and states the bug-fix scope. The Verification section lists the focused test command, 21 passing tests, the regression test failing on main and passing with the fix, and the broader check run. The description also names the model and harness, as the template asks. The only gap is the Scope section does not link a direct issue for this bug. It references #40805 and states the PR is a related fix, so the gap is minor.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 91d2d90 and 3ab020c.

Files selected for processing: 2

  • packages/shared/src/relayClient.test.ts
  • packages/shared/src/relayClient.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant