Visitar URL original
GitHub Actions issues not triggering · Issue #373 · python/core-workflow · GitHub
Skip to content

GitHub Actions issues not triggering #373

Description

@zooba

Something has happened to the source checker task, e.g. python/cpython#21748

Run if [ -z "GITHUB_BASE_REF" ]; then
  if [ -z "GITHUB_BASE_REF" ]; then
    echo '::set-output name=run_tests::true'
  else
    git fetch origin $GITHUB_BASE_REF --depth=1
    git diff --name-only origin/$GITHUB_BASE_REF... | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true' || true
  fi
  shell: /bin/bash -e {0}
From https://github.com/python/cpython
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
fatal: origin/master...HEAD: no merge base

I'm not sure what this error means, but because the failure is treated as a success, the checks decide they don't need to run and so we get all green with no CI!

Activity

  1. brettcannon commented on Aug 7, 2020

    @brettcannon
    Member

    Did we shove all of these into a single file with this trick due to requiring status checks that don't get run blocks a PR?

  2. vstinner commented on Aug 10, 2020

    @vstinner
    Member

    Something has happened to the source checker task, e.g. python/cpython#21748

    I confirmed that it worked well since May ( https://bugs.python.org/issue40548 ) but it started to fail with fatal: origin/master...HEAD: no merge base. I'm not sure why it stopped working.

    I'm not sure if git fetch fails or if git diff fails.

    cc @FFY00

  3. vstinner commented on Aug 10, 2020

    @vstinner
    Member

    Did we shove all of these into a single file with this trick due to requiring status checks that don't get run blocks a PR?

    I understood that @FFY00 chose to use a separated job to check if a PR is a "doc only" to easy maintenance of the check: the job uses Linux and reuses services like uses: actions/checkout@v2 (rather than having to implement the check for Windows, macOS, Linux, ...)

    The advantage is to not even start other jobs if it's a doc-only PR. It reduces resource consumption.

  4. vstinner commented on Aug 10, 2020

    @vstinner
    Member

    Oh! I can reproduce the issue with Git 2.28 (on Fedora Rawhide), but not with Git 2.26 (Fedora 32). Script to reproduce the issue:

    set -e -x
    DIR=clone_python
    export GITHUB_BASE_REF=master
    
    rm -rf $DIR
    git init $DIR
    cd $DIR
    git remote add origin https://github.com/python/cpython
    
    git fetch --no-tags --prune --depth=1 origin +fe42ecf3c875b31a281ecb5b4e257655cf820134:refs/remotes/pull/21748/merge
    git fetch origin master --depth=1
    git checkout --force refs/remotes/pull/21748/merge
    
    git diff --name-only origin/master... | cat
    

    git diff --name-only origin/master... fails with fatal: origin/master...HEAD: no merge base.

    But git diff --name-only origin/master..refs/remotes/pull/21748/merge works as expected.

  5. vstinner commented on Aug 10, 2020

    @vstinner
    Member

    Difference between 2 dots (..) and 3 dots (...):
    https://matthew-brett.github.io/pydagogue/git_diff_dots.html

    It seems like using 2 dots should be enough for the workflow job, since GitHub starts by merging master into the PR anyway.

  6. vstinner commented on Aug 10, 2020

    @vstinner
    Member

    I didn't find any obvious change on the "merge-base" command in the Git 2.28 changelog, but this version contains many changes, so I'm not surprised that the behavior changed.

  7. vstinner commented on Aug 10, 2020

    @vstinner
    Member

    I proposed python/cpython#21806 to replace "..." (3 dots) with ".." (2 dots).

  8. FFY00 commented on Aug 10, 2020

    @FFY00
    Member

    Sorry for the delay! I wasn't able to look at this earlier.

    See my comment in python/cpython#21806 (comment).

  9. vstinner commented on Oct 26, 2020

    @vstinner
    Member

    My python/cpython#21806 was merged into master and then backported to 3.8 and 3.9 branches. I close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions