Gatsby: Short circuit for docs in CI doesn't work for forks

Created on 22 Nov 2019  路  8Comments  路  Source: gatsbyjs/gatsby

Description

The Gatsby docs state RE PRs:

For docs-only changes, consider using git checkout -b docs/some-change or git checkout -b
docs-some-change, as this will short circuit the CI process and only run linting tasks.

I opened a PR with the branch name docs-some-change, and it's running CI checks on the PR.

Steps to reproduce

-Edited code

  • git commit -m "<commit message>"
  • git push --set-upstream origin docs-some-change
  • Opened PR

Expected result

For CI checks to be short-circuited since this was a docs-only change

Actual result

CI Checks were not short-circuited

Environment

System:
OS: Windows 10
CPU: (4) x64 Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
Binaries:
Node: 13.1.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.19.1 - C:\Users\Michael C\AppData\Roaming\npm\yarn.CMD
npm: 6.12.0 - C:\Program Files\nodejs\npm.CMD
Languages:
Python: 2.7.17
Browsers:
Edge: 44.18362.449.0

help wanted maintenance

All 8 comments

So it actually short-circuits some of the tests. Since you are pushing up markdown doc changes, you still have to do stuff like linting and such, but it will skip all of the unit tests.

CircleCI says the tests that are skipped that they are pending down in the status checks section of the PR, but they are actually never run.

That's not what I'm seeing in this PR, one failed right off the bat:

https://github.com/gatsbyjs/gatsby/pull/19724

Well it is intended to skip, but I guess it didn't here for some reason.

Also, looking into that failure, the error seemed to be npm's audit system throwing back a vulnerability so it's nothing of an issue on your end.

Looking at the config, the regex at /.circleci/config.yml looks for /docs.+/ so maybe that fails because your PR is from a branch on a fork (dylanesque:docs-some-change) and that likely doesn't match the regex.

Happy to accept a PR fixing this!

Looking at the config, the regex at /.circleci/config.yml looks for /docs.+/ so maybe that fails because your PR is from a branch on a fork (dylanesque:docs-some-change) and that likely doesn't match the regex.

Happy to accept a PR fixing this!

How security minded would a fix need to be to pass a PR for this? If I amended the statement to, say, include an optional semicolon before the chars for docs and any number of characters that could be somebody's username on GitHub, would that be sufficient?

The regex /docs.*/ looks In the branch name where anywhere can be the part docs.
If only from beginning, then the regex would be /^docs.*/ (see CircleCI docs)

See https://regexr.com/4q0kc for a regex and some test cases that captures most of these cases. Anything missing from this list?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brandonmp picture brandonmp  路  3Comments

theduke picture theduke  路  3Comments

dustinhorton picture dustinhorton  路  3Comments

ghost picture ghost  路  3Comments

dustinhorton picture dustinhorton  路  3Comments