From 57323e9e4832d4aabfe2999c76b57ade6d5c2daf Mon Sep 17 00:00:00 2001 From: Stas Bekman Date: Tue, 8 Dec 2020 16:47:10 -0800 Subject: [PATCH 1/5] [wip] [ci] doc-job-skip take #4.5 dry-run via github direct edit --- .circleci/config.yml | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3963270e61fa..b6a1b50bd526 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,21 +11,40 @@ commands: - run: name: docs-only changes skip check command: | - # pipeline.git.base_revision is not always defined, so only proceed if all external vars are defined - if test -n "<< pipeline.git.base_revision >>" && test -n "<< pipeline.git.revision >>" && test -n "$(git diff --name-only << pipeline.git.base_revision >>...<< pipeline.git.revision >>)" + if test -n "$CIRCLE_PR_NUMBER" then - if git diff --name-only << pipeline.git.base_revision >>...<< pipeline.git.revision >> | egrep -qv '\.(md|rst)$' + echo $CIRCLE_PR_NUMBER + resp=$(curl -Ls https://api.github.com/repos/huggingface/transformers/pulls/${CIRCLE_PR_NUMBER}) + user=$(jq -r .user.login \<<< $resp) # PR creator username + head_ref=$(jq -r .head.ref \<<< $resp) # PR user's branch name + echo head_ref=$head_ref, user=$user + fi + + if test -n "$user" && test -n "$head_ref" + then + git clone https://github.com/$user/transformers user-clone + cd user-clone + git checkout $head_ref + fork_point_sha=$(git merge-base --fork-point master) + cd - + fi + + if test -n "$fork_point_sha" && test -n "$(git diff --name-only $fork_point_sha)" + then + git --no-pager diff --name-only $fork_point_sha + if git diff --name-only $fork_point_sha | egrep -qv '\.(md|rst)$' then echo "Non-docs were modified in this PR, proceeding normally" else echo "Only docs were modified in this PR, quitting this job" - # disable skipping for now, as circleCI's base_revision is inconsistent leading to invalid ranges + # enable skipping once we get this sorted out # circleci step halt fi else - echo "Can't perform skipping check w/o base_revision defined, continuing the job" + echo "Not enough data to perform a skipping check - continuing the job" fi + # TPU REFERENCES references: checkout_ml_testing: &checkout_ml_testing From f7296d6559a8c9abbb2d2da384f1f3910d82c05e Mon Sep 17 00:00:00 2001 From: Stas Bekman Date: Tue, 8 Dec 2020 17:09:29 -0800 Subject: [PATCH 2/5] doc test --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d5ee12d36060..ba924fb844fa 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +