Skip to content

chore: add a job that check that all other jobs are green on PR #13217

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

Merged
merged 3 commits into from
Apr 22, 2025

Conversation

cbeauchesne
Copy link
Contributor

@cbeauchesne cbeauchesne commented Apr 16, 2025

Changes

  • Enable Green CI Policy on dd-trace-py
  • on label change, some check can become green -> exclude change log check, as it's already required
  • on PR check list, some PR can become green -> exclude checklist check, as it's already required
  • concurrency

This does not enforce checks on gitlab, for those, the required check on dd-gitlab/default-pipeline do the trick (eventually completed by other if needed).

Change

Added a job that verify the status of other jobs on the PR:

  • If one of those jobs is pending, running or failed, this job fails.
  • Once all jobs are finished in success, it succeed.

The next step, once we've validated it works correctly, is to make this job a requirement for merges. Side note, this solution has been implemented successfully on DataDog/dd-trace-js for one year.

I've removed Bootstrap import analysis from this check because it 20 PR has been merged with this job failing over the 195 PR on the last 60 days (success rate of 88%). Once this job is considered as healthy (or if we want to enforce it) we can remove it.

There are other jobs with a bad success rate, but they are not often included in PR, so TBD. Here are the jobs with a success rate lower than 95% :

  • 95% (104) test
  • 95% (187) dd-gitlab/check_pipeline_status
  • 93% (30) dd-gitlab/contrib::dd_trace_api 1/4
  • 93% (30) dd-gitlab/contrib::dd_trace_api 2/4
  • 93% (30) dd-gitlab/contrib::dd_trace_api 3/4
  • 93% (30) dd-gitlab/contrib::dd_trace_api 4/4
  • 92% (200) dd-gitlab/default-pipeline
  • 88% (195) Bootstrap import analysis
  • 62% (8) dd-gitlab/contrib::dd_trace_api 1/1
  • 0% (9) CircleCI Pipeline

Checklist

  • PR author has checked that all the criteria below are met
  • The PR description includes an overview of the change
  • The PR description articulates the motivation for the change
  • The change includes tests OR the PR description describes a testing strategy
  • The PR description notes risks associated with the change, if any
  • Newly-added code is easy to change
  • The change follows the library release note guidelines
  • The change includes or references documentation updates if necessary
  • Backport labels are set (if applicable)

Reviewer Checklist

  • Reviewer has checked that all the criteria below are met
  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Newly-added code is easy to change
  • Release note makes sense to a user of the library
  • If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy

Copy link
Contributor

CODEOWNERS have been resolved as:

.github/workflows/all-green.yml                                         @DataDog/python-guild @DataDog/apm-core-python

Copy link
Contributor

github-actions bot commented Apr 16, 2025

Bootstrap import analysis

Comparison of import times between this PR and base.

Summary

The average import time from this PR is: 237 ± 6 ms.

The average import time from base is: 240 ± 8 ms.

The import time difference between this PR and base is: -3.7 ± 0.3 ms.

Import time breakdown

The following import paths have shrunk:

ddtrace.auto 2.112 ms (0.89%)
ddtrace.bootstrap.sitecustomize 1.436 ms (0.61%)
ddtrace.bootstrap.preload 1.436 ms (0.61%)
ddtrace.internal.products 1.436 ms (0.61%)
ddtrace.internal.remoteconfig.client 0.661 ms (0.28%)
ddtrace 0.676 ms (0.29%)

@cbeauchesne cbeauchesne added the changelog/no-changelog A changelog entry is not required for this PR. label Apr 16, 2025
@pr-commenter
Copy link

pr-commenter bot commented Apr 16, 2025

Benchmarks

Benchmark execution time: 2025-04-22 11:11:35

Comparing candidate commit be68e39 in PR branch cbeauchesne/green-ci-policy with baseline commit 1cd1e73 in branch main.

Found 0 performance improvements and 2 performance regressions! Performance is the same for 420 metrics, 6 unstable metrics.

scenario:iast_aspects-format_map_aspect

  • 🟥 execution_time [+400.360ns; +486.055ns] or [+12.103%; +14.693%]

scenario:iast_aspects-ospathbasename_aspect

  • 🟥 execution_time [+395.421ns; +565.279ns] or [+9.586%; +13.703%]

@cbeauchesne cbeauchesne marked this pull request as ready for review April 17, 2025 10:25
@cbeauchesne cbeauchesne requested review from a team as code owners April 17, 2025 10:26
@cbeauchesne cbeauchesne enabled auto-merge (squash) April 17, 2025 11:26
@cbeauchesne cbeauchesne merged commit 1e1626a into main Apr 22, 2025
272 of 274 checks passed
@cbeauchesne cbeauchesne deleted the cbeauchesne/green-ci-policy branch April 22, 2025 11:12
brettlangdon pushed a commit that referenced this pull request May 6, 2025
## Changes 

* Enable Green CI Policy on dd-trace-py
* on label change, some check can become green -> exclude change log
check, as it's already required
* on PR check list, some PR can become green -> exclude checklist check,
as it's already required
* concurrency


This does not enforce checks on gitlab, for those, the required check on
`dd-gitlab/default-pipeline` do the trick (eventually completed by other
if needed).


## Change

Added a job that verify the status of other jobs on the PR: 

* If one of those jobs is pending, running or failed, this job fails.
* Once all jobs are finished in success, it succeed.

The next step, once we've validated it works correctly, is to make this
job a requirement for merges. Side note, this solution has been
[implemented](https://github.com/DataDog/dd-trace-js/blob/master/.github/workflows/all-green.yml)
successfully on DataDog/dd-trace-js for one year.

I've removed `Bootstrap import analysis` from this check because it 20
PR has been merged with this job failing over the 195 PR on the last 60
days (success rate of 88%). Once this job is considered as healthy (or
if we want to enforce it) we can remove it.

There are other jobs with a bad success rate, but they are not often
included in PR, so TBD. Here are the jobs with a success rate lower than
95% :

  * 95% (104) test
  * 95% (187) dd-gitlab/check_pipeline_status
  * 93% (30) dd-gitlab/contrib::dd_trace_api 1/4
  * 93% (30) dd-gitlab/contrib::dd_trace_api 2/4
  * 93% (30) dd-gitlab/contrib::dd_trace_api 3/4
  * 93% (30) dd-gitlab/contrib::dd_trace_api 4/4
  * 92% (200) dd-gitlab/default-pipeline
  * 88% (195) Bootstrap import analysis
  * 62% (8) dd-gitlab/contrib::dd_trace_api 1/1
  * 0% (9) CircleCI Pipeline


## Checklist
- [x] PR author has checked that all the criteria below are met
- The PR description includes an overview of the change
- The PR description articulates the motivation for the change
- The change includes tests OR the PR description describes a testing
strategy
- The PR description notes risks associated with the change, if any
- Newly-added code is easy to change
- The change follows the [library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
- The change includes or references documentation updates if necessary
- Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist
- [x] Reviewer has checked that all the criteria below are met 
- Title is accurate
- All changes are related to the pull request's stated goal
- Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes
- Testing strategy adequately addresses listed risks
- Newly-added code is easy to change
- Release note makes sense to a user of the library
- If necessary, author has acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment
- Backport labels are set in a manner that is consistent with the
[release branch maintenance
policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog A changelog entry is not required for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants