Skip to content

Latest commit

 

History

History
223 lines (155 loc) · 23.3 KB

maintenance.md

File metadata and controls

223 lines (155 loc) · 23.3 KB

Maintenance

The recurring work that keeps the repository healthy and the OpenSSF Scorecard honest. Release mechanics live in tooling.md; security defaults in security.md.

Pull request flow

Every change reaches main through a pull request, including the maintainer's:

  1. Branch from main (feat/…, fix/…, docs/…, release/vX.Y.Z), commit with Conventional Commits, run task ci.
  2. gh pr create --fill; the PR title is validated by pr-title.yml and becomes the squash commit.
  3. Wait for the required checks (below), then merge: squash a single-change PR; rebase-merge a batch of Conventional Commits (gh pr merge --rebase), since git-cliff builds the changelog from each commit and a squash would leave only the PR title. GitHub refuses a rebase merge of a PR with more than 100 commits: split such a batch into several PRs. Do not open a draft pull request on the same commit as another open pull request. GitHub groups check runs by commit and shows the newest run of each name, so cancelling the draft marks the other pull request's required checks as cancelled.

The protect-main ruleset enforces this. Its intended state is versioned in .config/ruleset-protect-main.json: a pull request with 0 required approvals (stale reviews dismissed on push, review threads resolved), the required status checks Lint (Go), API compatibility (apidiff), Lint (OpenAPI golden), Lint (Markdown) and Test (<os>, Go stable) on Linux, Windows and macOS (branch must be up to date with main), linear history, no force push, no deletion and no bypass actors. Apply or re-apply it with:

gh api -X PUT repos/AlexGalhardo/vukem/rulesets/25297704 --input .config/ruleset-protect-main.json

A job renamed in ci.yml must be renamed in that file in the same PR, or every PR waits for a check that never reports.

Releasing through a pull request

One release is one pull request. task release -- vX.Y.Z pushes the release commit straight to main, which the ruleset rejects. Prepare the changelog on a branch and create the tag only after that commit is the tip of main:

  1. Branch from an up-to-date main (release/vX.Y.Z, or any other branch). go run ./internal/tools/release -prepare vX.Y.Z writes CHANGELOG.md and the PLAN.md status and commits chore(release): vX.Y.Z. It does not tag and it does not push. -modules still refuses every branch other than main: module tags are cut after this pull request merges.
  2. Open one pull request. Do not open a draft pull request on the same commit as another open pull request (see the flow above). Rebase-merge (gh pr merge --rebase) so the chore(release) commit stays the tip. GitHub refuses a rebase merge of more than 100 commits: split the branch into several pull requests before -prepare.
  3. git switch main && git pull. go run ./internal/tools/release -tag vX.Y.Z creates the annotated tag only when the branch is main, HEAD's subject is chore(release): vX.Y.Z and the changelog section is current: every commit it links is an ancestor of HEAD and the section equals what git-cliff generates now from the commits between the previous release and HEAD. A rebase merge rewrites the commits of the pull request, so the ids -prepare linked on the branch are usually gone, and a commit added after -prepare is missing. The tool then names the stale ids and creates no tag: branch from the updated main, run -prepare vX.Y.Z again (it replaces the untagged section with one generated from the commits now on main, and refuses a version that is already tagged), merge that single-commit pull request and run -tag again. git push origin vX.Y.Z (one tag per push, Tag pushes).
  4. go run ./internal/tools/release -publish-only vX.Y.Z publishes the GitHub release notes, and refuses a section that links a commit the tag does not contain.
  5. Raise the nested modules' core requirement in a second PR (chore(deps): require vukem vX.Y.Z in nested modules), then run go run ./internal/tools/release -modules -push on the merged main (tooling.md).

Code review

Vukem has one maintainer. GitHub does not let authors approve their own pull requests and Scorecard ignores bot reviews, so the Code-Review check stays at 0 until a second person reviews changes. Creating a second account to approve is metric fraud and breaks GitHub's terms; it is never done. What compensates, and is checked on every PR: the TestSecurity_* contract in security.md, fuzzing, CodeQL, govulncheck, the coverage gate and the recorded reviews in security-review.md and api/review.md. The way up is a co-maintainer or invited reviewer for release and security PRs.

Known CI issues

  • Windows runtime crashes in the go test -race job (golang/go#81238, Go 1.27.3): on windows-latest (Windows Server 2025) hosts with Intel AMX, Windows writes an exception frame larger than the stack reserve Go keeps, below the goroutine stack, and the heap is corrupted. Seen as fatal error: unknown caller pc (a GC worker stack with a sigtrampgo frame), fatal error: found pointer to free object (reportZombies) or a nil dereference inside a stdlib function (log/slog), in CI runs 40972862220, 40813653835 and 40801161416. They never reproduce on Linux, macOS or AMD hosts (a 40-run local loop on a Ryzen stayed clean). The Test step prints the runner CPU first: re-run the failed job once when the CPU is an AMX Xeon (8573C, 6973P-C) and the failure has one of these signatures; any other failure, or the same crash on a non-AMX CPU, is a real bug. Remove this entry once a Go release ships the fix (CL 828724).
  • A Test (macos-latest, Go stable) job ends cancelled with no steps and no log, 15 minutes after it was queued (runs 43254460482, 43451035144): the check-run annotation reads The job was not acquired by Runner of type hosted even after multiple attempts, next to GitHub's macOS arm64 capacity notice. No runner ever started, so no code or test is involved; the workflow cannot fix it. Re-run the failed job (gh run rerun <id> --failed). A cancelled macOS job that did run steps is a different problem: read its log.

Release routine

After each PLAN.md task group:

  1. Refresh site/content/last-updated.json (npm run last-updated in site/, full history) and commit it before tagging, so every page shows its real "Last updated" date. The lefthook pre-push job doc dates does this on every push that touches site/content/: it commits the refresh and stops the push, and the next git push carries it. Dates are author dates, so a rebase merge keeps them valid.
  2. Release through a PR as above; required checks green before the merge.
  3. Post-release, 15 minutes:
    • gh run list --workflow release.yml is green;
    • cosign verify-blob on the published checksums.txt (SECURITY.md);
    • the image job of release.yml is green and cosign verify passes on the new ghcr.io/alexgalhardo/vukem digest (SECURITY.md); after the first image release, set the package visibility to public (GitHub → profile → Packages → vukem → Package settings), or anonymous docker pull fails;
    • read the score at https://api.scorecard.dev/projects/github.com/AlexGalhardo/vukem and record it in the pinned "Scorecard tracking" issue;
    • bump the reference apps once the Go proxy serves the version.

Dependency routine

Weekly, on Monday:

  1. Dependabot opens grouped PRs (go-deps, actions, site-deps, plus Docker for docs/media and .config); vuln.yml scans every module at 06:17 UTC. Merge the PRs once CI is green. Actions stay pinned by full commit SHA with a # vX.Y.Z comment. A digest PR for .config/compose.yaml must update the matching services: images (and RUSTFS_IMAGE) in ci.yml in the same PR.
  2. On every golang.org/x/crypto upgrade, re-run govulncheck (CI and the weekly vuln.yml do). v0.59.0 drops the unmaintained openpgp package, so GO-2026-5932 no longer matches this module. The separate module golang.org/x/crypto/openpgp stays unfixed and must not become a dependency.
  3. Every Monday starter-deps.yml runs go run ./internal/tools/starterdeps -write, the starter end-to-end tests, and opens or updates the chore/starter-deps pull request. task deps:starters lists what is behind without changing anything.
  4. Quarterly: count third-party modules per go.mod (go mod graph); every new direct dependency needs a decision under the dependency policy.

Everything vukem new scaffolds always follows its latest stable release, never a pre-release. That covers:

  • the JS packages of the starters, markdownlint, Biome, React Email, htmx, and the package manager versions in pm.go;
  • the make:proto tool versions, stripeVersion and studioVersion;
  • the Docker images of the generated Dockerfile and compose file and of the toolchain image (tag and index digest), plus Bun and its two SHA-256 checksums there;
  • the GitHub Actions pinned by SHA in the generated workflows (latest release, commit SHA resolved from its tag).

Some rules sit on top of that:

  • htmx follows the newest 4.x and never changes major (decision F2); updating it replaces the vendored htmx.min.js and htmxSHA256.
  • Vue and Svelte starters keep TypeScript 6.x until vue-tsc and svelte-check list 7 in their peerDependencies. An open-ended >=5 does not count.
  • Within one package.json, every version satisfies the peerDependencies of the others.
  • Every image stays on its major line, and golang also on its minor, which must match the go directive of go.mod; a Go minor bump is a toolchain decision made by hand. Alpine variants follow the newest alpine release the image publishes.
  • yarn stays on Classic 1.x, and Bun follows the oven/bun image tag.

-write also rewrites the old version where docs/*.md and site/content/docs/**/*.mdx mention it next to the package name (htmx 4.0.0, react-email@6.11.6, oven/bun:1.4.5-alpine). site/content/versions/ and CHANGELOG.md are history and never change. When a docs page changes, the workflow commits it and then runs npm ci && npm run last-updated in site/, in a second commit, because the date comes from git history.

The workflow needs a way to open the pull request and to run the required checks on it. Pick one:

  1. Enable the repository setting Settings > Actions > General > "Allow GitHub Actions to create and approve pull requests". The pull request is then opened with GITHUB_TOKEN, which does not trigger the required checks, so push an empty commit to chore/starter-deps to run them.
  2. Add a STARTER_DEPS_TOKEN secret (a fine-grained PAT or a GitHub App token with contents and pull requests write). The workflow pushes and opens the pull request with it when it is set, so CI runs on its own; it falls back to GITHUB_TOKEN otherwise.

If gh pr create is refused, the run fails with an ::error:: that names both options, and ci-failure.yml opens the issue.

A module added to the repository must be added to the gomod directories in .github/dependabot.yml, to the vuln.yml matrix and to MODULES in Taskfile.yml.

Finance scaffold routine

vukem new --example finance writes the vukem-finances application, not a starter with patches. The CLI embeds the archive of a published release of github.com/AlexGalhardo/vukem-finances (internal/cli/scaffolds/finance/scaffold.tar.gz) and its MANIFEST.sha256; the plain tree is larger than the binary-size guard allows, so the archive is read with archive/tar at generation time. The tag it comes from is financeScaffoldTag in internal/cli/finance_scaffold.go, and the prebuilt image is ghcr.io/alexgalhardo/vukem-finances at that version.

To update it from an application release:

  1. Check that the application release has the assets scaffold-vX.Y.Z.tar.gz and scaffold-vX.Y.Z.MANIFEST.sha256 (attached by its image workflow). Never update from an unreleased branch.
  2. Run scripts/update-finance-scaffold.sh vX.Y.Z. It downloads both assets with gh release download, checks that VERSION in the archive is the tag, that the manifest is the one inside the archive and that every file matches it, then replaces the two embedded files and pins the tag.
  3. Compare go.mod of the application at that tag: financeStripeVersion must be its contrib/stripe pin. The exported tree has no go.mod; the CLI writes it.
  4. Run go test ./internal/cli/... -run 'TestFinanceScaffold|TestNewFinance|TestFinance|TestNewPrebuiltFinance'. TestFinanceScaffoldMatchesManifest fails if one embedded byte changed outside the script, and TestNewFinanceProjectEndToEnd generates the project and runs its own build, vet and test suite.
  5. Run go build -o "$TEMP/vukem" ./cmd/vukem and compare the size with the previous build: the CLI may grow by at most 3 MiB for this scaffold.
  6. Commit as feat(cli): update the finance scaffold to vX.Y.Z, and refresh the documentation pages if the app changed what they describe.

Security review routine

  1. A change in auth, session, csrf, crypt, signed, storage, upload, router, orm or middleware updates its row in security.md and its TestSecurity_* test in the same PR.
  2. A failure of Fuzz, Vulnerabilities (weekly), Scorecard, Secrets or CodeQL opens or updates an issue labelled ci-failure (ci-failure.yml). It blocks the next release until it is triaged: fixed, with the crasher committed under testdata/fuzz/<Target>/, or documented as a false positive.
  3. Quarterly: re-run security-review.md against the OWASP Top 10 and ASVS and record the date on that page.
  4. A security release gets a Security changelog entry (a fix!: commit with a BREAKING CHANGE: footer when it breaks an API), an Insecure… opt-out when reasonable, and an apicheck exception when it breaks an API after v1.

Secret scanning

Betterleaks v1.9.0 (latest stable release on 2026-10-29; the v2.0.0-rc.* tags are pre-releases and stay out until a stable v2) scans for leaked secrets on top of GitHub's server-side scanning:

  • CI: .github/workflows/secrets.yml installs the Linux x64 release archive checked against its sha256 from the release's checksums.txt, scans the commits a pull request or push adds, and the whole history every Monday (failures reach ci-failure.yml).
  • Locally: task secrets:scan (full history; task secrets:scan -- --log-opts=main..HEAD for a branch). Install with go install github.com/betterleaks/betterleaks@v1.9.0 or the release archive.
  • .betterleaks.toml extends the default rules with vukem's APP_KEY (base64: + 43 chars + =) and API token (vk_<26>.<26> base32) formats, and allowlists only literal placeholder values (hunter2, correct horse..., _FAKE_, placeholder, example) plus the password-field labels Password, Confirm password, Senha, Confirmar senha, Contraseña and Confirmar contraseña. Never allowlist a path.
  • .betterleaksignore lists reviewed historical findings (fixtures, documentation samples, translated "password" labels) by fingerprint. A new finding is either a placeholder that should say so (_FAKE_, example) or a real secret: rotate it, do not ignore it. The fingerprint uses the commit that is on main. A rebase changes that id, so the ignore must move with it. The 2026-10-30 main push (#95) flagged TestSecurity_A01_AdminRequiresAbility in docs/security.md (the test name sits next to the word "login"); that identifier is not a credential and its fingerprint is in .betterleaksignore.
  • Validation (--validation, which sends findings to credential providers) stays off.

To bump: change BETTERLEAKS_VERSION and BETTERLEAKS_SHA256 in secrets.yml (sha256 of betterleaks_<v>_linux_x64.tar.gz from checksums.txt) and the version in Taskfile.yml, then run task secrets:scan.

Metrics

Checked at each release (the "Scorecard tracking" issue #5 was closed on 2026-10-29; the history and the open levers live here):

Metric Source Target
Scorecard score and per-check scores api.scorecard.dev ≥ 8.5 by v1.0.0; no check drops between releases
Open fixable vulnerabilities govulncheck, Scorecard Vulnerabilities 0
Scheduled workflows green gh run list --workflow fuzz.yml (and vuln.yml, scorecard.yml) 100% over the last 4 weeks
Coverage covergate in ci.yml ≥ 80% overall, ≥ 90% strict packages; no drop between releases
//nolint:gocognit in non-test code GOCOGNIT_BUDGET in ci.yml never rising; 4 at v1.0.0: the GraphQL executor and schema tables in contrib/graphql (introspection.go, schema.go twice, subscribe.go), kept as recorded exceptions because splitting them reads worse; everything else is 0
Dependabot PRs open for more than 7 days gh pr list --author app/dependabot 0
Time from a ci-failure issue to its fix ci-failure issues < 7 days
Time to first response on an issue issues without needs-triage < 7 days
Doc and code drift web/docs_test.go, z/tags_rules_test.go, internal/cli/reference_docs_test.go, snippetcheck 0 failures; each new API table in docs/ gets a test

Scorecard history

Add a row at each release from https://api.scorecard.dev/projects/github.com/AlexGalhardo/vukem (the score of the release commit's main push).

Release Date Commit Score Notes
v0.31.0 2026-10-25 d3c19ee 7.1 Baseline from the specialist audit
v0.32.0 2026-10-25 deb7aab 7.5 Vulnerabilities 5→9, Pinned-Dependencies 9→10, CI-Tests -1→10
v0.33.0 2026-10-29 ca2565f 7.3 Branch-Protection 3→4; Vulnerabilities 9→5: golang.org/x/net GO-2026-6860 and GO-2026-6866 (drivers/otel, internal/bench) and echo v4 GHSA-246p-cpwv-v3jq and GHSA-99jh-6h7p-pp36 (internal/bench), fixed after the release by x/net v0.62.0 and echo v5.4.2; GO-2026-5932 has no fix

Scorecard levers that need the maintainer

The automatable checks are at 10 (Binary-Artifacts, CI-Tests, Dangerous-Workflow, Dependency-Update-Tool, Fuzzing, License, Packaging, Pinned-Dependencies, SAST, Security-Policy, Signed-Releases, Token-Permissions). What is left needs a person or time:

  • CII-Best-Practices 0 → 5: apply for the OpenSSF Best Practices passing badge at https://www.bestpractices.dev and add the badge to the README.
  • Code-Review 0 and Branch-Protection 4 → 8+: require one approving review (and code-owner review, last-push approval) in the protect-main ruleset, which needs a second human maintainer; a sole maintainer cannot approve their own PRs.
  • Contributors 0: rises when people from other organizations contribute.
  • Maintained 0: rises on its own 90 days after the repository was created (after 2027-01-14) with weekly activity.
  • Branch protection ruleset applied (.config/ruleset-protect-main.json, 2026-10-25).

Maintainer-only settings

These live in GitHub settings or external services, not in the repository:

  • The protect-main ruleset (above).
  • Private vulnerability reporting, Dependabot alerts and security updates, secret scanning and push protection (Settings → Code security).
  • The OpenSSF Best Practices badge (https://www.bestpractices.dev), whose answers point at this page, CONTRIBUTING, SECURITY.md, testing.md and tooling.md.
  • Two-factor authentication on the maintainer account.

Issues

Issues arrive through four forms in .github/ISSUE_TEMPLATE/; blank issues are off, and security reports go to the private advisory, never to a public issue.

  • Forms: bug_report.yml (area, what happened, expected, minimal reproduction, versions), feature_request.yml (area, problem, proposal, alternatives, breaking or not), docs.yml (area, page, what is wrong) and task.yml (area, why, scope, done criteria, size; for planned work, audit findings and tech debt). All share the same skeleton: a required area dropdown, the type label, needs-triage and a duplicate check.
  • Title: bug: …, feat: …, docs: …, task: …, lowercase, no trailing period. The exception is CI failure: <workflow>, opened by ci-failure.yml, whose title is the deduplication key.
  • Area: the commit scopes of tooling.md except deps and release, plus other.

Labels

.github/labels.txt is the source of truth; task labels:sync creates or updates them with gh (it never deletes, so the Dependabot and GitHub default labels stay).

Axis Labels
Type bug, enhancement, documentation, task, tracking, ci-failure
Area area:<scope>, one per area
Priority priority:p1 (before the next release), priority:p2, priority:p3
State needs-triage, needs-repro, blocked, breaking

Triage and lifecycle

  • Every new issue carries needs-triage. Triage confirms the type, sets one area:* and one priority:*, and removes needs-triage; without a reproduction it gets needs-repro instead.
  • First response within 7 days. A priority:p1 issue blocks the next release, like ci-failure.
  • The PR that resolves an issue has Fixes #N in the body and the matching commit type (bug → fix, enhancement → feat, documentation → docs, task → whichever fits) with the area as scope.
  • Closing without a fix needs a comment with the reason and one of wontfix, duplicate or invalid.
  • An agent only picks an issue that has neither needs-triage nor blocked; the done criteria of a task issue are the commands it runs before opening the PR.

Downstream feedback queue

Apps built on Vukem log what the framework gets wrong or leaves undocumented in one place: a single vukem-feedback.md at the workspace root, next to the vukem/ checkout. No app keeps a copy, and this repository ignores the file in git.

Each app has its own id prefix:

App Prefix
vukem-email VE-
hexascore HS-
vukem-trading TR-
vukem-video VD- for new entries; existing ST- entries (from before the app was renamed) keep their ids
vukem-music MU- (proposed)
vukem-tools TL- (proposed)

Each entry has this shape:

## <ID>: <title>

- Severity: critical | high | medium | low
- Status: open
- Date: YYYY-MM-DD
- Docs: https://vukem.dev/docs/<page> (heading)
- Finding: what was observed
- Minimal repro: the smallest code or command that shows it
- Suggested fix: what the app would expect

To close entries, fix them all on one pull request with one commit per entry (the PR is merged by rebase), each with its tests and docs. Then update Status with the PR and the commit. Pull request #165 (fix: close vukem-feedback ST-7, ST-8 and VE-8) is the model.

Problems in an app's own environment, infrastructure or third-party libraries do not belong in the queue.