Skip to content

refactor: split justfile into imports#3111

Closed
auricom wants to merge 3 commits intomigrate-make-to-justfrom
option-a-just-imports-4files
Closed

refactor: split justfile into imports#3111
auricom wants to merge 3 commits intomigrate-make-to-justfrom
option-a-just-imports-4files

Conversation

@auricom
Copy link
Contributor

@auricom auricom commented Feb 26, 2026

Summary

  • Split the justfile into 4 grouped .just/*.just files and import them
  • Add private helper recipes to reduce build/tool duplication
  • Normalize EV_NODE_IMAGE_REPO default handling in docker E2E helpers

Testing

  • Not run (not requested)

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 26, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch option-a-just-imports-4files

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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 and usage tips.

@github-actions
Copy link
Contributor

The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped✅ passed✅ passedFeb 26, 2026, 4:06 PM

@claude
Copy link
Contributor

claude bot commented Feb 26, 2026

Claude finished @auricom's task in 2m 13s —— View job


Code Review: refactor: split justfile into imports

  • Gather context and understand request
  • Read changed files
  • Analyze justfile refactoring
  • Post review feedback

Summary

This is a well-structured refactor. Splitting a 350-line justfile into grouped .just/*.just imports is a sound approach, and the private helper pattern (_build_go, _install_go, etc.) meaningfully reduces copy-paste across 10+ recipes. The EV_NODE_IMAGE_REPO normalization fix is also correct — aligning the test-docker-e2e check to use "evstack" instead of "ev-node" matches the condition in docker-build-if-local and docker-cleanup-if-local.

A few issues to address before merging:


Issues

1. Duplicate "Verifying Docker image exists locally..." echo.just/dev.just:60-62

The message is printed unconditionally on line 60, then printed again inside the if block on line 62 when the condition is true:

test-docker-e2e: docker-build-if-local
    @echo "--> Running Docker E2E tests"
    @echo "--> Verifying Docker image exists locally..."   # always prints
    @if [ -z "${EV_NODE_IMAGE_REPO:-}" ] || [ "${EV_NODE_IMAGE_REPO:-}" = "evstack" ]; then \
        echo "--> Verifying Docker image exists locally..."; \   # prints again
        docker image inspect evstack:local-dev ...

The outer echo on line 60 should be removed since it duplicates what the inner block already handles. Fix this →

2. Missing @ prefix on go run in mock-gen.just/gen.just:40

Every other command in every recipe suppresses output with @. The go run line in mock-gen is the only exception, causing it to echo the command before executing:

mock-gen:
    @echo "-> Generating mocks"
    go run github.com/vektra/mockery/v3@latest   # ← missing @

Should be @go run ... for consistency. Fix this →


Observations (Non-blocking)

File naming for dev.just: The file contains test, lint, and run recipes — "dev" is broad but not inaccurate. A more expressive split (e.g., test.just + lint.just) would improve discoverability, but that's a subjective call and not a blocker for this PR.

docker-build-if-local / docker-cleanup-if-local are public recipes: These work as internal helpers but are callable directly (listed under [group('test')]). Making them [private] (with _ prefix, like the build helpers) would prevent them from cluttering just --list. Worth considering.

Variable scoping across imports: build_dir, ldflags, and tool_ldflags are defined in the root justfile and referenced freely in the imported files. This is valid in just (variables are globally scoped across imports), but it's an implicit coupling — if the variables are ever renamed, all four files need updating. A comment in the root justfile documenting that these are shared with the .just/ files would help future maintainers.


Strengths

  • The _build_go / _install_go / _build_tool / _install_tool helper pattern is a clean abstraction that eliminates 10+ lines of duplication and centralizes the ldflags usage.
  • build_dir := justfile_directory() / "build" correctly produces an absolute path, so cd {{ dir }} && go build -o {{ build_dir }}/... works correctly regardless of the working directory.
  • Group annotations ([group('build')], [group('test')], etc.) are thorough and consistent throughout all four files.
  • The EV_NODE_IMAGE_REPO normalization is correct — all three places (docker-build-if-local, docker-cleanup-if-local, test-docker-e2e) now consistently use "evstack" as the sentinel value.

@auricom auricom closed this Feb 26, 2026
@auricom auricom deleted the option-a-just-imports-4files branch February 26, 2026 16:10
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