earthly / earthly

Super simple build framework with fast, repeatable builds and an instantly familiar syntax – like Dockerfile and Makefile had a baby.
https://earthly.dev
Mozilla Public License 2.0
11.41k stars 399 forks source link

Starting with 0.7.19, all ARG values are echoed before every command, instead of just ARGs in scope #3363

Open avirshup opened 1 year ago

avirshup commented 1 year ago

What went wrong? In version 0.7.17 and below, the logs show any relevant ARGs before each command. In version 0.7.19 and above, the logs now display all the ARGs for the entire build, before each command.

Because we usually run CI with a pretty big .arg file (containing all of gitlab's CI env vars), this has unfortunately has made our CI logs a lot larger and noisy.

Example Here is a (sanitized) .arg file: .arg, and here's a "hello world" Earthfile: Earthfile. Put both in a directory and then run earthly +all --place=world with versions 0.7.17 and 0.7.19.

Here are the logs for version 0.7.17:

                +all | place=world
                +all | *cached* --> RUN echo "hello, $place"

And 0.7.19:

                +all | CI=true CI_API_GRAPHQL_URL=https://my.gitlab.server/api/graphql CI_API_V4_URL=https://my.gitlab.server/api/v4 CI_BUILDS_DIR=/builds CI_BUILD_BEFORE_SHA=0000000000000000000000000000000000000000 CI_BUILD_ID=1902 CI_BUILD_NAME=environment_and_secrets CI_BUILD_REF=12345 CI_BUILD_REF_NAME=branch/default CI_BUILD_REF_SLUG=branch-default CI_BUILD_STAGE=test CI_COMMIT_AUTHOR=Joe Schmoe <Joe.Schmoe@example.com> CI_COMMIT_BEFORE_SHA=0000000000000000000000000000000000000000 CI_COMMIT_BRANCH=branch/default CI_COMMIT_DESCRIPTION= CI_COMMIT_HG_BRANCH=default CI_COMMIT_HG_SHA=12345 CI_COMMIT_HG_SHORT_SHA=12345 CI_COMMIT_MESSAGE=commit message CI_COMMIT_REF_NAME=branch/default CI_COMMIT_REF_PROTECTED=true CI_COMMIT_REF_SLUG=branch-default CI_COMMIT_SHA=0000000000000000000000000000000000000000 CI_COMMIT_SHORT_SHA=0000000000000000000000000000000000000000 CI_COMMIT_TIMESTAMP=0000000000000000000000000000000000000000 CI_COMMIT_TITLE=commit message CI_CONCURRENT_ID=0 CI_CONCURRENT_PROJECT_ID=0 CI_CONFIG_PATH=.gitlab-ci.yml CI_DEFAULT_BRANCH=branch/default CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX=my.gitlab.server:443/something/dependency_proxy/containers CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX=my.gitlab.server:443/something/dependency_proxy/containers CI_DEPENDENCY_PROXY_SERVER=my.gitlab.server:443 CI_DEPENDENCY_PROXY_USER=something CI_DISPOSABLE_ENVIRONMENT=true CI_JOB_ID=1902 CI_JOB_NAME=something CI_JOB_NAME_SLUG=something CI_JOB_STAGE=something CI_JOB_STARTED_AT=0000000000000000000000000000000000000000 CI_JOB_STATUS=running CI_JOB_URL=https://my.gitlab.server/something/something/-/jobs/1902 CI_NODE_TOTAL=1 CI_PAGES_DOMAIN=example.com CI_PAGES_URL=http://infrastructure.example.com/something CI_PIPELINE_CREATED_AT=0000000000000000000000000000000000000000 CI_PIPELINE_ID=736 CI_PIPELINE_IID=18 CI_PIPELINE_SOURCE=web CI_PIPELINE_URL=https://my.gitlab.server/something/something/-/pipelines/736 CI_PROJECT_CLASSIFICATION_LABEL= CI_PROJECT_DESCRIPTION= CI_PROJECT_DIR=/builds/something/something CI_PROJECT_ID=23 CI_PROJECT_NAME=something CI_PROJECT_NAMESPACE=something CI_PROJECT_NAMESPACE_ID=42 CI_PROJECT_PATH=something/something CI_PROJECT_PATH_SLUG=something-something CI_PROJECT_REPOSITORY_LANGUAGES=markdown,plain text CI_PROJECT_ROOT_NAMESPACE=something CI_PROJECT_TITLE=something CI_PROJECT_URL=https://my.gitlab.server/something/something CI_PROJECT_VISIBILITY=internal CI_REGISTRY=my.gitlab.server:8080 CI_REGISTRY_IMAGE=my.gitlab.server:8080/something/something CI_REGISTRY_USER=gitlab-ci-token CI_REPOSITORY_URL=https://something:something@my.gitlab.server/something CI_RUNNER_DESCRIPTION=heptapod-runner CI_RUNNER_EXECUTABLE_ARCH=linux/amd64 CI_RUNNER_ID=1 CI_RUNNER_REVISION=47e7e9a450f4 CI_RUNNER_TAGS=[] CI_RUNNER_VERSION=hpd-0.6.0 CI_SERVER=yes CI_SERVER_HOST=my.gitlab.server CI_SERVER_NAME=GitLab CI_SERVER_PORT=443 CI_SERVER_PROTOCOL=https CI_SERVER_REVISION=f3c64906512f CI_SERVER_SHELL_SSH_HOST=my.gitlab.server CI_SERVER_SHELL_SSH_PORT=22 CI_SERVER_TLS_CA_FILE=/builds/something/something.tmp/CI_SERVER_TLS_CA_FILE CI_SERVER_URL=https://my.gitlab.server CI_SERVER_VERSION=15.11.13 CI_SERVER_VERSION_MAJOR=15 CI_SERVER_VERSION_MINOR=11 CI_SERVER_VERSION_PATCH=13 CI_TEMPLATE_REGISTRY_HOST=registry.example.com GITLAB_CI=true GITLAB_FEATURES= GITLAB_USER_EMAIL=Joe.Schmoe@example.com GITLAB_USER_ID=8 GITLAB_USER_LOGIN=Joe.Schmoe GITLAB_USER_NAME=Joe Schmoe
                +all | *cached* --> RUN echo "hello, $place"

What should have happened? Ideally, the behavior from 0.7.17 could be restored - where only the relevant arguments are displayed for each target.

Thanks!!!

alexcb commented 1 year ago

We'll try to revert to the original behaviour, and only display the full list when run via --verbose mode; however this will be a lower-priority item unfortunately.