Adopt the standard STRTA scaffold (Makefile diverges from the org standard) #1

Open
opened 2026-07-25 13:16:13 +02:00 by clawbot · 1 comment
Collaborator

The Makefile diverges from our standard scripts-to-rule-them-all (STRTA) scaffold. Under STRTA, the Makefile is a set of thin shims that delegate to script/* POSIX-sh entrypoints, and CI runs script/cibuild. The living reference is the netwatch repo (Makefile + script/ + .gitea/workflows/check.yml); mirror it exactly.

Current state (nonconformance)

  • Makefile has targets default test build clean try and no .PHONY declaration.
  • Only test overlaps a standard target, and it is inline (go test ./... -v), not a shim.
  • Missing standard targets: bootstrap, setup, lint, fmt, fmt-check, check, docker, hooks (eight).
  • No script/ directory. No .gitea/workflows/check.yml.

Definition of done

  1. Makefile has a .PHONY declaration listing at least the nine standard targets: bootstrap, setup, test, lint, fmt, fmt-check, check, docker, hooks.
  2. Each of those nine standard targets is a thin shim whose recipe is exactly @script/NAME (test calls @script/test, hooks calls @script/install-precommit, etc.). Repo-specific extra targets (build, clean, try) are allowed but must not replace the standard shims.
  3. A script/ directory holds executable POSIX-sh entrypoints (#!/bin/sh, set -e) for bootstrap, setup, test, lint, fmt, fmt-check, check, docker, install-precommit, plus cibuild.
  4. script/check runs the repo's full local verification (fmt-check + lint + test); script/cibuild is the CI entrypoint (typically docker build .), and a Dockerfile build runs make check so the image build fails on any check failure.
  5. .gitea/workflows/check.yml is added and invokes script/cibuild.
  6. make check passes locally and docker build . succeeds (green) before the change lands.

The finishing commit's title must end with (closes #N) referencing this issue.

The `Makefile` diverges from our standard scripts-to-rule-them-all (STRTA) scaffold. Under STRTA, the `Makefile` is a set of thin shims that delegate to `script/*` POSIX-`sh` entrypoints, and CI runs `script/cibuild`. The living reference is the `netwatch` repo (`Makefile` + `script/` + `.gitea/workflows/check.yml`); mirror it exactly. ## Current state (nonconformance) - `Makefile` has targets `default test build clean try` and no `.PHONY` declaration. - Only `test` overlaps a standard target, and it is inline (`go test ./... -v`), not a shim. - Missing standard targets: `bootstrap`, `setup`, `lint`, `fmt`, `fmt-check`, `check`, `docker`, `hooks` (eight). - No `script/` directory. No `.gitea/workflows/check.yml`. ## Definition of done 1. `Makefile` has a `.PHONY` declaration listing at least the nine standard targets: `bootstrap`, `setup`, `test`, `lint`, `fmt`, `fmt-check`, `check`, `docker`, `hooks`. 2. Each of those nine standard targets is a thin shim whose recipe is exactly `@script/NAME` (`test` calls `@script/test`, `hooks` calls `@script/install-precommit`, etc.). Repo-specific extra targets (`build`, `clean`, `try`) are allowed but must not replace the standard shims. 3. A `script/` directory holds executable POSIX-`sh` entrypoints (`#!/bin/sh`, `set -e`) for `bootstrap`, `setup`, `test`, `lint`, `fmt`, `fmt-check`, `check`, `docker`, `install-precommit`, plus `cibuild`. 4. `script/check` runs the repo's full local verification (`fmt-check` + `lint` + `test`); `script/cibuild` is the CI entrypoint (typically `docker build .`), and a `Dockerfile` build runs `make check` so the image build fails on any check failure. 5. `.gitea/workflows/check.yml` is added and invokes `script/cibuild`. 6. `make check` passes locally and `docker build .` succeeds (green) before the change lands. The finishing commit's title must end with ` (closes #N)` referencing this issue.
Author
Collaborator

Scaffold status: the STRTA scaffold for attrsum is complete and correct on branch strta-conformance (Makefile as thin shims, full script/ set including cibuild, a Dockerfile that runs make check, .gitea/workflows/check.yml running script/cibuild, and the standard .golangci.yml copied from dnswatcher). Tests and fmt-check pass, and the branch is pushed so the work is preserved.

Blocker on this issue's definition of done (green make check + docker build): the standard .golangci.yml (default: all, as used by dnswatcher) surfaces 192 pre-existing lint findings in the existing attrsum.go / attrsum_test.go — none introduced by the scaffold. About three quarters are pure style (wsl 70, nlreturn 40, noinlineerr 32); the rest are substantive (errcheck 15, gosec 3, plus complexity, error-wrapping, and globals). So the new CI/Docker gate would be red from day one until the existing code is remediated.

This needs your call on scope, because it also bears on how strict our shared lint standard should be for older/small tools:

  • (1) Keep the standard .golangci.yml and pair the scaffold with a proper lint-remediation pass over the existing code (I dispatch a code-fix agent; it goes through independent review). Larger, but ends green under the org-standard config. Recommended.
  • (2) Land the scaffold now with a relaxed .golangci.yml tuned to the current code — green immediately, but diverges from the org-standard lint config (the exact kind of divergence this sweep exists to remove).
  • (3) Land the scaffold as-is with the standard config and treat the 192 findings as tracked follow-up, accepting a knowingly-red CI gate until remediated.

Recommendation: (1). If you agree, I will dispatch the remediation on the same branch and bring it green under the standard config before it lands. Which option do you want?

Scaffold status: the STRTA scaffold for attrsum is complete and correct on branch `strta-conformance` (Makefile as thin shims, full `script/` set including `cibuild`, a `Dockerfile` that runs `make check`, `.gitea/workflows/check.yml` running `script/cibuild`, and the standard `.golangci.yml` copied from dnswatcher). Tests and `fmt-check` pass, and the branch is pushed so the work is preserved. Blocker on this issue's definition of done (green `make check` + `docker build`): the standard `.golangci.yml` (`default: all`, as used by dnswatcher) surfaces 192 pre-existing lint findings in the existing `attrsum.go` / `attrsum_test.go` — none introduced by the scaffold. About three quarters are pure style (`wsl` 70, `nlreturn` 40, `noinlineerr` 32); the rest are substantive (`errcheck` 15, `gosec` 3, plus complexity, error-wrapping, and globals). So the new CI/Docker gate would be red from day one until the existing code is remediated. This needs your call on scope, because it also bears on how strict our shared lint standard should be for older/small tools: - (1) Keep the standard `.golangci.yml` and pair the scaffold with a proper lint-remediation pass over the existing code (I dispatch a code-fix agent; it goes through independent review). Larger, but ends green under the org-standard config. Recommended. - (2) Land the scaffold now with a relaxed `.golangci.yml` tuned to the current code — green immediately, but diverges from the org-standard lint config (the exact kind of divergence this sweep exists to remove). - (3) Land the scaffold as-is with the standard config and treat the 192 findings as tracked follow-up, accepting a knowingly-red CI gate until remediated. Recommendation: (1). If you agree, I will dispatch the remediation on the same branch and bring it green under the standard config before it lands. Which option do you want?
sneak was assigned by clawbot 2026-07-25 13:26:00 +02:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/attrsum#1