Skip to content

refactor(make): move recipe logic into scripts/ and record the runner choice - #192

Merged
vovinacci merged 1 commit into
mainfrom
refactor/make-scripts-adr
Jul 27, 2026
Merged

refactor(make): move recipe logic into scripts/ and record the runner choice#192
vovinacci merged 1 commit into
mainfrom
refactor/make-scripts-adr

Conversation

@vovinacci

Copy link
Copy Markdown
Owner

The task-runner choice was never written down -- it was inherited from the baseline and had no ADR, so "why make and not Taskfile?" had no answer to read. ADR-0019 records it, and argues the rejected alternative honestly: Taskfile is better than make on the axes it targets, and the reasons to stay are the extra required install in a repo whose prerequisites are already a documented hurdle, and a migration touching every workflow, doc, and exercise for no behavioural gain. The ADR names the trigger to reopen it.

The second half of the problem was where logic lived. test-backend was 32 lines of shell inside a recipe -- backslash continuations, $$ escaping, a readiness loop, an exit code captured and re-raised around a cleanup step -- and clean was 28. Recipe shell is the worst place for that: shellcheck cannot see it, it cannot be run in isolation, and it is written in a quoting compromise between shell and make.

test-backend, test-docker, and clean now live in scripts/, invoked as one-line targets, and are covered by the existing shellcheck and shfmt hooks. COMPOSE stays defined once in the Makefile and is passed through the environment; each script fails loudly if it is missing rather than silently running against the wrong compose project. Makefile: 446 -> 373 lines.

The line is control flow, not line count: smoke and smoke-full stay inline despite their length, because they are flat command sequences whose bulk is comments explaining the CI contract that .github/workflows/ points at as "runs exactly this".

Behaviour verified in both directions, since a silent break here would mean green CI over failing tests: make test-backend passes 38 tests and exits 0, and with a deliberately failing test added it exits non-zero -- the exit code still survives the database-cleanup step. make help lists all 54 targets unchanged, and make ci still resolves.

The extracted scripts also drop two non-ASCII characters the recipes carried, bringing them in line with the repo's ASCII-only convention.

… choice

The task-runner choice was never written down -- it was inherited from the
baseline and had no ADR, so "why make and not Taskfile?" had no answer to
read. ADR-0019 records it, and argues the rejected alternative honestly:
Taskfile is better than make on the axes it targets, and the reasons to stay
are the extra required install in a repo whose prerequisites are already a
documented hurdle, and a migration touching every workflow, doc, and exercise
for no behavioural gain. The ADR names the trigger to reopen it.

The second half of the problem was where logic lived. `test-backend` was 32
lines of shell inside a recipe -- backslash continuations, `$$` escaping, a
readiness loop, an exit code captured and re-raised around a cleanup step --
and `clean` was 28. Recipe shell is the worst place for that: shellcheck
cannot see it, it cannot be run in isolation, and it is written in a quoting
compromise between shell and make.

`test-backend`, `test-docker`, and `clean` now live in scripts/, invoked as
one-line targets, and are covered by the existing shellcheck and shfmt hooks.
COMPOSE stays defined once in the Makefile and is passed through the
environment; each script fails loudly if it is missing rather than silently
running against the wrong compose project. Makefile: 446 -> 373 lines.

The line is control flow, not line count: `smoke` and `smoke-full` stay
inline despite their length, because they are flat command sequences whose
bulk is comments explaining the CI contract that .github/workflows/ points
at as "runs exactly this".

Behaviour verified in both directions, since a silent break here would mean
green CI over failing tests: `make test-backend` passes 38 tests and exits 0,
and with a deliberately failing test added it exits non-zero -- the exit code
still survives the database-cleanup step. `make help` lists all 54 targets
unchanged, and `make ci` still resolves.

The extracted scripts also drop two non-ASCII characters the recipes carried,
bringing them in line with the repo's ASCII-only convention.
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@vovinacci, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 56 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bdc1b459-01e5-4d88-b968-26b20b96a1ef

📥 Commits

Reviewing files that changed from the base of the PR and between c608d5d and 954cdbc.

📒 Files selected for processing (6)
  • Makefile
  • README.md
  • docs/adr/0019-make-as-task-runner.md
  • scripts/clean.sh
  • scripts/test-backend.sh
  • scripts/test-docker.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/make-scripts-adr

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@vovinacci

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@vovinacci
vovinacci merged commit adbea39 into main Jul 27, 2026
5 checks passed
@vovinacci
vovinacci deleted the refactor/make-scripts-adr branch July 27, 2026 12:50
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.

2 participants