From 244332b127f3776cd16b7840c8f36abb2ff00cf8 Mon Sep 17 00:00:00 2001 From: Ofek Lev Date: Tue, 11 Mar 2025 19:23:31 -0400 Subject: [PATCH] Properly use dda in all places --- .gitlab/deploy_containers/deploy_containers_a7.yml | 4 ++-- .gitlab/deploy_dca/deploy_dca.yml | 2 +- .gitlab/functional_test/static_quality_gate.yml | 2 +- .gitlab/internal_image_deploy/internal_image_deploy.yml | 4 ++-- .gitlab/package_build/linux.yml | 2 +- pkg/gpu/testutil/event-viewer/README.md | 2 +- pkg/proto/datadog/README.md | 4 ++-- tasks/buildimages.py | 4 ++-- tasks/modules.py | 4 ++-- tasks/protobuf.py | 4 ++-- tasks/release.py | 2 +- tasks/unit_tests/libs/common/check_tools_tests.py | 3 ++- tasks/winbuildscripts/Invoke-UnitTests.ps1 | 2 +- 13 files changed, 20 insertions(+), 19 deletions(-) diff --git a/.gitlab/deploy_containers/deploy_containers_a7.yml b/.gitlab/deploy_containers/deploy_containers_a7.yml index fbc06f256b488..65c7a79e20f6a 100644 --- a/.gitlab/deploy_containers/deploy_containers_a7.yml +++ b/.gitlab/deploy_containers/deploy_containers_a7.yml @@ -84,7 +84,7 @@ include: stage: deploy_containers dependencies: [] before_script: - - if [[ "$VERSION" == "" ]]; then VERSION="$(inv agent.version --url-safe --pipeline-id $PARENT_PIPELINE_ID)-fips" || exit $?; fi + - if [[ "$VERSION" == "" ]]; then VERSION="$(dda inv agent.version --url-safe --pipeline-id $PARENT_PIPELINE_ID)-fips" || exit $?; fi - export IMG_SOURCES="${SRC_AGENT}:v${PARENT_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}-7-fips${JMX}-amd64,${SRC_AGENT}:v${PARENT_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}-7-fips${JMX}-arm64" - export IMG_DESTINATIONS="${AGENT_REPOSITORY}:${VERSION}${JMX}" @@ -93,7 +93,7 @@ include: stage: deploy_containers dependencies: [] before_script: - - if [[ "$VERSION" == "" ]]; then VERSION="$(inv agent.version --url-safe --pipeline-id $PARENT_PIPELINE_ID)" || exit $?; fi + - if [[ "$VERSION" == "" ]]; then VERSION="$(dda inv agent.version --url-safe --pipeline-id $PARENT_PIPELINE_ID)" || exit $?; fi - export IMG_BASE_SRC="${SRC_AGENT}:v${PARENT_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}" - export IMG_LINUX_SOURCES="${IMG_BASE_SRC}-7-full-amd64,${IMG_BASE_SRC}-7-full-arm64" - export IMG_WINDOWS_SOURCES="${IMG_BASE_SRC}-7-jmx-win1809-amd64,${IMG_BASE_SRC}-7-jmx-winltsc2022-amd64" diff --git a/.gitlab/deploy_dca/deploy_dca.yml b/.gitlab/deploy_dca/deploy_dca.yml index d89230f66942c..be66e230c4c77 100644 --- a/.gitlab/deploy_dca/deploy_dca.yml +++ b/.gitlab/deploy_dca/deploy_dca.yml @@ -62,7 +62,7 @@ deploy_containers-dca_internal-latest: - job: "docker_build_cluster_agent_fips_arm64" artifacts: false before_script: - - if [[ "$VERSION" == "" ]]; then VERSION="$(inv agent.version --url-safe)" || exit $?; fi + - if [[ "$VERSION" == "" ]]; then VERSION="$(dda inv agent.version --url-safe)" || exit $?; fi - if [[ "$CLUSTER_AGENT_REPOSITORY" == "" ]]; then export CLUSTER_AGENT_REPOSITORY="cluster-agent"; fi - export IMG_BASE_SRC="${SRC_DCA}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}" - export IMG_SOURCES="${IMG_BASE_SRC}-fips-amd64,${IMG_BASE_SRC}-fips-arm64" diff --git a/.gitlab/functional_test/static_quality_gate.yml b/.gitlab/functional_test/static_quality_gate.yml index 69c81acffacd2..2e76f61bf6ae4 100644 --- a/.gitlab/functional_test/static_quality_gate.yml +++ b/.gitlab/functional_test/static_quality_gate.yml @@ -65,4 +65,4 @@ static_quality_gates: - export DD_API_KEY="$DATADOG_API_KEY" - !reference [ .setup_agent_github_app ] - SLACK_DATADOG_AGENT_BOT_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $SLACK_AGENT token) || exit $?; export SLACK_DATADOG_AGENT_BOT_TOKEN - - inv quality-gates.parse-and-trigger-gates + - dda inv quality-gates.parse-and-trigger-gates diff --git a/.gitlab/internal_image_deploy/internal_image_deploy.yml b/.gitlab/internal_image_deploy/internal_image_deploy.yml index 4d877e5f83b03..606e6f0b4b7c3 100644 --- a/.gitlab/internal_image_deploy/internal_image_deploy.yml +++ b/.gitlab/internal_image_deploy/internal_image_deploy.yml @@ -216,7 +216,7 @@ docker_trigger_cluster_agent_internal-fips: TMPL_SRC_REPO="${TMPL_SRC_REPO}-nightly" fi - if [ "$BUCKET_BRANCH" = "dev" ]; then RELEASE_TAG="dev-${RELEASE_TAG}-${CI_COMMIT_SHORT_SHA}"; fi - - "inv pipeline.trigger-child-pipeline --project-name DataDog/images --git-ref master --timeout 3600 + - "dda inv pipeline.trigger-child-pipeline --project-name DataDog/images --git-ref master --timeout 3600 --variable IMAGE_VERSION --variable IMAGE_NAME --variable RELEASE_TAG @@ -262,7 +262,7 @@ docker_trigger_internal-full: TMPL_SRC_REPO="${TMPL_SRC_REPO}-nightly" fi - if [ "$BUCKET_BRANCH" = "dev" ]; then RELEASE_TAG="dev-${RELEASE_TAG}-${CI_COMMIT_SHORT_SHA}"; fi - - "inv pipeline.trigger-child-pipeline --project-name DataDog/images --git-ref master --timeout 3600 + - "dda inv pipeline.trigger-child-pipeline --project-name DataDog/images --git-ref master --timeout 3600 --variable IMAGE_VERSION --variable IMAGE_NAME --variable RELEASE_TAG diff --git a/.gitlab/package_build/linux.yml b/.gitlab/package_build/linux.yml index 3674f949b2606..ec7bd767f1cd7 100644 --- a/.gitlab/package_build/linux.yml +++ b/.gitlab/package_build/linux.yml @@ -173,7 +173,7 @@ dogstatsd-arm64: - !reference [.cache_omnibus_ruby_deps, setup] # remove artifacts from previous pipelines that may come from the cache - rm -rf $OMNIBUS_PACKAGE_DIR/* - - inv -e omnibus.build --release-version $RELEASE_VERSION --base-dir $OMNIBUS_BASE_DIR ${USE_S3_CACHING} --skip-deps --go-mod-cache="$GOPATH/pkg/mod" --target-project otel-agent + - dda inv -e omnibus.build --release-version $RELEASE_VERSION --base-dir $OMNIBUS_BASE_DIR ${USE_S3_CACHING} --skip-deps --go-mod-cache="$GOPATH/pkg/mod" --target-project otel-agent - ls -la $OMNIBUS_PACKAGE_DIR - !reference [.upload_sbom_artifacts] variables: diff --git a/pkg/gpu/testutil/event-viewer/README.md b/pkg/gpu/testutil/event-viewer/README.md index b24de2465eec4..24808ea9139c0 100644 --- a/pkg/gpu/testutil/event-viewer/README.md +++ b/pkg/gpu/testutil/event-viewer/README.md @@ -13,6 +13,6 @@ curl --unix-socket $DD_SYSPROBE_SOCKET http://unix/gpu/debug/collect-events?coun Build and use the event viewer: ```bash -inv system-probe.build-gpu-event-viewer +dda inv system-probe.build-gpu-event-viewer pkg/gpu/testutil/event-viewer/event-viewer path-to-events-file ``` diff --git a/pkg/proto/datadog/README.md b/pkg/proto/datadog/README.md index ec4c58608fb74..023164bf40527 100644 --- a/pkg/proto/datadog/README.md +++ b/pkg/proto/datadog/README.md @@ -1,4 +1,4 @@ ## gRPC: Protobuf and Gateway code generation -1. Ensure that you have the all the tools installed in your `$PATH` by running `inv -e install-tools`. -2. To generate the code for the `.proto` files run `inv -e protobuf.generate`. +1. Ensure that you have the all the tools installed in your `$PATH` by running `dda inv -e install-tools`. +2. To generate the code for the `.proto` files run `dda inv -e protobuf.generate`. diff --git a/tasks/buildimages.py b/tasks/buildimages.py index 06ea84211ac1a..9f1cb16699576 100644 --- a/tasks/buildimages.py +++ b/tasks/buildimages.py @@ -52,9 +52,9 @@ def update_test_infra_definitions(ctx: Context, commit_sha: str, go_mod_only: bo ctx.run("go mod tidy") if not go_mod_only: - prefix_comment = """# File generated by inv buildimages.update-test-infra-definitions + prefix_comment = """# File generated by dda inv buildimages.update-test-infra-definitions # Please do not edit this file manually -# To update the test-infra-definitions version, run `inv buildimages.update-test-infra-definitions --commit-sha ` [--is-dev-image] +# To update the test-infra-definitions version, run `dda inv buildimages.update-test-infra-definitions --commit-sha ` [--is-dev-image] """ update_test_infra_def( file_path=".gitlab/common/test_infra_version.yml", diff --git a/tasks/modules.py b/tasks/modules.py index 441f03a3104eb..8070e1f488e56 100644 --- a/tasks/modules.py +++ b/tasks/modules.py @@ -331,8 +331,8 @@ def add_all_replace(ctx: Context): and no replace rule is missing. It's meant to be used as the following: - - running `inv modules.add-all-replace` to add all possible replace rules to all go.mod - - `inv tidy` to update all the go.mod + - running `dda inv modules.add-all-replace` to add all possible replace rules to all go.mod + - `dda inv tidy` to update all the go.mod This solves the problem of `go mod tidy` failing if some replace rules are missing but needing `go mod tidy` to run successfully to know which replace rules are needed. This is a major pain point when creating/moving go.mod. diff --git a/tasks/protobuf.py b/tasks/protobuf.py index a7f9fe79f316b..1c63585371373 100644 --- a/tasks/protobuf.py +++ b/tasks/protobuf.py @@ -165,14 +165,14 @@ def check_tools(ctx): """ tools = [tool.split("/")[-1] for tool in TOOL_LIST_PROTO] if not check_tools_installed(tools): - raise Exit("Please install the required tools with `inv install-tools` before running this task.", code=1) + raise Exit("Please install the required tools with `dda inv install-tools` before running this task.", code=1) try: current_version = ctx.run("protoc --version", hide=True).stdout.strip().removeprefix("libprotoc ") with open(".protoc-version") as f: expected_version = f.read().strip() if current_version != expected_version: raise Exit( - f"Expected protoc version {expected_version}, found {current_version}. Please run `inv install-protoc` before running this task.", + f"Expected protoc version {expected_version}, found {current_version}. Please run `dda inv install-protoc` before running this task.", code=1, ) except UnexpectedExit as e: diff --git a/tasks/release.py b/tasks/release.py index 5420043a7ec4c..8b4f80080ceda 100644 --- a/tasks/release.py +++ b/tasks/release.py @@ -644,7 +644,7 @@ def run_rc_pipeline(ctx, gitlab_tag, k8s_deployments=False): @task def alert_ci_on_call(ctx, release_branch): gitlab_tag = get_qualification_rc_tag(ctx, release_branch) - message = f":loudspeaker: Agent 6 Update:\nThere is an ongoing Agent 6 release and since there are no new changes there will be no RC bump this week.\n\nPlease rerun the previous build pipeline:\ninv release.run-rc-pipeline --gitlab-tag {gitlab_tag}" + message = f":loudspeaker: Agent 6 Update:\nThere is an ongoing Agent 6 release and since there are no new changes there will be no RC bump this week.\n\nPlease rerun the previous build pipeline:\ndda inv release.run-rc-pipeline --gitlab-tag {gitlab_tag}" post_message(ctx, "agent-ci-on-call", message) diff --git a/tasks/unit_tests/libs/common/check_tools_tests.py b/tasks/unit_tests/libs/common/check_tools_tests.py index f390751c2f75c..6c93f65c91112 100644 --- a/tasks/unit_tests/libs/common/check_tools_tests.py +++ b/tasks/unit_tests/libs/common/check_tools_tests.py @@ -25,7 +25,8 @@ def test_tools_not_installed(self): with self.assertRaises(Exit) as e: check_tools(c) self.assertEqual( - e.exception.message, "Please install the required tools with `inv install-tools` before running this task." + e.exception.message, + "Please install the required tools with `dda inv install-tools` before running this task.", ) @patch('tasks.protobuf.check_tools_installed', new=MagicMock(return_value=True)) diff --git a/tasks/winbuildscripts/Invoke-UnitTests.ps1 b/tasks/winbuildscripts/Invoke-UnitTests.ps1 index 8d3e2ad4254c0..3832df9bcace3 100644 --- a/tasks/winbuildscripts/Invoke-UnitTests.ps1 +++ b/tasks/winbuildscripts/Invoke-UnitTests.ps1 @@ -119,7 +119,7 @@ Invoke-BuildScript ` } # Run python-script unit tests - & inv -e invoke-unit-tests --directory=".\omnibus\python-scripts\" + & dda inv -e invoke-unit-tests --directory=".\omnibus\python-scripts\" $err = $LASTEXITCODE Write-Host Python-script test result is $err if($err -ne 0){