Skip to content

fix: improve update#46

Merged
janderssonse merged 5 commits intomainfrom
fix/improve-update
Apr 22, 2026
Merged

fix: improve update#46
janderssonse merged 5 commits intomainfrom
fix/improve-update

Conversation

@janderssonse
Copy link
Copy Markdown
Contributor

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).

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>
Signed-off-by: Josef Andersson <josef.andersson@digg.se>
@janderssonse janderssonse merged commit 82b62fc into main Apr 22, 2026
19 checks passed
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