Skip to content

Backport PR #21833: Enforce backport conditions on v*-doc branches #22221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,15 @@ commands:
steps:
- run:
name: Install Matplotlib
command: python -m pip install --user -ve .
command: |
if [[ "$CIRCLE_BRANCH" == v*-doc ]]; then
# The v*-doc branches must build against the specified release.
version=${CIRCLE_BRANCH%-doc}
version=${version#v}
python -m pip install matplotlib==${version}
else
python -m pip install --user -ve .
fi
- save_cache:
key: build-deps-1
paths:
Expand Down
23 changes: 22 additions & 1 deletion .github/workflows/clean_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,25 @@ jobs:
printf 'The following files were both added and deleted in this PR:\n%s\n' "$ad"
exit 1
fi

- name: Check for added-and-modified images
run: |
git fetch --quiet origin "$GITHUB_BASE_REF"
base="$(git merge-base "origin/$GITHUB_BASE_REF" 'HEAD^2')"
am="$(git log "$base..HEAD^2" --pretty=tformat: --name-status --diff-filter=AM |
cut --fields 2 | sort | uniq --repeated |
grep -E '\.(png|pdf|ps|eps|svg)' || true)"
if [[ -n "$am" ]]; then
printf 'The following images were both added and modified in this PR:\n%s\n' "$am"
exit 1
fi
- name: Check for invalid backports to -doc branches
if: endsWith(github.base_ref, '-doc')
run: |
git fetch --quiet origin "$GITHUB_BASE_REF"
base="$(git merge-base "origin/$GITHUB_BASE_REF" 'HEAD^2')"
lib="$(git log "$base..HEAD^2" --pretty=tformat: --name-status -- lib src |
cut --fields 2 | sort || true)"
if [[ -n "$lib" ]]; then
printf 'Changes to the following files have no effect and should not be backported:\n%s\n' "$lib"
exit 1
fi