From 8e6d275a08f458925d7a4ca631e817e78addeafd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= Date: Tue, 14 Nov 2023 14:14:38 +0100 Subject: [PATCH 1/4] tasks: github: allow github workflows without artifacts --- tasks/github_tasks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/github_tasks.py b/tasks/github_tasks.py index 26832abda6927a..644823348570b8 100644 --- a/tasks/github_tasks.py +++ b/tasks/github_tasks.py @@ -29,7 +29,8 @@ def _trigger_macos_workflow(release, destination, retry_download, retry_interval print_workflow_conclusion(workflow_conclusion, workflow_url) - download_with_retry(download_artifacts, run, destination, retry_download, retry_interval) + if destination: + download_with_retry(download_artifacts, run, destination, retry_download, retry_interval) if workflow_conclusion != "success": raise Exit(code=1) From 11b5416f4b97962d0277d36ba8e518c57d62a01a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= Date: Tue, 14 Nov 2023 14:15:00 +0100 Subject: [PATCH 2/4] tasks: github: provide a task to run macOS lint --- tasks/github_tasks.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tasks/github_tasks.py b/tasks/github_tasks.py index 644823348570b8..e7727587ab022f 100644 --- a/tasks/github_tasks.py +++ b/tasks/github_tasks.py @@ -92,6 +92,26 @@ def trigger_macos_test( ) +@task +def trigger_macos_lint( + _, + datadog_agent_ref=DEFAULT_BRANCH, + release_version="nightly-a7", + python_runtimes="3", + version_cache=None, +): + _trigger_macos_workflow( + release_version, + None, + 0, + 0, + workflow_name="lint.yaml", + datadog_agent_ref=datadog_agent_ref, + python_runtimes=python_runtimes, + version_cache_file_content=version_cache, + ) + + @task def lint_codeowner(_): """ From 721e76a9038ef4ea2a04a85d95385e226ef3eb64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= Date: Tue, 14 Nov 2023 14:17:56 +0100 Subject: [PATCH 3/4] CI: run macOS lint in a dedicated job [APL-2393] --- .gitlab/source_test/macos.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.gitlab/source_test/macos.yml b/.gitlab/source_test/macos.yml index d20acf5ffb6f02..efe673b5da86ea 100644 --- a/.gitlab/source_test/macos.yml +++ b/.gitlab/source_test/macos.yml @@ -27,3 +27,22 @@ tests_macos: - junit-*-repacked.tgz reports: junit: "**/junit-out-*.xml" + +lint_macos: + stage: source_test + rules: + !reference [.on_a6] + 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"] + variables: + PYTHON_RUNTIMES: '3' + script: + - source /root/.bashrc + - export GITHUB_KEY_B64=$(aws ssm get-parameter --region us-east-1 --name ci.datadog-agent.macos_github_key_b64 --with-decryption --query "Parameter.Value" --out text) + - export GITHUB_APP_ID=$(aws ssm get-parameter --region us-east-1 --name ci.datadog-agent.macos_github_app_id --with-decryption --query "Parameter.Value" --out text) + - export GITHUB_INSTALLATION_ID=$(aws ssm get-parameter --region us-east-1 --name ci.datadog-agent.macos_github_installation_id --with-decryption --query "Parameter.Value" --out text) + - $S3_CP_CMD $S3_ARTIFACTS_URI/agent-version.cache . + - export VERSION_CACHE_CONTENT=$(cat agent-version.cache | base64 -) + - !reference [.setup_python_mirror_linux] + - python3 -m pip install -r tasks/libs/requirements-github.txt + - inv -e github.trigger-macos-lint --datadog-agent-ref "$CI_COMMIT_SHA" --python-runtimes "$PYTHON_RUNTIMES" --version-cache "$VERSION_CACHE_CONTENT" From d6d2b6419cb683e77e66a82df8a061fd68b7bc34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= Date: Wed, 15 Nov 2023 14:51:23 +0100 Subject: [PATCH 4/4] apply review comments --- tasks/github_tasks.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tasks/github_tasks.py b/tasks/github_tasks.py index e7727587ab022f..e2a7815ebbfff5 100644 --- a/tasks/github_tasks.py +++ b/tasks/github_tasks.py @@ -14,7 +14,7 @@ from .utils import DEFAULT_BRANCH -def _trigger_macos_workflow(release, destination, retry_download, retry_interval, **kwargs): +def _trigger_macos_workflow(release, destination=None, retry_download=0, retry_interval=0, **kwargs): github_action_ref = _get_release_json_value(f'{release}::MACOS_BUILD_VERSION') run = trigger_macos_workflow( @@ -102,9 +102,6 @@ def trigger_macos_lint( ): _trigger_macos_workflow( release_version, - None, - 0, - 0, workflow_name="lint.yaml", datadog_agent_ref=datadog_agent_ref, python_runtimes=python_runtimes,