Files
azy5030-overlay/Justfile
azy5030 7dc4ace3d5
CI / lint (push) Successful in 1m58s
CI / build (push) Successful in 6m11s
ci(bump): gate toolchain install behind a cheap version check; fix binpkg verify (#4)
## Why

The daily **Bump** job (`runs/107` and every other scheduled run) does ~5–26 min
of work on every run before it ever checks whether a bump is needed — and on the
common no-op day it isn't. Timeline of a no-op run:

`docker pull stage3` → `emerge-webrsync` → **`emerge … dev-lang/go dev-util/pkgdev` (29 pkgs)** → `bump-version.sh` finds `already at latest` and exits in **1 second**.

`go`/`pkgdev`/`xz`/`jq` are only needed when a bump actually happens. Recent
no-op scheduled runs took 5m, 26m, 9m, 5m, 10m — all to do nothing.

Separately, the log on every emerge was flooded with binpkg GPG failures
(`unknown key`, `pubring.kbx: No such file`, `Try running getuto`). The
`sed 's/^verify-signature = true/.../'` matched nothing in the stage3 binhost
config, so the intended "disable binpkg signature verification" never took
effect (it worked anyway only because the failures are non-fatal).

## What

- **`bump.yaml`**: add a cheap `Check whether a bump is needed` step that compares
  the newest upstream release (`releases.rss`) against the newest committed ebuild
  (Gitea contents API) using only base-image `wget`, and gate `Sync ::gentoo`,
  the toolchain install, and the bump step on its `needed` output. The gate only
  short-circuits when **confident** (both versions parsed and current ≥ upstream);
  on any doubt — failed fetch, unparseable version — it falls through to the full
  run, where `bump-version.sh` remains the source of truth and re-checks.
- **`bump.yaml` + `ci.yaml`**: replace the no-op `sed` with `sed -i '/^verify-signature/d'`
  + append `verify-signature = false`, so the knob is actually set regardless of
  the stage3 default contents.

## Notes / limits

- The job `container:` still pulls `gentoo/stage3` before the gate runs, so the
  ~3.5 min image pull on no-op days is unchanged; this saves the larger
  webrsync + 29-package emerge. A follow-up could split the gate into a separate
  container-less job to skip the pull too, but that depends on what the runner
  maps `runs-on: ubuntu-latest` to, so it's left out here.
- Validated: `yamllint -c .yamllint.yaml` clean on both files; version-comparison
  logic and the contents-API JSON parsing unit-tested locally (equal / upstream-newer /
  current-ahead / parse-failure cases).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Reviewed-on: #4
Co-authored-by: Ali Zein Yousuf <azy5030@gmail.com>
Co-committed-by: Ali Zein Yousuf <azy5030@gmail.com>
2026-06-19 21:03:06 -05:00

71 lines
2.6 KiB
Makefile

# azy5030 overlay management commands
# Install dev tooling (linters) used by the lint recipes and CI
setup-dev:
brew install just markdownlint-cli shellcheck actionlint uv
# Lint Markdown: all repo files, or only the .md files in a passed list
lint-md files="":
#!/usr/bin/env bash
set -euo pipefail
if [ -z "{{files}}" ]; then
markdownlint --ignore node_modules '**/*.md'
else
targets=$(printf '%s\n' {{files}} | grep -E '\.md$' || true)
if [ -n "$targets" ]; then markdownlint --ignore node_modules $targets; fi
fi
# Lint shell scripts: all repo files, or only the .sh files in a passed list
lint-sh files="":
#!/usr/bin/env bash
set -euo pipefail
if [ -z "{{files}}" ]; then
targets=$(find . -name '*.sh' -not -path './node_modules/*')
else
targets=$(printf '%s\n' {{files}} | grep -E '\.sh$' || true)
fi
if [ -n "$targets" ]; then shellcheck $targets; fi
# Lint YAML: all repo files, or only the .yaml/.yml in a passed list (via uv)
lint-yaml files="":
#!/usr/bin/env bash
set -euo pipefail
if [ -z "{{files}}" ]; then
targets=$(find . \( -name '*.yaml' -o -name '*.yml' \) -not -path './node_modules/*')
else
targets=$(printf '%s\n' {{files}} | grep -E '\.ya?ml$' || true)
fi
if [ -n "$targets" ]; then uvx yamllint $targets; fi
# Lint Gitea Actions workflows: all, or only the workflow files in a passed list
lint-actions files="":
#!/usr/bin/env bash
set -euo pipefail
if [ -z "{{files}}" ]; then
targets=$(find .gitea/workflows \( -name '*.yaml' -o -name '*.yml' \) 2>/dev/null || true)
else
targets=$(printf '%s\n' {{files}} | grep -E '^\.gitea/workflows/.*\.ya?ml$' || true)
fi
# actionlint also runs shellcheck on each `run:` block. No custom runner
# labels here (workflows use ubuntu-latest), so no -config-file is needed.
if [ -n "$targets" ]; then actionlint $targets; fi
# Autofix all Markdown files
fix-md:
markdownlint --fix --ignore node_modules '**/*.md'
# Apply shellcheck's auto-fixable suggestions to all shell scripts
fix-sh:
#!/usr/bin/env bash
set -euo pipefail
targets=$(find . -name '*.sh' -not -path './node_modules/*')
# shellcheck's diff carries ./ path segments that `git apply` rejects; strip them.
diff=$(shellcheck -f diff $targets 2>/dev/null | sed 's|/\./|/|g' || true)
if [ -n "$diff" ]; then printf '%s\n' "$diff" | git apply; fi
# Lint everything (all repo files, or only a passed list of files)
lint files="": (lint-md files) (lint-sh files) (lint-yaml files) (lint-actions files)
# Autofix everything
fix: fix-md fix-sh