Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b5f49de

Browse files
ambvhugovkJelleZijlstraezio-melotti
authored
Add section on keeping CI green (#1215)
Co-authored-by: Hugo van Kemenade <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]> Co-authored-by: Ezio Melotti <[email protected]>
1 parent 1a56667 commit b5f49de

File tree

3 files changed

+52
-7
lines changed

3 files changed

+52
-7
lines changed

getting-started/git-boot-camp.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,9 +476,11 @@ You can read more about what to look for before accepting a change
476476
:ref:`here <committing>`.
477477

478478
All pull requests have required checks that need to pass before a change
479-
can be merged. At any point, a core developer can schedule an automatic merge
480-
of the change by
481-
clicking the gray ``Enable auto-merge (squash)`` button. You will find
479+
can be merged. See :ref:`"Keeping CI green" <keeping-ci-green>` for some
480+
simple things you can do to help the checks turn green.
481+
482+
At any point, a core developer can schedule an automatic merge of the change
483+
by clicking the gray ``Enable auto-merge (squash)`` button. You will find
482484
it at the bottom of the pull request page. The auto-merge will only
483485
happen if all the required checks pass, but the PR does not need to have been
484486
approved for a successful auto-merge to take place.

getting-started/pull-request-lifecycle.rst

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ Here is a quick overview of how you can contribute to CPython:
4141

4242
#. `Create Pull Request`_ on GitHub to merge a branch from your fork
4343

44-
#. Make sure the continuous integration checks on your Pull Request
45-
are green (i.e. successful)
44+
#. Make sure the :ref:`continuous integration checks on your Pull Request
45+
are green <keeping-ci-green>` (i.e. successful)
4646

4747
#. Review and address `comments on your Pull Request`_
4848

@@ -472,7 +472,7 @@ code and leave comments in the pull request or issue tracker.
472472
'merge-ready', you should always make sure the entire test suite passes.
473473

474474
Leaving a pull request review on GitHub
475-
=======================================
475+
---------------------------------------
476476

477477
When you review a pull request, you should provide additional details and context
478478
of your review process.
@@ -487,14 +487,55 @@ Instead of simply "approving" the pull request, leave comments. For example:
487487
#. Comment on what is "good" about the pull request, not just the "bad". Doing
488488
so will make it easier for the PR author to find the good in your comments.
489489

490+
#. Look at any failures in CI on the current PR. See :ref:`"Keeping CI green"
491+
<keeping-ci-green>` below for simple things you can do to help move the PR forward.
492+
490493
Dismissing review from another core developer
491-
=============================================
494+
---------------------------------------------
492495

493496
A core developer can dismiss another core developer's review if they confirmed
494497
that the requested changes have been made. When a core developer has assigned
495498
the PR to themselves, then it is a sign that they are actively looking after
496499
the PR, and their review should not be dismissed.
497500

501+
.. _keeping-ci-green:
502+
503+
Keeping continuous integration green
504+
====================================
505+
506+
Our change management workflows generally won't allow merging PRs with
507+
failures. Therefore, if you see a CI failure on a PR, have a look
508+
what it is about.
509+
510+
Usually the failure will be directly related to the changes in the current
511+
PR. If you happen to have any insight into the failure, let the author know
512+
in a review comment. CI runs sometimes generate thousands of lines of output.
513+
Even something as simple as finding the traceback and putting it in the
514+
comment will be helpful to the PR author.
515+
516+
If the failure doesn't look related to the change you're looking at, check
517+
if it's not present on the `Release Status`_ Buildbot dashboard as well.
518+
If so, that means the failure was introduced in a prior change. Using Buildbot's
519+
UI you can find which PR introduced the issue and comment that it
520+
affects other PRs.
521+
522+
If you still don't see where the failure originates from, check for
523+
a "This branch is out-of-date with the base branch" sign next to the
524+
list of executed checks. Clicking "Update branch" next to this message
525+
will merge in the latest changes from the base branch into the PR.
526+
527+
If this still doesn't help with the failure on the PR, you can try
528+
to re-run that particular failed check. Go to the red GitHub Action job,
529+
click on the "Re-run jobs" button on the top right, and select
530+
"Re-run failed jobs". The button will only be present when all other jobs
531+
finished running.
532+
533+
Re-running failed jobs shouldn't be your first instinct but it is occasionally
534+
helpful because distributed systems can have intermittent failures, and
535+
some of our unit tests are sensitive to overloaded virtual machines.
536+
If you identify such flaky behavior, look for an issue in the `issue tracker`_
537+
that describes this particular flakiness. Create a new issue if you can't
538+
find one.
498539

499540
Committing/rejecting
500541
====================
@@ -522,3 +563,4 @@ accepts your pull request.
522563

523564
.. _issue tracker: https://github.com/python/cpython/issues
524565
.. _Core Development Discourse category: https://discuss.python.org/c/core-dev/23
566+
.. _Release Status: https://buildbot.python.org/all/#/release_status

triage/triaging.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ you can help by making sure the pull request:
9494
* includes a :ref:`NEWS entry <news-entry>` (if needed)
9595
* includes the author in ``Misc/ACKS``, either already or the patch adds them
9696
* doesn't have conflicts with the ``main`` branch
97+
* :ref:`doesn't have failing CI checks <keeping-ci-green>`
9798

9899
Doing all of this allows core developers and :ref:`triagers <triage-team>`
99100
to more quickly look for subtle issues that only people with extensive

0 commit comments

Comments
 (0)