Skip to content

Commit

Permalink
Add nightly rebase of branches with upstream julia (#42)
Browse files Browse the repository at this point in the history
* Add nightly rebase of branches with upstream julia

* Update .github/workflows/nightly-rebase-upstream.yml

Co-authored-by: Nick Robinson <npr251@gmail.com>

* Update .github/workflows/nightly-rebase-upstream.yml

Co-authored-by: Nick Robinson <npr251@gmail.com>

* Update .github/workflows/nightly-rebase-upstream.yml

Co-authored-by: Nick Robinson <npr251@gmail.com>

* Updates

---------

Co-authored-by: Nick Robinson <npr251@gmail.com>
  • Loading branch information
2 people authored and RAI CI (GitHub Action Automation) committed Sep 14, 2023
1 parent 4e9baa8 commit a3e016c
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/nightly-rebase-upstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Every night, rebase the Julia branches on top of raicode `master`.
name: NightlyRebaseUpstream
on:
schedule:
# every night at 11 PM, raicode nightly rebase runs at midnight
- cron: 0 23 * * *
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
NightlyRebaseUpstream:
runs-on: ubuntu-latest
strategy:
fail-fast: false # run all jobs in the matrix even if one fails
matrix:
julia_branch:
- { name: "backports-release-1.9+RAI", upstream: "backports-release-1.9", comp_pr: "https://github.com/RelationalAI/julia/pull/45"}
- { name: "backports-release-1.10+RAI", upstream: "backports-release-1.10", comp_pr: "https://github.com/RelationalAI/julia/pull/46"}
- { name: "master+RAI", upstream: "master", comp_pr: "https://github.com/RelationalAI/julia/pull/47"}
steps:
- name: Checkout the repo and our branch
uses: actions/checkout@v3
with:
ref: ${{ matrix.julia_branch.name }}
# Needed to make rebasing work (https://github.com/actions/checkout/issues/372)
fetch-depth: 0
- name: Attempt the rebase
id: attempt_the_rebase
run: |
git config --global user.email "julia-engineering@relational.ai"
git config --global user.name "RAI CI (GitHub Action Automation)"
git remote add upstream https://github.com/JuliaLang/julia
git fetch --quiet upstream ${{ matrix.julia_branch.upstream }}}
git rebase upstream/${{ matrix.julia_branch.upstream }}
continue-on-error: true
- name: On rebase success, push
if: steps.attempt_the_rebase.outcome == 'success'
run: |
git push --force origin ${{ matrix.julia_branch.name }} # force-push, because of the rebase.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: On rebase failure, checkout jira-incident action
if: steps.attempt_the_rebase.outcome != 'success'
id: checkout-jira-indicent-action
uses: actions/checkout@v3
with:
repository: RelationalAI/raicloud-deployment
ssh-key: ${{ secrets.DELVECI_SSH }}
path: deployment-repo
- name: On rebase failure, create Jira incident
if: steps.attempt_the_rebase.outcome != 'success'
id: create-jira-indicent
uses: ./deployment-repo/.github/actions/create-jira-incident
with:
affected_service: Engineering - Julia Upgrades - Medium Priority Only
summary: "Nightly rebase failed for RelationalAI/julia branch `${{ matrix.julia_branch.name }}`"
description: "Failed to rebase RelationalAI/julia branch `${{ matrix.julia_branch.name }}` branch on top of `${{ matrix.julia_branch.upstream}}`.\nPlease manually rebase ${{ matrix.julia_branch.name }}\nSee current diff between upstream branch here: ${{ matrix.julia_branch.comp_pr }}"
user_email: ${{ secrets.JIRA_API_USER_EMAIL }}
jira_api_token: ${{ secrets.JIRA_API_TOKEN }}
priority: "Medium"

0 comments on commit a3e016c

Please sign in to comment.