Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
2a35142
init hello workflow
pxLi Aug 18, 2020
12c1b4e
fix cron rate
pxLi Aug 18, 2020
87c929c
add automerge workflow
pxLi Aug 18, 2020
646fb2e
modify cron sche
pxLi Aug 18, 2020
0850f47
trigger every 10 mins
pxLi Aug 18, 2020
a3e7a24
add token
pxLi Aug 18, 2020
2865861
use GITHUB_TOKEN
pxLi Aug 18, 2020
fcb5ac7
try merge conflict 0.2
pxLi Aug 18, 2020
2105a94
trigger conlict
pxLi Aug 18, 2020
22c9a2d
add another commit to pending PR
pxLi Aug 18, 2020
12fe90b
trigger release
pxLi Aug 18, 2020
3bd2029
make it auto-merge
pxLi Aug 18, 2020
7e97d44
add 2
pxLi Aug 18, 2020
299d515
hourly
pxLi Aug 18, 2020
6187833
test branch config
pxLi Aug 19, 2020
31a1861
if condition
pxLi Aug 19, 2020
05a3d39
echo ref
pxLi Aug 19, 2020
b00d876
branch back if condition
pxLi Aug 19, 2020
db7763b
add readme to worklfows (#17)
pxLi Aug 19, 2020
3699cdf
no conflict (#19)
pxLi Aug 19, 2020
0103c94
PR-001 (#23)
pxLi Aug 19, 2020
423c4d4
PR-002 (#24)
pxLi Aug 19, 2020
12b5674
Merge pull request #25 from pxLi/branch-0.2
github-actions[bot] Aug 19, 2020
f973b07
PR-003
pxLi Aug 19, 2020
2de8c27
PR-003 (#26)
pxLi Aug 19, 2020
5e0d70b
PR-004 conflict from branch-0.2 (#27)
pxLi Aug 19, 2020
baf26f7
PR-004 conflict from branch-0.2 (#27) (#29)
pxLi Aug 19, 2020
56ed589
Merge pull request #30 from pxLi/branch-0.2
github-actions[bot] Aug 19, 2020
c44927a
10 mins to 2 hours
pxLi Aug 19, 2020
ad1275b
Merge pull request #31 from pxLi/branch-0.2
github-actions[bot] Aug 19, 2020
b609d99
Local changelog test (#32)
pxLi Aug 24, 2020
bbbeadb
Local changelog test (#33)
pxLi Aug 24, 2020
ac03efe
Update changelog.yml
pxLi Aug 24, 2020
412048a
Merge pull request #34 from pxLi/branch-0.2
github-actions[bot] Aug 24, 2020
ca88efa
Update auto_merge.yml
pxLi Aug 24, 2020
427d6f5
Merge pull request #35 from pxLi/branch-0.2
github-actions[bot] Aug 24, 2020
2abc569
Update changelog.yml
pxLi Aug 24, 2020
f860417
Merge pull request #36 from pxLi/branch-0.2
github-actions[bot] Aug 24, 2020
286d7a0
Update changelog.yml
pxLi Aug 24, 2020
717c634
Merge pull request #37 from pxLi/branch-0.2
github-actions[bot] Aug 24, 2020
c31568e
Update CHANGELOG.md
pxLi Aug 24, 2020
725125a
Merge pull request #39 from pxLi/branch-0.2
github-actions[bot] Aug 24, 2020
d74995c
Create Dockerfile
pxLi Aug 24, 2020
afc2a24
Merge pull request #40 from pxLi/branch-0.2
github-actions[bot] Aug 24, 2020
b16c120
Create action.yml
pxLi Aug 24, 2020
653b49f
Merge pull request #42 from pxLi/branch-0.2
github-actions[bot] Aug 24, 2020
78194b5
Create entrypoint.sh
pxLi Aug 24, 2020
ecf234a
Merge pull request #43 from pxLi/branch-0.2
github-actions[bot] Aug 24, 2020
2a2acf6
Update changelog.yml
pxLi Aug 24, 2020
2f7044e
Merge pull request #44 from pxLi/branch-0.2
github-actions[bot] Aug 24, 2020
e8056cd
Update Dockerfile
pxLi Aug 24, 2020
218254f
Merge pull request #45 from pxLi/branch-0.2
github-actions[bot] Aug 24, 2020
804b394
Update changelog.yml
pxLi Aug 24, 2020
938a903
Merge pull request #46 from pxLi/branch-0.2
github-actions[bot] Aug 24, 2020
9e702f9
Update auto_merge.yml
pxLi Aug 24, 2020
bdbd6b3
Merge pull request #48 from pxLi/branch-0.2
github-actions[bot] Aug 24, 2020
5fd8214
Update CHANGELOG.md
pxLi Aug 24, 2020
f5d0c9b
Merge pull request #49 from pxLi/branch-0.2
github-actions[bot] Aug 24, 2020
a51b2e9
changelog-gen 2020-08-24 (#50)
pxLi Aug 24, 2020
4b6a138
Merge pull request #51 from pxLi/branch-0.2
github-actions[bot] Aug 24, 2020
d636361
changelog-gen 2020-08-24 (#52)
pxLi Aug 24, 2020
822fa53
Merge pull request #53 from pxLi/branch-0.2
github-actions[bot] Aug 24, 2020
a0c5302
UPT CHL 217
pxLi Aug 24, 2020
fa6406a
Merge pull request #54 from pxLi/branch-0.2
github-actions[bot] Aug 24, 2020
827f9f7
changelog-gen 2020-08-24 (#55)
pxLi Aug 24, 2020
b851fae
Merge pull request #56 from pxLi/branch-0.2
github-actions[bot] Aug 24, 2020
e60c3d8
Create Dockerfile
pxLi Aug 24, 2020
67035c5
Merge pull request #57 from pxLi/branch-0.2
github-actions[bot] Aug 24, 2020
16c22f6
Create action.yml
pxLi Aug 24, 2020
0143b2f
Merge pull request #58 from pxLi/branch-0.2
github-actions[bot] Aug 24, 2020
6a476b6
Create automerge
pxLi Aug 24, 2020
1e9a4f2
Update Dockerfile
pxLi Aug 24, 2020
3b87fb2
Update auto_merge.yml
pxLi Aug 24, 2020
0342778
Rename auto_merge.yml to auto-merge.yml
pxLi Aug 24, 2020
b1e30d8
[auto-merge] branch-0.2 to branch-0.3 (#59)
github-actions[bot] Aug 24, 2020
e073700
Update changelog.yml
pxLi Aug 24, 2020
6668f32
Update auto-merge.yml
pxLi Aug 24, 2020
c27ae80
Update changelog.yml
pxLi Aug 24, 2020
c27d831
Update auto-merge.yml
pxLi Aug 24, 2020
e80ef41
Merge branch 'branch-0.3' into branch-0.2
pxLi Aug 24, 2020
c7614b8
Update Dockerfile
pxLi Aug 24, 2020
c9612cb
Update changelog.yml
pxLi Aug 24, 2020
2fa58de
Update CHANGELOG.md
pxLi Aug 24, 2020
9f44f08
Delete entrypoint.sh
pxLi Aug 24, 2020
50e7a5f
Update Dockerfile
pxLi Aug 24, 2020
0849f65
Update changelog
pxLi Aug 24, 2020
8d14b5a
Update changelog.yml
pxLi Aug 24, 2020
f49759f
Update changelog.yml
pxLi Aug 24, 2020
668f0cc
Update changelog.yml
pxLi Aug 24, 2020
e1fa393
2 peixin blossom (#68)
pxLi Aug 24, 2020
5d0dde7
Update changelog.yml
pxLi Aug 24, 2020
12594fa
PR-001 (#71)
pxLi Aug 24, 2020
26fae0f
Update auto-merge.yml
pxLi Aug 24, 2020
00a91f7
Update changelog.yml
pxLi Aug 24, 2020
c6e3e3f
PR-002 (#73)
pxLi Aug 24, 2020
91c595a
Update changelog.yml
pxLi Aug 24, 2020
506f6bb
PR-003 (#74)
pxLi Aug 24, 2020
8607572
Update Dockerfile
pxLi Aug 24, 2020
736f885
PR-004 conflict from branch-0.2 (#75)
pxLi Aug 24, 2020
e90349e
Update changelog.yml
pxLi Aug 24, 2020
6cbdb95
PR-001 (#77)
pxLi Aug 24, 2020
f321d34
PR-002 (#79)
pxLi Aug 24, 2020
5c4af3d
Update Dockerfile
pxLi Aug 24, 2020
31db442
PR-003 (#80)
pxLi Aug 24, 2020
c24c70e
Update Dockerfile
pxLi Aug 24, 2020
3747e9a
Update changelog.yml
pxLi Aug 24, 2020
9c06864
PR-004 conflict from branch-0.2 (#81)
pxLi Aug 24, 2020
886cc2b
Update changelog.yml
pxLi Aug 24, 2020
06e1516
Update changelog.yml
pxLi Aug 25, 2020
519464b
Update auto-merge.yml
pxLi Aug 25, 2020
af49026
changelog-gen 2020-08-24 (#78)
pxLi Aug 25, 2020
40ef3cd
Update auto-merge.yml
pxLi Aug 25, 2020
e4a212d
changelog-gen 2020-08-25 (#82)
nvauto Aug 25, 2020
bf35f47
Update Dockerfile
pxLi Aug 25, 2020
db8961a
Update changelog
pxLi Aug 25, 2020
f49c2f2
Update changelog
pxLi Aug 25, 2020
260ac0b
PR-001 (#84)
pxLi Aug 25, 2020
3c58340
Update CHANGELOG.md
pxLi Aug 25, 2020
1fc717e
add readme to worklfows (#86)
pxLi Aug 25, 2020
b912c14
changelog-gen 2020-08-25 (#88)
nvauto Aug 25, 2020
8d896ca
PR-002 (#90)
pxLi Aug 25, 2020
834effa
Update README.md
pxLi Aug 25, 2020
e15961d
Update README.md (#92)
nvauto-bot Aug 25, 2020
fcf1c32
Update auto-merge.yml
pxLi Aug 25, 2020
cab3e31
Update changelog.yml
pxLi Aug 25, 2020
b58a712
PR-004 conflict from branch-0.2 (#93)
pxLi Aug 25, 2020
691258d
Pr 004 (#96)
nvauto-bot Aug 25, 2020
af0b3c4
Update auto-merge.yml
pxLi Aug 25, 2020
142dbb4
Update changelog.yml
pxLi Aug 25, 2020
2aca421
PR-003 (#97)
nvauto-bot Aug 25, 2020
f9a6c37
Update changelog.yml
pxLi Aug 26, 2020
20a84e3
Update auto-merge.yml
pxLi Aug 26, 2020
49e6370
PR-002 (#99)
pxLi Aug 26, 2020
9a921c4
Update CHANGELOG.md
pxLi Aug 26, 2020
83560ca
dup (#102)
nvauto-bot Aug 26, 2020
1bdd66f
Update changelog.yml
pxLi Aug 26, 2020
68111d0
PR-002 (#103)
pxLi Aug 26, 2020
dcce355
Update changelog.yml
pxLi Aug 26, 2020
8a3d3cf
PR-004 conflict from branch-0.2 (#105)
pxLi Aug 26, 2020
388ac71
Update changelog.yml
pxLi Aug 26, 2020
cd4ccdd
Merge branch 'branch-0.2' into PR-003
pxLi Aug 26, 2020
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
3 changes: 3 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Workflows
001
003
38 changes: 38 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright (c) 2020, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# A workflow to keep BASE branch up-to-date from HEAD branch
name: auto-merge HEAD to BASE

on:
pull_request_target:
branches:
- branch-0.2
types: [closed]

jobs:
auto-merge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: auto-merge job
if: github.event.pull_request.merged == true
uses: ./.github/workflows/auto-merge
env:
OWNER: pxLi
REPO_NAME: spark-rapids
HEAD: branch-0.2
BASE: branch-0.3
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/auto-merge/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (c) 2020, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM python:alpine

WORKDIR /
COPY automerge .
RUN pip install requests && chmod +x automerge

# require envs: OWNER,REPO_NAME,HEAD,BASE,GITHUB_TOKEN
ENTRYPOINT ["/automerge"]
19 changes: 19 additions & 0 deletions .github/workflows/auto-merge/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (c) 2020, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: 'auto-merge action'
description: 'auto-merge HEAD to BASE'
runs:
using: 'docker'
image: 'Dockerfile'
132 changes: 132 additions & 0 deletions .github/workflows/auto-merge/automerge
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
#!/usr/bin/env python

# Copyright (c) 2020, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""A auto-merge tool

Create a PR to merge HEAD to BASE branch.
The PR will be automatically merged if no conflict. Otherwise, manual operation will be required.
"""

import os
import sys
import time

import requests

# ENV
OWNER = os.environ.get('OWNER')
assert OWNER, 'env OWNER should not be empty'
REPO_NAME = os.environ.get('REPO_NAME')
assert REPO_NAME, 'env REPO_NAME should not be empty'
HEAD = os.environ.get('HEAD')
assert HEAD, 'env HEAD should not be empty'
BASE = os.environ.get('BASE')
assert BASE, 'env BASE should not be empty'
GITHUB_TOKEN = os.environ.get('GITHUB_TOKEN')
assert GITHUB_TOKEN, 'env GITHUB_TOKEN should not be empty'
# static
API_URL = 'https://api.github.com'
AUTH_HEADERS = {
'Authorization': 'token ' + GITHUB_TOKEN
}


def create():
url = f'{API_URL}/repos/{OWNER}/{REPO_NAME}/pulls'
params = {
'title': f'[auto-merge] {HEAD} to {BASE} [skip ci] [bot]',
'head': HEAD,
'base': BASE,
'body': f'auto-merge triggered by github actions on `{HEAD}` to create a PR keeping `{BASE}` up-to-date. If '
'this PR is unable to be merged due to conflicts, it will remain open until manually fix.',
'maintainer_can_modify': True
}
r = requests.post(url, headers=AUTH_HEADERS, json=params)
if r.status_code == 201:
print('SUCCESS - create PR')
pull = r.json()
number = str(pull['number'])
sha = str(pull['head']['sha'])
return number, sha, False
if r.status_code == 422:
print('SUCCESS - No commits')
print(r.json())
return '', '', True
# FAILURE
print('FAILURE - create PR')
print(f'status code: {r.status_code}')
print(r.json())
sys.exit(1)


def auto_merge(number, sha):
url = f'{API_URL}/repos/{OWNER}/{REPO_NAME}/pulls/{number}/merge'
params = {
'sha': sha,
'merge_method': 'merge'
}
r = requests.put(url, headers=AUTH_HEADERS, json=params)
if r.status_code == 200:
comment(number, '**SUCCESS** - auto-merge')
print('SUCCESS - auto-merge')
sys.exit(0)
else:
comment(number, """**FAILURE** - Unable to auto-merge due to conflicts. Manual operation is required.

To maintainers, please use the following steps to fix the merge conflicts manually:
This is a example to fix conflict from `branch-0.2` to `branch-0.3`
```bash
git fetch <spark-rapids_remote>
git checkout -b branch-0.3-merge-branch-0.2 <spark-rapids_remote>/branch-0.3
git merge <spark-rapids_remote>/branch-0.2
# fix the merge conflict, then
git commit -am "merge branch-0.2 to branch-0.3"
git push <your forked remote> branch-0.3-merge-branch-0.2
```
When this is done, create a PR targets the base branch (`branch-0.3` in this example).
Once the PR get merged, close the auto-merge PR.
""")
print('FAILURE - auto-merge')
print(f'status code: {r.status_code}')
print(r.json())
sys.exit(1)


def comment(number, content):
url = f'{API_URL}/repos/{OWNER}/{REPO_NAME}/issues/{number}/comments'
params = {
'body': content
}
r = requests.post(url, headers=AUTH_HEADERS, json=params)
if r.status_code == 201:
print('SUCCESS - create comment')
else:
print('FAILURE - create comment')
print(f'status code: {r.status_code}')
print(r.json())


def main():
number, sha, term = create()
if term:
sys.exit(0)

time.sleep(10) # sleep, then comment
auto_merge(number, sha)


if __name__ == "__main__":
main()
65 changes: 65 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Copyright (c) 2020, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# A workflow to create PR to update CHANGELOG nightly
name: CHANGELOG generation nightly

on:
pull_request_target:
branches:
- branch-0.2
types: [closed]

jobs:
changelog-gen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Update CHANGELOG.md
id: upt
#run: echo "::set-output name=stdout::$(.github/workflows/changelog/changelog --base_refs=branch-0.1,branch-0.2,branch-0.3)"
if: github.event.pull_request.merged == true
uses: ./.github/workflows/changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get date
id: dt
if: ${{ success() }}
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"

- name: Create PR
if: github.event.pull_request.merged == true
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "changelog-gen ${{ steps.dt.outputs.date }}"
committer: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: true
branch: changelog-night-update
title: '[DOC] Changelog update ${{ steps.dt.outputs.date }} [skip ci] [bot]'
body: |
changelog-gen runs on ${{ steps.dt.outputs.date }}

check script stdout: [job_run_${{ github.run_id }}](https://github.com/pxLi/spark-rapids/actions/runs/${{ github.run_id }})

Please review the generated CHANGELOG.md, then merge or close the PR and feel free to **delete** the remote branch.
labels: |
documentation
team-reviewers: |
owners
maintainers
draft: false
21 changes: 21 additions & 0 deletions .github/workflows/changelog/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c) 2020, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM python:alpine

WORKDIR /
COPY changelog .
RUN pip install requests && chmod +x /changelog

ENTRYPOINT ["/changelog", "--releases=0.1,0.2,0.3"]
9 changes: 9 additions & 0 deletions .github/workflows/changelog/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# action.yml
name: 'changelog action'
description: 'generate the changelog'
outputs:
stdout: # id of output
description: 'logs'
runs:
using: 'docker'
image: 'Dockerfile'
Loading