Skip to content

refactor(makefile): consolidate docker-up variants behind PROFILE param#167

Merged
saschagobel merged 3 commits intotest/annotation-fixture-isolationfrom
refactor/makefile-docker-profile
Apr 30, 2026
Merged

refactor(makefile): consolidate docker-up variants behind PROFILE param#167
saschagobel merged 3 commits intotest/annotation-fixture-isolationfrom
refactor/makefile-docker-profile

Conversation

@henrycgbaker
Copy link
Copy Markdown
Collaborator

Goal

Replace four near-identical docker-up* Makefile targets with a single parameterised make docker-up PROFILE=<name>. Reduces duplication, makes the profile choice explicit at the call site, and aligns with the principle that the Makefile passes through to the underlying compose CLI rather than baking configuration into target names.

Scope

Makefile only.

Before:

docker-up
docker-up-external-pg
docker-up-external-es
docker-up

After:

docker-up                                # defaults to PROFILE=all-bundled
make docker-up PROFILE=external-pg       # explicit override
make docker-up PROFILE=external-es
make docker-up PROFILE=external

Implementation

  • PROFILE ?= all-bundled makes all-bundled the default while allowing override on the command line.
  • A single case statement in the recipe routes by PROFILE:
    • Sets the appropriate --profile flag (or empty for external).
    • Runs the env-var validation specific to that profile (ARGILLA_DATABASE_URL for external-pg, etc.).
  • Unknown PROFILE values fail with a clear error listing the valid options.
  • Top-of-file comment block documents the four valid values.
  • down/stop/logs/status still use $(ALL_PROFILES) so they affect every profile's containers regardless of which one started the stack.

Testing

  • make docker-up (default) → starts stack as all-bundled. Argilla up at :6900 — verified.
  • make docker-up PROFILE=garbageError: unknown PROFILE 'garbage' (valid: all-bundled, external-pg, external-es, external), exit 1.
  • make docker-up PROFILE=external-pg (without ARGILLA_DATABASE_URL in .env) → Error: ARGILLA_DATABASE_URL must be set for PROFILE=external-pg, exit 1.
  • make ci green (598 passed, 39 deselected).
  • make test-all green (637 passed).
  • tests/unit/test_dev_stack.py::test_makefile_defines_expected_targets still passes — the unit test only pins canonical targets (docker-up, docker-down, etc.), not the variant targets that this PR removes.

References

@henrycgbaker henrycgbaker marked this pull request as ready for review April 25, 2026 16:56
@henrycgbaker henrycgbaker added enhancement New feature or request annotation labels Apr 25, 2026
@henrycgbaker henrycgbaker force-pushed the test/annotation-fixture-isolation branch from fc9d4b1 to 451befd Compare April 26, 2026 11:51
@henrycgbaker henrycgbaker force-pushed the refactor/makefile-docker-profile branch from d1ec69c to 1418d91 Compare April 26, 2026 11:52
Copy link
Copy Markdown
Collaborator

@saschagobel saschagobel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved — the refactor is sound and simplifies the Makefile nicely; only one non-blocking cleanup comment.

Comment thread Makefile Outdated
@saschagobel saschagobel merged commit 23a19d2 into test/annotation-fixture-isolation Apr 30, 2026
@saschagobel saschagobel deleted the refactor/makefile-docker-profile branch April 30, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

annotation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants