Skip to content
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

Add a workflow for automated backporting #5227

Merged
merged 1 commit into from Feb 1, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/backport.yaml
@@ -0,0 +1,38 @@
name: Backport Bug Fixes
on:
schedule:
# Run weekdays 12:00 on main branch, so that it doesn't wreak havoc on
# weekends.
- cron: '0 12 * * 1-5'
workflow_dispatch:
push:
branches:
# You can run and debug new versions of the backport script by pushing it
# to this branch. workflow_dispatch can only be run through github cli for
# branches that are not main, so it's inconvenient.
- backport/trigger

jobs:
backport:
name: Backport Bug Fixes
runs-on: ubuntu-latest

steps:
- name: Install Linux Dependencies
run: |
sudo apt-get update
sudo apt-get install pip

- name: Install Python Dependencies
run: |
pip install PyGithub requests

- name: Checkout TimescaleDB
uses: actions/checkout@v3

- name: Run the Backport Script
env:
GITHUB_TOKEN: ${{ secrets.ORG_AUTOMATION_TOKEN }}
run: |
git remote --verbose
scripts/backport.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being explicit is better if the environment is not under your control. This avoids it accidentally trying to run as Python 2.x.

Suggested change
scripts/backport.py
python3 scripts/backport.py

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python 2 is long deprecated, no? And environment is under our control, this workflow requires ubuntu-latest. I will change the shebang to #/usr/bin/env python3 because the .py script is not compatible with python 2. Can't really tell what's the recommended approach these days: https://peps.python.org/pep-0394/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually prefer to play it safe, but if you feel confident it will always be python3, go with it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the shebang to require python3.

5 changes: 4 additions & 1 deletion .github/workflows/changelog-check.yaml
Expand Up @@ -2,7 +2,10 @@ name: Check CHANGELOG.md updated
"on":
pull_request:
types: [opened, synchronize, reopened, edited]
branches: [main]
# It's important to check that the changelog is updated with bug fixes that
# we backport to the release branches, so these branches are included as
# well.
branches: [main, "[0-9]+.[0-9]+.x"]
jobs:
# Check that the CHANGELOG is updated by the pull request. This can be
# disabled by adding a trailer line of the following form to the
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code_style.yaml
Expand Up @@ -85,7 +85,7 @@ jobs:
pip install --upgrade pip
# Inexplicably, at some point pip started to insist on installing
# prospector==1.7.7, which is incompatible with the new pylint.
pip install black prospector==1.8.4 psutil pylint
pip install black prospector==1.8.4 psutil pylint pygithub
pip list
pip list --user
- name: Checkout source
Expand Down
5 changes: 4 additions & 1 deletion .pull-review
Expand Up @@ -57,10 +57,13 @@ reviewers:
review_blacklist:
- horzsolt

# ignore changes to the test output files.
# ignore changes to the test output files.
# 1. because they usually will have equivalent .sql files
# 2. because people that modify a test, don't necessarily change the same c-functionality at all
# so tests should be less important than C files
file_blacklist:
- tsl/test/expected/*.out
- test/expected/*.out

label_blacklist:
- pr-backport