Skip to content

test: rename RUN_EARTHLY test UDCs to RUN_EARTHBUILD#642

Open
kmannislands wants to merge 1 commit into
mainfrom
rename-run-earthly-test-udc
Open

test: rename RUN_EARTHLY test UDCs to RUN_EARTHBUILD#642
kmannislands wants to merge 1 commit into
mainfrom
rename-run-earthly-test-udc

Conversation

@kmannislands

Copy link
Copy Markdown

What

Renames the internal test-harness User Defined Commands used across the integration test Earthfiles:

Old New
RUN_EARTHLY RUN_EARTHBUILD
RUN_EARTHLY_ARGS RUN_EARTHBUILD_ARGS
DO_REMOTE_CACHE_EARTHLY DO_REMOTE_CACHE_EARTHBUILD

This covers the FUNCTION/COMMAND definitions and every DO +... invocation, including cross-file references (tests+RUN_EARTHBUILD, ../../+RUN_EARTHBUILD).

Why

Part of the ongoing earthlyearthbuild naming cleanup. These UDCs are purely internal test fixtures — renaming them changes no user-facing behavior, config, env vars, or released target/artifact names.

Verification

  • All 29 affected Earthfiles parse cleanly via earthly debug ast.
  • No lingering RUN_EARTHLY / DO_REMOTE_CACHE_EARTHLY references remain (the distinct CI input RUN_EARTHLY_TEST_ARGS is intentionally left for a separate CI-vars PR).
  • Reduces the tracked earthly line count by 529 (5408 → 4879).

🤖 Generated with Claude Code

Renames the internal test-harness User Defined Commands used across the
integration test Earthfiles:

  RUN_EARTHLY            -> RUN_EARTHBUILD
  RUN_EARTHLY_ARGS       -> RUN_EARTHBUILD_ARGS
  DO_REMOTE_CACHE_EARTHLY -> DO_REMOTE_CACHE_EARTHBUILD

These are purely internal test fixtures (function definitions and their
`DO +...` invocations, including cross-file `tests+RUN_EARTHBUILD` and
`../../+RUN_EARTHBUILD` references). No user-facing behavior, config,
env vars, or released target/artifact names change.

All 29 affected Earthfiles verified to parse via `earthly debug ast`.
Reduces "earthly" line count by 529 (5408 -> 4879).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kmannislands kmannislands requested a review from a team as a code owner July 3, 2026 16:34
@kmannislands kmannislands requested review from gilescope and removed request for a team July 3, 2026 16:34
@kmannislands kmannislands added the ai-assisted Authored with AI assistance label Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

🎉 Are we earthbuild yet?

Great progress! You've reduced "earthly" occurrences by 529 (9.78%)

📈 Overall Progress

Branch Total Count
main 5408
This PR 4879
Difference -529 (9.78%)

📁 Changes by file type:

File Type Change
Go files (.go) ➖ No change
Documentation (.md) ➖ No change
Earthfiles ✅ -529

Keep up the great work migrating from Earthly to Earthbuild! 🚀

💡 Tips for finding more occurrences

Run locally to see detailed breakdown:

./.github/scripts/count-earthly.sh

Note that the goal is not to reach 0.
There is anticipated to be at least some occurences of earthly in the source code due to backwards compatibility with config files and language constructs.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request renames the test helper functions and targets from RUN_EARTHLY to RUN_EARTHBUILD (and similarly for related arguments and helpers) across all test Earthfiles. The review feedback highlights a few critical argument mismatches in the test files: specifically, the use of -target instead of --target in tests/Earthfile, and the use of --should-fail instead of --should_fail in both tests/locally-in-command/Earthfile and tests/locally-in-function/Earthfile, which would prevent correct argument binding.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread tests/Earthfile
Comment on lines +563 to +569
DO +RUN_EARTHBUILD --earthfile=allow-privileged.earth --should_fail=true --extra_args="--allow-privileged" -target=+reject-privileged-in-remote-repo-triggered-by-from-locally
DO +RUN_EARTHBUILD --earthfile=allow-privileged.earth --should_fail=true --extra_args="--allow-privileged" -target=+reject-privileged-in-remote-repo-triggered-by-from-privileged
DO +RUN_EARTHBUILD --earthfile=allow-privileged.earth --should_fail=true --extra_args="--allow-privileged" -target=+reject-privileged-in-remote-repo-triggered-by-copy-locally
DO +RUN_EARTHBUILD --earthfile=allow-privileged.earth --should_fail=true --extra_args="--allow-privileged" -target=+reject-privileged-in-remote-repo-triggered-by-copy-privileged
DO +RUN_EARTHBUILD --earthfile=allow-privileged.earth --should_fail=true --extra_args="--allow-privileged" -target=+reject-privileged-in-remote-repo-triggered-by-build-locally
DO +RUN_EARTHBUILD --earthfile=allow-privileged.earth --should_fail=true --extra_args="--allow-privileged" -target=+reject-privileged-in-remote-repo-triggered-by-build-privileged
DO +RUN_EARTHBUILD --earthfile=allow-privileged.earth --should_fail=true --extra_args="--allow-privileged" -target=+reject-dedup

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The argument -target is used instead of --target. In Earthly, User Defined Command (UDC) arguments must be prefixed with double hyphens (--target). Using a single hyphen will prevent the argument from being bound correctly, causing the target to default to +all.

    DO +RUN_EARTHBUILD --earthfile=allow-privileged.earth --should_fail=true --extra_args="--allow-privileged" --target=+reject-privileged-in-remote-repo-triggered-by-from-locally
    DO +RUN_EARTHBUILD --earthfile=allow-privileged.earth --should_fail=true --extra_args="--allow-privileged" --target=+reject-privileged-in-remote-repo-triggered-by-from-privileged
    DO +RUN_EARTHBUILD --earthfile=allow-privileged.earth --should_fail=true --extra_args="--allow-privileged" --target=+reject-privileged-in-remote-repo-triggered-by-copy-locally
    DO +RUN_EARTHBUILD --earthfile=allow-privileged.earth --should_fail=true --extra_args="--allow-privileged" --target=+reject-privileged-in-remote-repo-triggered-by-copy-privileged
    DO +RUN_EARTHBUILD --earthfile=allow-privileged.earth --should_fail=true --extra_args="--allow-privileged" --target=+reject-privileged-in-remote-repo-triggered-by-build-locally
    DO +RUN_EARTHBUILD --earthfile=allow-privileged.earth --should_fail=true --extra_args="--allow-privileged" --target=+reject-privileged-in-remote-repo-triggered-by-build-privileged
    DO +RUN_EARTHBUILD --earthfile=allow-privileged.earth --should_fail=true --extra_args="--allow-privileged" --target=+reject-dedup

DO --pass-args +RUN_EARTHBUILD_ARGS --target=/the-test+test
RUN test "$(cat /the-test/data)" = "I am running in /the-test"
DO --pass-args +RUN_EARTHLY_ARGS --target=/the-test+test --should-fail=true
DO --pass-args +RUN_EARTHBUILD_ARGS --target=/the-test+test --should-fail=true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The argument --should-fail is passed with a hyphen, but the function RUN_EARTHBUILD_ARGS defines the parameter as should_fail with an underscore. This mismatch will prevent the argument from being bound correctly, causing it to default to false and potentially leading to incorrect test assertions.

    DO --pass-args +RUN_EARTHBUILD_ARGS --target=/the-test+test --should_fail=true

DO --pass-args +RUN_EARTHBUILD_ARGS --target=/the-test+test
RUN test "$(cat /the-test/data)" = "I am running in /the-test"
DO --pass-args +RUN_EARTHLY_ARGS --target=/the-test+test --should-fail=true
DO --pass-args +RUN_EARTHBUILD_ARGS --target=/the-test+test --should-fail=true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The argument --should-fail is passed with a hyphen, but the function RUN_EARTHBUILD_ARGS defines the parameter as should_fail with an underscore. This mismatch will prevent the argument from being bound correctly, causing it to default to false and potentially leading to incorrect test assertions.

    DO --pass-args +RUN_EARTHBUILD_ARGS --target=/the-test+test --should_fail=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Authored with AI assistance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants