From 1f69224865e3085d258ab1ea3386b01ab6f2e6bc Mon Sep 17 00:00:00 2001 From: Charles de Beauchesne Date: Tue, 29 Apr 2025 14:55:00 +0200 Subject: [PATCH 1/9] Use ensure-ci-success for all-green gatekeeper --- .github/workflows/ci.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d562ffbda0f..9f2f880e537 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,7 @@ on: types: - opened - synchronize + - reopened - labeled - unlabeled # push: @@ -116,6 +117,9 @@ jobs: all-jobs-are-green: # if this must be renamed, you need to update utils/scripts/get-workflow-summary.py name: All jobs are green runs-on: ubuntu-latest + permissions: + checks: read + statuses: read needs: - system_tests if: '!cancelled()' @@ -128,9 +132,13 @@ jobs: - run: python utils/scripts/get-workflow-summary.py DataDog/system-tests ${{ github.run_id }} -o $GITHUB_STEP_SUMMARY env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Fail if any job failed - if: needs.system_tests.result != 'success' - run: exit 1 + - uses: DataDog/ensure-ci-success@v1 + with: + polling-interval-seconds: '60' + max-retries: '60' + # initial-delay-seconds: '0' + ignored-name-patterns: | + dd-gitlab/.* update-CI-visibility: name: Update CI Visibility Dashboard From 6d45af0d44953861591e1224f4e4cc665d5a0010 Mon Sep 17 00:00:00 2001 From: Charles de Beauchesne Date: Tue, 29 Apr 2025 19:17:53 +0200 Subject: [PATCH 2/9] dummy --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f2f880e537..7c9b63165ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -127,7 +127,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.12' - run: pip install requests - run: python utils/scripts/get-workflow-summary.py DataDog/system-tests ${{ github.run_id }} -o $GITHUB_STEP_SUMMARY env: From 6e18ed9e7f1185f2b15bc96755709d4251f7a1ec Mon Sep 17 00:00:00 2001 From: Charles de Beauchesne Date: Tue, 29 Apr 2025 20:08:57 +0200 Subject: [PATCH 3/9] Another dummy --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c9b63165ac..8103b8d2dc5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -120,6 +120,7 @@ jobs: permissions: checks: read statuses: read + actions: read needs: - system_tests if: '!cancelled()' From a910616d1fd0d50ff26c9159fe83305e7ea8d7b6 Mon Sep 17 00:00:00 2001 From: Charles de Beauchesne Date: Fri, 2 May 2025 11:40:11 +0200 Subject: [PATCH 4/9] test --- .github/workflows/ci.yml | 25 ++++++++++++++++++++++--- utils/scripts/get-workflow-summary.py | 2 ++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8103b8d2dc5..2a6f337414a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,8 +84,8 @@ jobs: secrets: inherit with: library: ${{ matrix.library }} - scenarios: ${{ needs.scenarios.outputs.scenarios }} - scenarios_groups: ${{ needs.scenarios.outputs.scenarios_groups }} + scenarios: DEFAULT + # scenarios_groups: ${{ needs.scenarios.outputs.scenarios_groups }} build_python_base_images: ${{ contains(github.event.pull_request.labels.*.name, 'build-python-base-images') }} build_buddies_images: ${{ contains(github.event.pull_request.labels.*.name, 'build-buddies-images') }} build_proxy_image: ${{ contains(github.event.pull_request.labels.*.name, 'build-proxy-image') }} @@ -133,14 +133,33 @@ jobs: - run: python utils/scripts/get-workflow-summary.py DataDog/system-tests ${{ github.run_id }} -o $GITHUB_STEP_SUMMARY env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: DataDog/ensure-ci-success@v1 + + - uses: wechuli/allcheckspassed@v1 + if: always() + with: + checks_exclude: 'dd-gitlab/.*' + + - uses: DataDog/ensure-ci-success@v0 + if: always() + with: + polling-interval-seconds: '60' + max-retries: '60' + # initial-delay-seconds: '0' + ignored-name-patterns: | + dd-gitlab/.* + + - uses: DataDog/ensure-ci-success@v0 + if: always() with: + github-token: ${{ secrets.GITHUB_TOKEN }} polling-interval-seconds: '60' max-retries: '60' # initial-delay-seconds: '0' ignored-name-patterns: | dd-gitlab/.* + + update-CI-visibility: name: Update CI Visibility Dashboard runs-on: ubuntu-latest diff --git a/utils/scripts/get-workflow-summary.py b/utils/scripts/get-workflow-summary.py index b471c250c93..e92bdda8cc4 100644 --- a/utils/scripts/get-workflow-summary.py +++ b/utils/scripts/get-workflow-summary.py @@ -33,6 +33,8 @@ def get_jobs(session: requests.Session, repo_slug: str, run_id: int) -> list: jobs += items params["page"] += 1 + logging.info(f"Found {len(jobs)} jobs") + return jobs From 1ee9dba8eabf0a47909a4aa3070777908f9a29a0 Mon Sep 17 00:00:00 2001 From: Charles de Beauchesne Date: Fri, 2 May 2025 11:44:58 +0200 Subject: [PATCH 5/9] dummy --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a6f337414a..0041b0206fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,7 +85,7 @@ jobs: with: library: ${{ matrix.library }} scenarios: DEFAULT - # scenarios_groups: ${{ needs.scenarios.outputs.scenarios_groups }} + # scenarios_groups: ${{ needs.scenarios.outputs.scenarios_groups }} build_python_base_images: ${{ contains(github.event.pull_request.labels.*.name, 'build-python-base-images') }} build_buddies_images: ${{ contains(github.event.pull_request.labels.*.name, 'build-buddies-images') }} build_proxy_image: ${{ contains(github.event.pull_request.labels.*.name, 'build-proxy-image') }} From 6c09a91a1cef2c2bb73c1d3a507d3427e82c68d0 Mon Sep 17 00:00:00 2001 From: Charles de Beauchesne Date: Fri, 2 May 2025 13:22:36 +0200 Subject: [PATCH 6/9] Do not set job name --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0041b0206fc..846488f906c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,7 +115,6 @@ jobs: secrets: inherit all-jobs-are-green: # if this must be renamed, you need to update utils/scripts/get-workflow-summary.py - name: All jobs are green runs-on: ubuntu-latest permissions: checks: read From 528a0765eb5da06fa2a31036b84d2d3a592669fc Mon Sep 17 00:00:00 2001 From: Charles de Beauchesne Date: Fri, 2 May 2025 14:42:32 +0200 Subject: [PATCH 7/9] all jobs --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 846488f906c..0e2fc57f641 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,8 +84,8 @@ jobs: secrets: inherit with: library: ${{ matrix.library }} - scenarios: DEFAULT - # scenarios_groups: ${{ needs.scenarios.outputs.scenarios_groups }} + scenarios: ${{ needs.scenarios.outputs.scenarios }} + scenarios_groups: ${{ needs.scenarios.outputs.scenarios_groups }} build_python_base_images: ${{ contains(github.event.pull_request.labels.*.name, 'build-python-base-images') }} build_buddies_images: ${{ contains(github.event.pull_request.labels.*.name, 'build-buddies-images') }} build_proxy_image: ${{ contains(github.event.pull_request.labels.*.name, 'build-proxy-image') }} From 650f31b51d56109c72ba9b82dfbc7ea9942ff1f3 Mon Sep 17 00:00:00 2001 From: Charles de Beauchesne Date: Fri, 2 May 2025 18:12:17 +0200 Subject: [PATCH 8/9] good order for the test --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e2fc57f641..44788ded778 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -133,20 +133,20 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: wechuli/allcheckspassed@v1 - if: always() - with: - checks_exclude: 'dd-gitlab/.*' - - uses: DataDog/ensure-ci-success@v0 if: always() with: + # initial-delay-seconds: '0' polling-interval-seconds: '60' max-retries: '60' - # initial-delay-seconds: '0' ignored-name-patterns: | dd-gitlab/.* + - uses: wechuli/allcheckspassed@v1 + if: always() + with: + checks_exclude: 'dd-gitlab/.*' + - uses: DataDog/ensure-ci-success@v0 if: always() with: From 670acbbe89bd108cd47d9008bf462de93eea7c0e Mon Sep 17 00:00:00 2001 From: Charles de Beauchesne Date: Mon, 5 May 2025 10:03:22 +0200 Subject: [PATCH 9/9] Final version --- .github/workflows/ci.yml | 38 ++++++++++++--------------- utils/scripts/get-workflow-summary.py | 2 +- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44788ded778..41f8443260b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,7 +114,8 @@ jobs: uses: ./.github/workflows/run-exotics.yml secrets: inherit - all-jobs-are-green: # if this must be renamed, you need to update utils/scripts/get-workflow-summary.py + all-jobs-are-green-legacy: # if this must be renamed, you need to update utils/scripts/get-workflow-summary.py + name: All jobs are green runs-on: ubuntu-latest permissions: checks: read @@ -132,33 +133,28 @@ jobs: - run: python utils/scripts/get-workflow-summary.py DataDog/system-tests ${{ github.run_id }} -o $GITHUB_STEP_SUMMARY env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Fail if any job failed + if: needs.system_tests.result != 'success' + run: exit 1 + all-jobs-are-green: # if this must be renamed, you need to update utils/scripts/get-workflow-summary.py + # name: All jobs are green # DO NOT SET A NAME + runs-on: ubuntu-latest + permissions: + checks: read + statuses: read + actions: read + needs: + - system_tests + if: '!cancelled()' + steps: - uses: DataDog/ensure-ci-success@v0 - if: always() - with: - # initial-delay-seconds: '0' - polling-interval-seconds: '60' - max-retries: '60' - ignored-name-patterns: | - dd-gitlab/.* - - - uses: wechuli/allcheckspassed@v1 - if: always() - with: - checks_exclude: 'dd-gitlab/.*' - - - uses: DataDog/ensure-ci-success@v0 - if: always() with: - github-token: ${{ secrets.GITHUB_TOKEN }} - polling-interval-seconds: '60' + polling-interval-seconds: '30' max-retries: '60' - # initial-delay-seconds: '0' ignored-name-patterns: | dd-gitlab/.* - - update-CI-visibility: name: Update CI Visibility Dashboard runs-on: ubuntu-latest diff --git a/utils/scripts/get-workflow-summary.py b/utils/scripts/get-workflow-summary.py index e92bdda8cc4..f6f9fc55a27 100644 --- a/utils/scripts/get-workflow-summary.py +++ b/utils/scripts/get-workflow-summary.py @@ -53,7 +53,7 @@ def main(repo_slug: str, run_id: int, output: str) -> None: failing_steps = defaultdict(list) for job in jobs: - if job["name"] in ("all-jobs-are-green", "fancy-report", "All jobs are green"): + if job["name"] in ("all-jobs-are-green", "fancy-report", "All jobs are green", "all-jobs-are-green-legacy"): logging.info(f"Skipping job {job['name']}") continue