Skip to content

Commit 844eb48

Browse files
CarinaFodrammock
andauthored
add CI description to contributing guide (#13837)
Co-authored-by: Daniel McCloy <dan@mccloy.info>
1 parent 3455d64 commit 844eb48

2 files changed

Lines changed: 47 additions & 11 deletions

File tree

doc/development/contributing.rst

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -661,17 +661,49 @@ change, and append additional PR numbers in parentheticals with the ``:gh:`` rol
661661
662662
Short description of the changes, by `Firstname Lastname`_. (:gh:`12346`)
663663
664-
Test locally before opening pull requests (PRs)
665-
-----------------------------------------------
666-
667-
MNE-Python uses `continuous integration`_ (CI) to ensure code quality and
668-
test across multiple installation targets. However, the CIs are often slower
669-
than testing locally, especially when other contributors also have open PRs
670-
(which is basically always the case). Therefore, do not rely on the CIs to
671-
catch bugs and style errors for you; :ref:`run the tests locally <run-tests>`
664+
Continuous integration (CI) and local testing before opening a PR
665+
-----------------------------------------------------------------
666+
667+
Continuous integration (CI) uses automated systems to run tests and checks on your code
668+
whenever you open or update a pull request.
669+
MNE-Python uses `continuous integration`_ (CI) to ensure code quality,
670+
test across multiple platforms, and automatically validate pull requests.
671+
However, CI runs are slower than testing locally and some of them cost money to run.
672+
Therefore, *do not rely on the CIs to catch bugs and style errors for you*;
673+
:ref:`run the tests locally <run-tests>`
672674
instead before opening a new PR and before each time you push additional
673675
changes to an already-open PR.
674676

677+
MNE-Python uses the following CI services:
678+
679+
- `GitHub Actions`_ and `Azure`_ for testing code across platforms
680+
- `CodeCov`_ checks how much of the code is tested
681+
- `CircleCI`_ for building the documentation
682+
683+
If you are contributing for the first time, you may notice that `Github Actions`_
684+
jobs do not start automatically, or appear as "pending".
685+
This is expected behavior. Github Actions requires **manual approval from a
686+
maintainer** before running jobs submitted by new contributors. This is a
687+
security measure to prevent misuse of CI resources.
688+
689+
As a result:
690+
691+
- Github Actions jobs may remain in a *pending* or *not running* state
692+
- This does **not** indicate a problem with your code
693+
694+
Once you have at least one PR merged into the MNE-Python repository, future
695+
contributions will not require manual approval.
696+
697+
`CircleCI`_ will not build the documentation unless the GitHub account of the PR's most recent commit
698+
is associated with a CircleCI account. Creating one is easy and free,
699+
choose "login with GitHub" on `CircleCI`_ to get started.
700+
If you do not do this, it will show up as a failing CI job.
701+
702+
Before opening or updating a PR, check locally:
703+
704+
- that all tests pass (see :ref:`run-tests`)
705+
- the documentation is built without errors if your changes affect it (see :ref:`build-docs`)
706+
- style checks pass (see :ref:`code-style`)
675707

676708
Make tests fast and thorough
677709
----------------------------
@@ -1108,11 +1140,12 @@ it can serve as a useful example of what to expect from the PR review process.
11081140
11091141
.. _miniconda: https://conda.io/en/latest/miniconda.html
11101142
.. _Spyder: https://www.spyder-ide.org/
1111-
.. _continuous integration: https://en.wikipedia.org/wiki/Continuous_integration
1143+
.. _continuous integration: https://about.gitlab.com/topics/ci-cd/
11121144
.. _matplotlib: https://matplotlib.org/
11131145
.. _github actions: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions
11141146
.. _azure: https://dev.azure.com/mne-tools/mne-python/_build/latest?definitionId=1&branchName=main
11151147
.. _CircleCI: https://circleci.com/gh/mne-tools/mne-python
1148+
.. _CodeCov: https://about.codecov.io/
11161149

11171150
.. optipng
11181151

doc/development/index.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,17 @@ please consider posting your questions on our `MNE Forum`_.
1717
Users and contributors to MNE-Python are expected to follow our
1818
`code of conduct`_.
1919

20-
The `contributing guide`_ has details on the preferred contribution workflow
20+
The :ref:`contributing` has details on the preferred contribution workflow
2121
and the recommended system configuration for a smooth contribution/development
2222
experience.
2323

24+
.. note::
25+
It's a good idea to always reference the version of the contributing guide `on the development version of our website`_, as this will be the most up-to-date.
26+
2427
.. _`opening an issue`: https://github.com/mne-tools/mne-python/issues/new/choose
2528
.. _`MNE Forum`: https://mne.discourse.group
2629
.. _`code of conduct`: https://github.com/mne-tools/.github/blob/main/CODE_OF_CONDUCT.md
27-
.. _`contributing guide`: https://mne.tools/dev/development/contributing.html
30+
.. _`on the development version of our website`: https://mne.tools/dev/development/contributing.html
2831

2932
.. toctree::
3033
:hidden:

0 commit comments

Comments
 (0)