Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lint): Add the gitlab linter to agent6 #30713

Merged
merged 4 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 51 additions & 41 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
---
include:
- /.gitlab/.pre/cancel-prev-pipelines.yml
- /.gitlab/benchmarks/include.yml
- /.gitlab/binary_build/include.yml
- /.gitlab/check_deploy/check_deploy.yml
- /.gitlab/check_merge/do_not_merge.yml
- /.gitlab/choco_build/choco_build.yml
- /.gitlab/choco_deploy/choco_deploy.yml
- /.gitlab/common/shared.yml
- /.gitlab/common/pr_commenter.yml
- /.gitlab/container_build/include.yml
- /.gitlab/container_scan/container_scan.yml
- /.gitlab/deploy_containers/deploy_containers.yml
- /.gitlab/deploy_cws_instrumentation/deploy_cws_instrumentation.yml
- /.gitlab/deploy_dca/deploy_dca.yml
- /.gitlab/deploy_packages/include.yml
- /.gitlab/deps_build/deps_build.yml
- /.gitlab/deps_fetch/deps_fetch.yml
- /.gitlab/dev_container_deploy/include.yml
- /.gitlab/e2e/e2e.yml
- /.gitlab/e2e_pre_test/e2e_pre_test.yml
- /.gitlab/functional_test/include.yml
- /.gitlab/functional_test_cleanup/functional_test_cleanup.yml
- /.gitlab/install_script_testing/install_script_testing.yml
- /.gitlab/integration_test/include.yml
- /.gitlab/internal_image_deploy/internal_image_deploy.yml
- /.gitlab/internal_kubernetes_deploy/include.yml
- /.gitlab/junit_upload/junit_upload.yml
- /.gitlab/kitchen_cleanup/include.yml
- /.gitlab/kitchen_deploy/kitchen_deploy.yml
- /.gitlab/kitchen_testing/include.yml
- /.gitlab/maintenance_jobs/include.yml
- /.gitlab/notify/notify.yml
- /.gitlab/package_build/include.yml
- /.gitlab/packaging/include.yml
- /.gitlab/package_deps_build/package_deps_build.yml
- /.gitlab/pkg_metrics/pkg_metrics.yml
- /.gitlab/post_rc_build/post_rc_tasks.yml
- /.gitlab/setup/setup.yml
- /.gitlab/software_composition_analysis/software_composition_analysis.yml
- /.gitlab/source_test/include.yml
- /.gitlab/trigger_release/trigger_release.yml
- .gitlab/.pre/cancel-prev-pipelines.yml
- .gitlab/.pre/test_gitlab_configuration.yml
- .gitlab/benchmarks/include.yml
- .gitlab/binary_build/include.yml
- .gitlab/check_deploy/check_deploy.yml
- .gitlab/check_merge/do_not_merge.yml
- .gitlab/choco_build/choco_build.yml
- .gitlab/choco_deploy/choco_deploy.yml
- .gitlab/common/shared.yml
- .gitlab/common/pr_commenter.yml
- .gitlab/container_build/include.yml
- .gitlab/container_scan/container_scan.yml
- .gitlab/deploy_containers/deploy_containers.yml
- .gitlab/deploy_cws_instrumentation/deploy_cws_instrumentation.yml
- .gitlab/deploy_dca/deploy_dca.yml
- .gitlab/deploy_packages/include.yml
- .gitlab/deps_build/deps_build.yml
- .gitlab/deps_fetch/deps_fetch.yml
- .gitlab/dev_container_deploy/include.yml
- .gitlab/e2e/e2e.yml
- .gitlab/e2e_pre_test/e2e_pre_test.yml
- .gitlab/functional_test/include.yml
- .gitlab/functional_test_cleanup/functional_test_cleanup.yml
- .gitlab/install_script_testing/install_script_testing.yml
- .gitlab/integration_test/include.yml
- .gitlab/internal_image_deploy/internal_image_deploy.yml
- .gitlab/internal_kubernetes_deploy/include.yml
- .gitlab/junit_upload/junit_upload.yml
- .gitlab/kitchen_cleanup/include.yml
- .gitlab/kitchen_deploy/kitchen_deploy.yml
- .gitlab/kitchen_testing/include.yml
- .gitlab/maintenance_jobs/include.yml
- .gitlab/notify/notify.yml
- .gitlab/package_build/include.yml
- .gitlab/packaging/include.yml
- .gitlab/package_deps_build/package_deps_build.yml
- .gitlab/pkg_metrics/pkg_metrics.yml
- .gitlab/post_rc_build/post_rc_tasks.yml
- .gitlab/setup/setup.yml
- .gitlab/software_composition_analysis/software_composition_analysis.yml
- .gitlab/source_test/include.yml
- .gitlab/trigger_release/trigger_release.yml

default:
retry:
Expand Down Expand Up @@ -1440,3 +1441,12 @@ workflow:
FAST_TESTS: "false"
- variables:
FAST_TESTS: "true"

.on_gitlab_changes:
- !reference [.except_mergequeue]
- changes:
paths:
- .gitlab-ci.yml
- .gitlab/**/*
compare_to: main # TODO: use a variable, when this is supported https://gitlab.com/gitlab-org/gitlab/-/issues/369916

10 changes: 10 additions & 0 deletions .gitlab/.pre/test_gitlab_configuration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
test_gitlab_configuration:
stage: .pre
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
tags: ["arch:amd64"]
rules:
- !reference [.on_gitlab_changes]
script:
- source /root/.bashrc
- export GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/aws_ssm_get_wrapper.sh $GITLAB_SCHEDULER_TOKEN_SSM_NAME)
- inv lint-gitlab
4 changes: 2 additions & 2 deletions .gitlab/benchmarks/include.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
# Contains jobs to benchmark the Agent.

include:
- /.gitlab/benchmarks/benchmarks.yml
- /.gitlab/benchmarks/macrobenchmarks.yml
- .gitlab/benchmarks/benchmarks.yml
- .gitlab/benchmarks/macrobenchmarks.yml
16 changes: 8 additions & 8 deletions .gitlab/binary_build/include.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# Contains jobs which build various go binaries (dogstatsd, IoT agent, cluster-agent, cluster-agent-cloudfoundry).

include:
- /.gitlab/binary_build/cluster_agent_cloudfoundry.yml
- /.gitlab/binary_build/cluster_agent.yml
- /.gitlab/binary_build/cws_instrumentation.yml
- /.gitlab/binary_build/fakeintake.yml
- /.gitlab/binary_build/linux.yml
- /.gitlab/binary_build/system_probe.yml
- /.gitlab/binary_build/windows.yml
- /.gitlab/binary_build/serverless.yml
- .gitlab/binary_build/cluster_agent_cloudfoundry.yml
- .gitlab/binary_build/cluster_agent.yml
- .gitlab/binary_build/cws_instrumentation.yml
- .gitlab/binary_build/fakeintake.yml
- .gitlab/binary_build/linux.yml
- .gitlab/binary_build/system_probe.yml
- .gitlab/binary_build/windows.yml
- .gitlab/binary_build/serverless.yml
4 changes: 2 additions & 2 deletions .gitlab/container_build/docker_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,5 @@
SERVERCORE: "-servercore"

include:
- /.gitlab/container_build/docker_windows_agent6.yml
- /.gitlab/container_build/docker_windows_agent7.yml
- .gitlab/container_build/docker_windows_agent6.yml
- .gitlab/container_build/docker_windows_agent7.yml
6 changes: 3 additions & 3 deletions .gitlab/container_build/include.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
# Contains jobs to build container images of the Agent.

include:
- /.gitlab/container_build/docker_linux.yml
- /.gitlab/container_build/docker_windows.yml
- /.gitlab/container_build/fakeintake.yml
- .gitlab/container_build/docker_linux.yml
- .gitlab/container_build/docker_windows.yml
- .gitlab/container_build/fakeintake.yml
4 changes: 2 additions & 2 deletions .gitlab/deploy_containers/deploy_containers_a6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ stages:
- deploy_containers

include:
- /.gitlab/common/container_publish_job_templates.yml
- /.gitlab/deploy_containers/conditions.yml
- .gitlab/common/container_publish_job_templates.yml
- .gitlab/deploy_containers/conditions.yml

#
# Image tagging & manifest publication
Expand Down
4 changes: 2 additions & 2 deletions .gitlab/deploy_containers/deploy_containers_a7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ stages:
- deploy_containers

include:
- /.gitlab/common/container_publish_job_templates.yml
- /.gitlab/deploy_containers/conditions.yml
- .gitlab/common/container_publish_job_templates.yml
- .gitlab/deploy_containers/conditions.yml

#
# Image tagging & manifest publication
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
include:
- /.gitlab/common/container_publish_job_templates.yml
- .gitlab/common/container_publish_job_templates.yml

#
# CWS Instrumentation image tagging & manifest publication
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/deploy_dca/deploy_dca.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
include:
- /.gitlab/common/container_publish_job_templates.yml
- .gitlab/common/container_publish_job_templates.yml

#
# DCA image tagging & manifest publication
Expand Down
10 changes: 5 additions & 5 deletions .gitlab/deploy_packages/include.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# start as soon as possible.

include:
- /.gitlab/deploy_packages/cluster_agent_cloudfoundry.yml
- /.gitlab/deploy_packages/deploy_common.yml
- /.gitlab/deploy_packages/nix.yml
- /.gitlab/deploy_packages/windows.yml
- /.gitlab/deploy_packages/winget.yml
- .gitlab/deploy_packages/cluster_agent_cloudfoundry.yml
- .gitlab/deploy_packages/deploy_common.yml
- .gitlab/deploy_packages/nix.yml
- .gitlab/deploy_packages/windows.yml
- .gitlab/deploy_packages/winget.yml
2 changes: 1 addition & 1 deletion .gitlab/dev_container_deploy/docker_linux.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
include:
- /.gitlab/common/container_publish_job_templates.yml
- .gitlab/common/container_publish_job_templates.yml

dev_branch-a6:
extends: .docker_publish_job_definition
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/dev_container_deploy/docker_windows.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
include:
- /.gitlab/common/container_publish_job_templates.yml
- .gitlab/common/container_publish_job_templates.yml

dev_branch-a7-windows:
extends: .docker_publish_job_definition
Expand Down
6 changes: 3 additions & 3 deletions .gitlab/dev_container_deploy/include.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
# (in the datadog/agent-dev | datadog/dogstatsd-dev Dockerhub repos).

include:
- /.gitlab/dev_container_deploy/docker_linux.yml
- /.gitlab/dev_container_deploy/docker_windows.yml
- /.gitlab/dev_container_deploy/fakeintake.yml
- .gitlab/dev_container_deploy/docker_linux.yml
- .gitlab/dev_container_deploy/docker_windows.yml
- .gitlab/dev_container_deploy/fakeintake.yml
2 changes: 1 addition & 1 deletion .gitlab/functional_test/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# For now, the workaround is to include "common" files once in the top-level .gitlab-ci.yml file
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/28987
# include:
# - /.gitlab/kitchen_testing/testing.yml
# - .gitlab/kitchen_testing/testing.yml

.kitchen_test_system_probe:
extends:
Expand Down
20 changes: 10 additions & 10 deletions .gitlab/functional_test/include.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
# Contains jobs which run kitchen tests on the security-agent and on system-probe

include:
- /.gitlab/functional_test/common.yml
- /.gitlab/functional_test/security_agent.yml
- /.gitlab/functional_test/serverless.yml
- /.gitlab/functional_test/regression_detector.yml
- /.gitlab/functional_test/workload_checks.yml
- /.gitlab/functional_test/system_probe_windows.yml
- /.gitlab/kernel_matrix_testing/common.yml
- /.gitlab/kernel_matrix_testing/system_probe.yml
- /.gitlab/kernel_matrix_testing/security_agent.yml
- /.gitlab/functional_test_sysprobe/system_probe.yml
- .gitlab/functional_test/common.yml
- .gitlab/functional_test/security_agent.yml
- .gitlab/functional_test/serverless.yml
- .gitlab/functional_test/regression_detector.yml
- .gitlab/functional_test/workload_checks.yml
- .gitlab/functional_test/system_probe_windows.yml
- .gitlab/kernel_matrix_testing/common.yml
- .gitlab/kernel_matrix_testing/system_probe.yml
- .gitlab/kernel_matrix_testing/security_agent.yml
- .gitlab/functional_test_sysprobe/system_probe.yml
2 changes: 1 addition & 1 deletion .gitlab/functional_test/security_agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# For now, the workaround is to include "common" files once in the top-level .gitlab-ci.yml file
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/28987
# include:
# - /.gitlab/kitchen_testing/testing.yml
# - .gitlab/kitchen_testing/testing.yml

# Expect warning: github.com/DataDog/datadog-agent/pkg/config.LoadCustom:1501 Unknown environment variable: DD_SYSTEM_PROBE_BPF_DIR
.kitchen_test_security_agent_linux:
Expand Down
4 changes: 2 additions & 2 deletions .gitlab/functional_test/system_probe_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# For now, the workaround is to include "common" files once in the top-level .gitlab-ci.yml file
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/28987
# include:
# - /.gitlab/kitchen_testing/testing.yml
# - /.gitlab/functional_test/common.yml
# - .gitlab/kitchen_testing/testing.yml
# - .gitlab/functional_test/common.yml

kitchen_test_system_probe_windows_x64:
extends:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# For now, the workaround is to include "common" files once in the top-level .gitlab-ci.yml file
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/28987
# include:
# - /.gitlab/kitchen_common/cleanup.yml
# - .gitlab/kitchen_common/cleanup.yml

cleanup_kitchen_functional_test:
extends: .kitchen_cleanup_azure_common
Expand Down
4 changes: 2 additions & 2 deletions .gitlab/functional_test_sysprobe/system_probe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# For now, the workaround is to include "common" files once in the top-level .gitlab-ci.yml file
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/28987
# include:
# - /.gitlab/kitchen_testing/testing.yml
# - /.gitlab/functional_test/common.yml
# - .gitlab/kitchen_testing/testing.yml
# - .gitlab/functional_test/common.yml

.kitchen_test_system_probe_linux:
extends:
Expand Down
4 changes: 2 additions & 2 deletions .gitlab/integration_test/include.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
# Contains jobs to run integration tests in go binaries

include:
- /.gitlab/integration_test/dogstatsd.yml
- /.gitlab/integration_test/windows.yml
- .gitlab/integration_test/dogstatsd.yml
- .gitlab/integration_test/windows.yml
4 changes: 2 additions & 2 deletions .gitlab/internal_kubernetes_deploy/include.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
# Contains jobs to trigger a pipeline in our k8s-datadog-agent-ops repo

include:
- /.gitlab/internal_kubernetes_deploy/internal_kubernetes_deploy.yml
- /.gitlab/internal_kubernetes_deploy/rc_kubernetes_deploy.yml
- .gitlab/internal_kubernetes_deploy/internal_kubernetes_deploy.yml
- .gitlab/internal_kubernetes_deploy/rc_kubernetes_deploy.yml
4 changes: 2 additions & 2 deletions .gitlab/kitchen_cleanup/include.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# kitchen_cleanup stage
# Include file for jobs which clean up kitchen resources created for Agent kitchen tests.
include:
- /.gitlab/kitchen_cleanup/cleanup.yml
- /.gitlab/kitchen_cleanup/kitchen_cleanup.yml
- .gitlab/kitchen_cleanup/cleanup.yml
- .gitlab/kitchen_cleanup/kitchen_cleanup.yml
2 changes: 1 addition & 1 deletion .gitlab/kitchen_cleanup/kitchen_cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# For now, the workaround is to include "common" files once in the top-level .gitlab-ci.yml file
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/28987
# include:
# - /.gitlab/kitchen_common/cleanup.yml
# - .gitlab/kitchen_common/cleanup.yml

kitchen_cleanup_azure-a6:
extends: .kitchen_cleanup_azure_common
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/kitchen_testing/centos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# For now, the workaround is to include "common" files once in the top-level .gitlab-ci.yml file
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/28987
# include:
# - /.gitlab/kitchen_testing/testing.yml
# - .gitlab/kitchen_testing/testing.yml

# Kitchen: OSes
# -------------
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/kitchen_testing/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# For now, the workaround is to include "common" files once in the top-level .gitlab-ci.yml file
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/28987
# include:
# - /.gitlab/kitchen_testing/testing.yml
# - .gitlab/kitchen_testing/testing.yml

# Kitchen: OSes
# -------------
Expand Down
16 changes: 8 additions & 8 deletions .gitlab/kitchen_testing/include.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# Contains jobs which run kitchen tests on the Agent packages.

include:
- /.gitlab/kitchen_testing/centos.yml
- /.gitlab/kitchen_testing/debian.yml
- /.gitlab/kitchen_testing/new-e2e_testing.yml
- /.gitlab/kitchen_testing/new-e2e_testing/include.yml
- /.gitlab/kitchen_testing/suse.yml
- /.gitlab/kitchen_testing/testing.yml
- /.gitlab/kitchen_testing/ubuntu.yml
- /.gitlab/kitchen_testing/windows.yml
- .gitlab/kitchen_testing/centos.yml
- .gitlab/kitchen_testing/debian.yml
- .gitlab/kitchen_testing/new-e2e_testing.yml
- .gitlab/kitchen_testing/new-e2e_testing/include.yml
- .gitlab/kitchen_testing/suse.yml
- .gitlab/kitchen_testing/testing.yml
- .gitlab/kitchen_testing/ubuntu.yml
- .gitlab/kitchen_testing/windows.yml
Loading
Loading