8000 fix(min,installer): check once a day whether the channel has a newer release (0.7 backport) by bryan-minimal · Pull Request #3504 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix(min,installer): check once a day whether the channel has a newer release (0.7 backport) - #3504

Merged
bryan-minimal merged 3 commits into
release/0.7.xfrom
backport/2650-update-check-to-0.7.x
Nov 18, 2026
Merged

bryan-minimal merged 3 commits into
release/0.7.xfrom
backport/2650-update-check-to-0.7.x

Conversation

@bryan-minimal
Copy link
Copy Markdown
Member

What

Backport of #2650 (78a60b2 on main) to the 0.7 line: once a day min asks update.minimal.dev whether its channel has moved past the release it was installed from, and says so once when it has.

  • The request comes from a detached child with a two second budget. It never delays or fails a command.
  • It carries the channel, the installed release, OS, architecture, install method and a random install id. No address is stored.
  • The first short command on a terminal prints the disclosure and makes no request that time. The installer writes install.toml and shows the same disclosure on its closing card.
  • Off switches: MINIMAL_TELEMETRY set to 0, false, no or off; DO_NOT_TRACK; CI; OTEL_SDK_DISABLED=true; [telemetry] enabled = false in the user's config or in /etc/minimal/config.toml. A config that cannot be read turns the check off.

Why on a patch release

Agreed with the release owner as a business requirement: it is how we see the effect of shipping 0.8. The title says fix because this line's version check refuses a feat subject on a patch release; the change is the feature from main.

Adapted for this line

The 0.7 line split from main before the telemetry work, so this is a hand port, not a cherry-pick:

  • MINIMAL_TELEMETRY is read by a small private function in update_check/switches.rs, in place of the telemetry module's flag type. No telemetry code comes along.
  • The [telemetry] config table goes into crates/sessions/src/client/config.rs, where this line keeps its client config.
  • /etc/minimal/config.toml is a private constant; on this line only its [telemetry] table is read.
  • crates/paths gains two fallible helpers as they are on main, beside the feature's own.
  • The list of commands that leave the notice visible drops auth and secret, which this line does not have.
  • docs/reference/telemetry.md is written for this line: the update check only. The link the notice and the installer's card print points at this page, which does not exist on stable's docs today.
  • Left out: the two telemetry-module files and the telemetry spec, which this line does not have. One test lost three assertions that exercised that module.

The installer and installer-test hunks are the same as on main, line for line.

For the merge back to main

Main's side wins for crates/paths/src/lib.rs, crates/sessions/src/client/config.rs and everything under crates/minimal/src/update_check/.

Release notes

  • min now makes one request a day to check for a newer release; see docs/reference/telemetry.md for what is sent and how to turn it off.
  • A [telemetry] table in config.toml makes 0.7.3 and older refuse the config. Use the environment switches if you move between versions.

Testing

  • Workspace lint, 3,996 tests and the native end-to-end script on this branch. One nightly-only job, miri on the switch crate, does not build on this line under today's nightly, with or without this change; it is not a PR check here and this change does not touch that crate.
  • The installer's own tests, with the new cases, under three shells: 867 passed, none failed, in each.
  • Two end-to-end scenarios against a build of this branch:
    • the notice, on Ubuntu 24.04: the disclosure on the first terminal run and no request; one request with the six fields on the second; the notice once on the third; nothing on a non-terminal or under CI; a dead endpoint costs 29 ms. (Not run on Fedora: the test VM there cannot make a terminal.)
    • the switches, on Ubuntu 24.04 and Fedora: a fresh state directory makes the request on the second command; OTEL_SDK_DISABLED=true and the organisation's [telemetry] enabled = false each make none, and the dry run names which one.

Before promotion: one --version install of the staged release on Linux and macOS, since the installer change reaches every new stable user.

🤖 Generated with Claude Code

bryan-minimal and others added 3 commits November 17, 2026 09:50
…release (0.7 backport)

Once a day min asks update.minimal.dev whether its channel has moved past
the release it was installed from, from a detached child with a 2 s budget
that never delays or fails a command, and when it has, prints one line on
stderr naming the new release, once per release. The request carries the
channel, the installed release, OS, architecture, install method and a
random install id; the first short command with a terminal discloses this
first, and the installer writes install.toml and shows the same disclosure
on its closing card. MINIMAL_TELEMETRY=0, DO_NOT_TRACK, CI,
OTEL_SDK_DISABLED=true or [telemetry] enabled = false turn it off.
docs/reference/telemetry.md describes all of it for this line.

Backport of 78a60b2 (#2650) from main.

That commit is a feat on main; the header says fix because this line's
version check refuses a feat subject on a patch release.

Adapted for this line:
- MINIMAL_TELEMETRY is read by a private is_falsy() in update_check/switches.rs
  (0, false, no, off, any case) in place of mlog::otel::Flag; no mlog dependency.
- The [telemetry] table (TelemetryConfig and its test) goes into
  crates/sessions/src/client/config.rs, and the check reads it via
  sessions::client::config.
- /etc/minimal/config.toml is a private constant in update_check/switches.rs;
  on this line only its [telemetry] table is read.
- crates/paths gains try_default_dir and try_minimal_state_dir as on main,
  beside the feature's try_minimal_config_dir_with_override.
- The notice's command list drops auth and secret, which this line lacks;
  cmd/mod.rs has no command_verb here, so only the dispatch arm is added.
- docs/reference/telemetry.md is written for this line (update check only,
  0.7 command names) and added to the reference manifest.
- Left out: the mlog otel.rs and otel/switches.rs hunks, and spec 25.
- the_child_is_muted_without_a_veto keeps only its switch assertion; the
  half that read the child's environment through mlog's exporter is removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- docs: move "How to update" first under the update check, where the notice's link lands
- docs: say /etc/minimal/config.toml is parsed whole; a table this line lacks turns the check off

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`min run` only prints a pointer to `min task run` on this line, so it is not
a command that takes the terminal. The lock file can outlive a check that
died, until a later check takes it over.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@bryan-minimal
bryan-minimal requested a review from a team as a code owner November 17, 2026 20:55
@coderabbitai
coderabbitai Bot commented Nov 17, 2026
Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: f17efc40-1879-4247-b069-d53ea8d2c2b1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@minimal-foundry
minimal-foundry Bot commented Nov 17, 2026 •
Copy link
Copy Markdown
Contributor

Approved: no findings at ac07bd48b082.

Nothing to do.

Clobber: none seen: all new files or additive hunks.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8000

minimal-review — approved

Verdict APPROVE — No findings.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Nov 17, 2026
@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Base is release/0.7.x, and the port matches 78a60b2 (#2650). I diffed update_check/ file by file against that commit. The only differences are the ones the description lists: is_falsy in place of Flag::parse (the same values, trimmed, any case), a local ORGANIZATION_CONFIG_PATH, the sessions::client::config path, auth and secret dropped from the notice list, and the mlog half of one test removed. The +/- lines of the installer, installer-test and spec 07 hunks are identical to main's. TelemetryConfig and its test match client-config on main. Main has no later changes to update_check/ that this would miss. Checks are green.

One low inline note on the installer card. It applies to main as well.

Comment thread scripts/install.sh
# moves on; a pinned (--version) one is counted but never told, since no
# channel pointer applies to it.
if [ "$version_set" -eq 1 ]; then
say " ${dim}min reports this install once a day (no release notices for --version), sending its channel$rst"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[low] For a --version install, this card says min reports the install once a day. Any --version target from before the update check has no check. On this line that is 0.7.3 and older, and pinning an older release is the usual reason to use --version. So for those installs, the card describes a request that is never made. It fails safe, because it over-discloses, but the card states something the code does not do. One fix: print the line only when the pinned version has the check. The simpler fix is to word it conditionally, such as "releases from 0.7.4 report this install once a day...". The same text is on main, so the fix belongs on both.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right: for a pinned release older than the check, the card describes a request that is never made. I will word it conditionally ("releases from 0.7.4 report this install once a day") in a follow-up PR on this line before 0.7.4 is staged, and the same change on main.

@bryan-minimal
bryan-minimal merged commit 1ea9570 into release/0.7.x Nov 18, 2026
36 checks passed
@bryan-minimal
bryan-minimal deleted the backport/2650-update-check-to-0.7.x branch November 18, 2026 02:09
yermakoffivan pushed a commit to yermako 8000 ffivan/minimal that referenced this pull request Nov 20, 2026
…ominimal#3541)

* fix(installer): the pinned install card says which releases report

For a --version install the card said min reports the install once a day.
A pinned release older than 0.7.4 has no update check and sends nothing, so
the card described a request that is never made. The line now reads
"min 0.7.4 and later report this install once a day".

Refs gominimal#3504

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* fix(installer): the pinned card says whether this release reports

The card knows the pinned version, so it no longer leaves the reader to work
out whether "0.7.4 and later" applies to them. A release from 0.7.4 on is told
that min reports the install once a day. A release before 0.7.4 is told that
it does not check for updates and sends nothing, and is not shown the off
switch for a request it never makes. A version the card cannot place (a
pre-release, a nightly, a name that is not X.Y.Z) keeps the range.

The installer test pins all three texts, the range one included, which no
test checked before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0