This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Always run GitHub action jobs, even on documentation-only jobs
Type: Stage: resolved
Components: Build Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: FFY00, jstasiak, miss-islington, vstinner
Priority: normal Keywords: patch

Created on 2020-05-07 17:39 by vstinner, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 19981 merged vstinner, 2020-05-07 17:44
PR 19983 closed FFY00, 2020-05-07 18:18
PR 20097 merged FFY00, 2020-05-15 00:21
PR 20100 merged vstinner, 2020-05-15 03:07
PR 20101 merged miss-islington, 2020-05-15 03:28
PR 20164 merged FFY00, 2020-05-18 12:52
PR 20178 merged miss-islington, 2020-05-18 13:49
PR 20179 merged miss-islington, 2020-05-18 13:49
PR 20740 closed FFY00, 2020-06-08 18:47
PR 21806 merged vstinner, 2020-08-10 14:52
PR 21812 closed vstinner, 2020-08-10 16:38
PR 21813 merged miss-islington, 2020-08-10 16:50
PR 21814 merged miss-islington, 2020-08-10 16:50
Messages (17)
msg368357 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-05-07 17:39
bpo-39837 made Azure Pipelines CI non-mandatory. Travis CI was made mandatory to have at least one mandatory job: https://github.com/python/core-workflow/issues/365

I would prefer to have at least one mandatory Windows CI running on Python pull requests. Before we had pre-commit checks, it was too common to break Windows. I would prefer to not regress on that aspect.

--

Currently, GitHub action jobs ignore "documentation-only" changes. Extract of .github/workflows/build.yml:

on:
  push:
    branches:
    - master
    - 3.8
    - 3.7
    paths-ignore:
    - 'Doc/**'
    - 'Misc/**'
    - '**/*.md'
    - '**/*.rst'

If a job is marked as mandatory but the GitHub action is skipped because of paths-ignore, the PR cannot be merged :-( It seems to be a known GitHub limitation which is not going to be fixed soon:
https://discuss.python.org/t/make-one-windows-ci-job-mandatory/4047/6

To workaround is to always run GitHub action jobs, even on documentation-only jobs.

I propose to always run GitHub actions and then make the Windows (64 bit) job mandatory.

--

Sadly, it will waste resources for documentation-only jobs. To avoid that, the Windows job can be modified later to be skipped if it detects that the PR is a documentation-only change.

Steve Dower wrote:
"That workaround looks roughly like what is in the Azure Pipelines files. Someone just needs the time to go and migrate it."
https://discuss.python.org/t/make-one-windows-ci-job-mandatory/4047/6

Note: the Travis CI job (.travis.yml) uses the following check:

      # Pull requests are slightly complicated because $TRAVIS_COMMIT_RANGE
      # may include more changes than desired if the history is convoluted.
      # Instead, explicitly fetch the base branch and compare against the
      # merge-base commit.
      git fetch -q origin +refs/heads/$TRAVIS_BRANCH
      changes=$(git diff --name-only HEAD $(git merge-base HEAD FETCH_HEAD))
      echo "Files changed:"
      echo "$changes"
      if ! echo "$changes" | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
      then
        echo "Only docs were updated, stopping build process."
        exit
      fi

--

More background on these CI issues:

* https://bugs.python.org/issue39837
* https://github.com/python/core-workflow/issues/365
* https://discuss.python.org/t/make-one-windows-ci-job-mandatory/4047
msg368359 - (view) Author: Filipe Laíns (FFY00) * (Python triager) Date: 2020-05-07 17:48
The workaround presented at https://github.community/t5/GitHub-Actions/Feature-request-conditional-required-checks/m-p/51344/highlight/true#M8157 seems pretty reasonable. And it seems like travis is alerady doing the same thing as it doesn't have native support to skip runs based on path changes.

I can open a PR if you want.
msg368361 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-05-07 18:00
> The workaround presented at https://github.community/t5/GitHub-Actions/Feature-request-conditional-required-checks/m-p/51344/highlight/true#M8157 seems pretty reasonable. And it seems like travis is alerady doing the same thing as it doesn't have native support to skip runs based on path changes.

I suppose that Steve Dower mentioned the following part of .azure-pipelines/prebuild-checks.yml:
----------------
- script: |
   if ! git diff --name-only $(diffTarget) | grep -qvE '(\.rst$|^Doc|^Misc)'
   then
     echo "Only docs were updated: tests.run=false"
     echo "##vso[task.setvariable variable=run;isOutput=true]false"
   else
     echo "Code was updated: tests.run=true"
     echo "##vso[task.setvariable variable=run;isOutput=true]true"
   fi
  displayName: Detect source changes
  name: tests
----------------

I understood that he proposed to port it inside the Windows job of GitHub actions (.github/workflows/build.yml).

I propose the following plan:

* Always run GitHub Action jobs
* Make Windows 64-bit job mandatory
* And only then try to skip documentation-only changes
msg368366 - (view) Author: Filipe Laíns (FFY00) * (Python triager) Date: 2020-05-07 18:36
> * And only then try to skip documentation-only changes

Done :)
msg368372 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-05-07 20:42
New changeset 4e363761fc02a89d53aba4382dc451293bd6f0ba by Victor Stinner in branch 'master':
bpo-40548: Always run GitHub action, even on doc PRs (GH-19981)
https://github.com/python/cpython/commit/4e363761fc02a89d53aba4382dc451293bd6f0ba
msg368384 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-05-07 22:25
> I propose the following plan:
>
> * Always run GitHub Action jobs

Done.

> * Make Windows 64-bit job mandatory

My request: https://github.com/python/core-workflow/issues/368
msg368870 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-05-14 22:11
New changeset 75d7257b201a56f950c20cd9f5753a83fff4742b by Filipe Laíns in branch 'master':
bpo-40548: GitHub Action workflow: skip jobs on doc only PRs (GH-19983)
https://github.com/python/cpython/commit/75d7257b201a56f950c20cd9f5753a83fff4742b
msg368915 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-05-15 02:08
New changeset 6a78589b6b22878491a4b042bb8b3161e1d120f6 by Filipe Laíns in branch 'master':
bpo-40548: github actions: pass the changes check on no source changes (GH-20097)
https://github.com/python/cpython/commit/6a78589b6b22878491a4b042bb8b3161e1d120f6
msg368922 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-05-15 03:27
New changeset 07bd5cf3d9551ae84100e6400836163fcd507f07 by Victor Stinner in branch '3.8':
[3.8] bpo-40548: GitHub Action workflow: skip jobs on doc only PRs (GH-20100)
https://github.com/python/cpython/commit/07bd5cf3d9551ae84100e6400836163fcd507f07
msg368924 - (view) Author: miss-islington (miss-islington) Date: 2020-05-15 03:46
New changeset 6ad51a1fd6715d8266a43a4a89d496cf0615aace by Miss Islington (bot) in branch '3.7':
[3.8] bpo-40548: GitHub Action workflow: skip jobs on doc only PRs (GH-20100)
https://github.com/python/cpython/commit/6ad51a1fd6715d8266a43a4a89d496cf0615aace
msg369210 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-05-18 12:52
New changeset c444108dd62672f2b41539bcc8f15da44501f405 by Filipe Laíns in branch 'master':
bpo-40548: Github Actions: update actions/checkout to v2 (GH-20164)
https://github.com/python/cpython/commit/c444108dd62672f2b41539bcc8f15da44501f405
msg369225 - (view) Author: miss-islington (miss-islington) Date: 2020-05-18 14:07
New changeset 9ecf25e04cb0b97f7f9a12f50b87ac4fad5dc3f5 by Miss Islington (bot) in branch '3.7':
bpo-40548: Github Actions: update actions/checkout to v2 (GH-20164)
https://github.com/python/cpython/commit/9ecf25e04cb0b97f7f9a12f50b87ac4fad5dc3f5
msg369226 - (view) Author: miss-islington (miss-islington) Date: 2020-05-18 14:07
New changeset d8cbfa2f2a9a972caf9cbc2b1e2565c456e08888 by Miss Islington (bot) in branch '3.8':
bpo-40548: Github Actions: update actions/checkout to v2 (GH-20164)
https://github.com/python/cpython/commit/d8cbfa2f2a9a972caf9cbc2b1e2565c456e08888
msg369230 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-05-18 14:18
The initial issue (be able to make a GitHub action job mandatory) is now fixed, I close the issue.

Making Windows x64 job mandatory is now tracked at: https://github.com/python/core-workflow/issues/368
msg375129 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-08-10 16:37
New changeset eaa551702d80fd67219c48ee6a13ffb571ca360b by Victor Stinner in branch 'master':
bpo-40548: Fix "Check for source changes (pull_request)" GH Action job (GH-21806)
https://github.com/python/cpython/commit/eaa551702d80fd67219c48ee6a13ffb571ca360b
msg375131 - (view) Author: miss-islington (miss-islington) Date: 2020-08-10 17:06
New changeset 09d82609be3d4903104610ed918caeefb953f79a by Miss Islington (bot) in branch '3.8':
bpo-40548: Fix "Check for source changes (pull_request)" GH Action job (GH-21806)
https://github.com/python/cpython/commit/09d82609be3d4903104610ed918caeefb953f79a
msg375132 - (view) Author: miss-islington (miss-islington) Date: 2020-08-10 17:09
New changeset 2cd58d8bb15c1afaeef59106941d6db697074ce8 by Miss Islington (bot) in branch '3.9':
bpo-40548: Fix "Check for source changes (pull_request)" GH Action job (GH-21806)
https://github.com/python/cpython/commit/2cd58d8bb15c1afaeef59106941d6db697074ce8
History
Date User Action Args
2022-04-11 14:59:30adminsetgithub: 84728
2020-08-10 17:09:45miss-islingtonsetmessages: + msg375132
2020-08-10 17:06:19miss-islingtonsetmessages: + msg375131
2020-08-10 16:50:28miss-islingtonsetpull_requests: + pull_request20947
2020-08-10 16:50:17miss-islingtonsetpull_requests: + pull_request20946
2020-08-10 16:38:42vstinnersetpull_requests: + pull_request20945
2020-08-10 16:37:07vstinnersetmessages: + msg375129
2020-08-10 14:52:30vstinnersetpull_requests: + pull_request20943
2020-06-14 22:26:53jstasiaksetnosy: + jstasiak
2020-06-08 18:47:14FFY00setpull_requests: + pull_request19947
2020-05-18 14:18:46vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg369230

stage: patch review -> resolved
2020-05-18 14:07:52miss-islingtonsetmessages: + msg369226
2020-05-18 14:07:02miss-islingtonsetmessages: + msg369225
2020-05-18 13:49:13miss-islingtonsetpull_requests: + pull_request19478
2020-05-18 13:49:04miss-islingtonsetpull_requests: + pull_request19477
2020-05-18 12:52:52vstinnersetmessages: + msg369210
2020-05-18 12:52:02FFY00setpull_requests: + pull_request19473
2020-05-15 03:46:31miss-islingtonsetmessages: + msg368924
2020-05-15 03:28:51miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request19408
2020-05-15 03:27:55vstinnersetmessages: + msg368922
2020-05-15 03:07:15vstinnersetpull_requests: + pull_request19407
2020-05-15 02:08:29vstinnersetmessages: + msg368915
2020-05-15 00:21:27FFY00setpull_requests: + pull_request19402
2020-05-14 22:11:47vstinnersetmessages: + msg368870
2020-05-07 22:25:54vstinnersetmessages: + msg368384
2020-05-07 20:42:21vstinnersetmessages: + msg368372
2020-05-07 18:36:29FFY00setmessages: + msg368366
2020-05-07 18:18:58FFY00setpull_requests: + pull_request19299
2020-05-07 18:00:48vstinnersetmessages: + msg368361
2020-05-07 17:48:40FFY00setnosy: + FFY00
messages: + msg368359
2020-05-07 17:44:22vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request19297
2020-05-07 17:39:37vstinnercreate