Skip to content

fix: improve update handling#41

Open
janderssonse wants to merge 10 commits intomainfrom
fix/setup-silent-offline
Open

fix: improve update handling#41
janderssonse wants to merge 10 commits intomainfrom
fix/setup-silent-offline

Conversation

@janderssonse
Copy link
Copy Markdown
Contributor

@janderssonse janderssonse commented Apr 14, 2026

Pull Request Description

Users on flaky networks could be stuck on whatever devbase-check version they first installed — the old flow warned on every failed fetch and then skipped the update check, never updating. This fixes that, plus makes CI stop silently floating to the latest tag on every release.

Changes

  • setup.sh is silent on fetch failure and keeps the TTL marker untouched, so the next run retries instead of waiting the hour out.
  • non-tty shells (incl. $CI=true) no longer auto-update. CI is expected to pin the devbase-check version via Renovate. Set DEVBASE_CHECK_AUTO_UPDATE=1 to keep the old
    behaviour.
  • New just update-devtools for explicit on-demand updates. --ref <branch|tag|sha> pulls from an unreleased branch.
  • Consumer setup-devtools recipe shrinks from ~22 lines of inline bash to a 2-line bootstrap; all update logic lives in setup.sh.
  • Universal escape hatch for consumers on older justfiles: just -f ~/.local/share/devbase-check/justfile update.

Upgrading from an older version

See docs/MIGRATION-0.5.0.md for the three unstick paths. Short version for anyone silently stranded:

rm -rf "${XDG_DATA_HOME:-$HOME/.local/share}/devbase-check" && just setup-devtools

Depends on

Stacked on fix/mise-source-of-truth. That branch's 6 commits are also present here; merge it first and this reduces to 4 commits.

Checklist

  • Changes are limited to a single goal (avoid scope creep)
  • I confirm that I have read any Contribution and Development guidelines (CONTRIBUTING and DEVELOPMENT) and are following their suggestions.
  • I confirm that I wrote and/or have the right to submit the contents of my Pull Request, by agreeing to the Developer Certificate of Origin, (adding a 'sign-off' to my commits).

@janderssonse janderssonse force-pushed the fix/setup-silent-offline branch from e5aa3f6 to eb4c5d7 Compare April 14, 2026 23:45
Signed-off-by: Josef Andersson <josef.andersson@digg.se>
Move rumdl off the obsolete ubi backend.

Signed-off-by: Josef Andersson <josef.andersson@digg.se>
Introduce utils/mise-tool.sh shared helpers and a
fail_if_mise_install_incomplete guard sourced by every linter. Linters
now fail with "run: mise install" when any pinned tool is missing,
instead of falling through to a stray system copy on PATH.
check-tools.sh labels each resolved tool as (mise) or (system).

Escape hatch: DEVBASE_CHECK_ALLOW_SYSTEM_TOOLS=1.

Signed-off-by: Josef Andersson <josef.andersson@digg.se>
Single preflight fails fast with one message listing missing pins,
instead of cascading the same error through every linter. New
--ignore-missing-linters flag (and DEVBASE_CHECK_IGNORE_MISSING_LINTERS
env var) opt into running with a partial install. Unknown flags exit 2.

Signed-off-by: Josef Andersson <josef.andersson@digg.se>
Per-linter guard now accepts tool-identifier args and only fires when
one matches a missing pin — running ./linters/license.sh no longer
errors because aqua:mvdan/sh is missing, only if pipx:reuse is.

Each mise-pinned linter passes its tool. The node/* linters (no mise
pin) drop the guard entirely.

Signed-off-by: Josef Andersson <josef.andersson@digg.se>
Signed-off-by: Josef Andersson <josef.andersson@digg.se>
The update check now stays quiet on network failure and leaves the
hour-TTL marker untouched so the next run retries, instead of warning
and then silencing itself for an hour.

New env overrides:
- DEVBASE_CHECK_SKIP_UPDATES=1 disables the check entirely.
- DEVBASE_CHECK_AUTO_UPDATE=1 updates without prompting.

Signed-off-by: Josef Andersson <josef.andersson@digg.se>
Two consumer-facing changes that replace ~22 lines of inline bash per
consumer justfile with a clean delegation pattern:

1. setup-devtools shrinks to a two-line bootstrap — `git clone` on
   first run, then hand off to scripts/setup.sh for all update logic.
   No consumer-side fetch, no consumer-side warning, single source of
   truth. First run after bare clone is now self-healing: setup.sh
   notices HEAD isn't on a tag and silently completes the install.
   Prints a one-time tip so older installs can discover the simpler
   recipe.

2. update-devtools (new) force-updates on demand via scripts/update.sh,
   bypassing setup.sh's hour TTL. Supports --ref <branch-or-tag-or-sha>
   for trying unreleased branches. devbase-check's own justfile exposes
   an `update` recipe via justfile_directory() so stuck users can
   invoke it through `just -f <install-dir>/justfile update` regardless
   of whether their consumer justfile has been migrated.

Signed-off-by: Josef Andersson <josef.andersson@digg.se>
Covers the stuck-user unstick paths, the new update-devtools command,
the mise-install preflight, and recommended consumer justfile tweaks.

Signed-off-by: Josef Andersson <josef.andersson@digg.se>
… pins

Previously, setup.sh auto-applied the latest tag on any non-tty
invocation (or $CI=true), silently bumping devbase-check in every CI
pipeline on release day. That bypasses the consumer's own version
management flow: there's no PR, no audit trail, no rollback.

From 0.5.0 onward, auto-update fires only on explicit opt-in
(DEVBASE_CHECK_AUTO_UPDATE=1). Non-interactive shells leave the
installed version alone. Interactive shells still get the [y/N] prompt.
CI is expected to pin via Renovate (or equivalent) and bump
deliberately through PRs.

Signed-off-by: Josef Andersson <josef.andersson@digg.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant