A CLI installed with go install reports version dev: mismatch warning on every connect, and probe_version pins are refused

Aperta
#888 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go
Ambito
backend, cli

Direzione di ricerca

Start by reading internal/cli version handling and the release workflow or Makefile flags that set Version; then inspect the version checks in internal/probelink and how probe_version is enforced. The issue describes several possible fixes but does not choose one, so first establish the intended behavior for binaries installed with go install. Done means that behavior is covered for version warnings, compatibility checks, and pinned versions.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What happens

A CLI installed with go install github.com/alphawavesystems/flutter-probe/cmd/[email protected] reports its version as dev:

$ probe version
probe version dev

internal/cli.Version is "dev" unless the linker sets it. The release workflow and the Makefile do (-X .../internal/cli.Version=...); go install does not. The binary does carry the module version in its build information (go version -m shows mod github.com/alphawavesystems/flutter-probe v0.27.0), and nothing in internal/cli, internal/probelink or cmd reads it (debug.ReadBuildInfo is not used).

What the version string is used for

Measured by calling the functions with dev:

  • Agent version warning. probelink.VersionMismatchWarning("dev", "0.26.1") returns version mismatch: CLI vdev <-> agent v0.26.1 — this combination is untested ..., so a go install CLI prints that warning on every connect. The doc comment of the function says an unknown or unparsable version produces no warning, but the code only skips an empty string; dev is compared as text.
  • Major check. MajorVersionIncompatible("dev", "0.26.1") is false: dev does not parse, so it never blocks the connection (as its comment says).
  • probe_version in probe.yaml. A project that pins probe_version: 0.27.0 is not satisfied by dev (ParseProbeVersion("0.27.0") then Satisfied("dev") is false), so probe test stops with "the installed CLI is dev, but probe.yaml requires probe_version 0.27.0. No test was run." A go-installed CLI cannot run a project that pins the version, even when it is that release.

Not changed

No fix proposed here. Options for the owner of the CLI: read the module version from debug.ReadBuildInfo when Version is dev; treat dev as unknown in VersionMismatchWarning (matching its comment); or document that go install builds report dev. The installation page's Option C (go install) is the place where users meet it.

Lingua principale
Go
Stelle
6
Fork
3
Merge medio
6h 28m
PR unite (30g)
362

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di AlphaWaveSystems/flutter-probe

Tutte le issue di AlphaWaveSystems/flutter-probe

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.