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

feat: improve e2e on PR process #3033

Merged
merged 10 commits into from
May 12, 2022
Merged
Show file tree
Hide file tree
Changes from 7 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
19 changes: 19 additions & 0 deletions .github/workflows/pr-e2e-pr-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: e2e-on-pr-validation
on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled

jobs:
validate-e2e-labels:
name: Check e2e labels
runs-on: ubuntu-latest
steps:
- uses: docker://agilepathway/pull-request-label-checker:latest
with:
any_of: ok-to-merge
repo_token: ${{ secrets.GITHUB_TOKEN }}
48 changes: 39 additions & 9 deletions .github/workflows/pr-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,19 @@ jobs:
runs-on: ubuntu-latest
name: Comment evaluate
outputs:
run-e2e: ${{ startsWith(github.event.comment.body,'/run-e2e') && steps.check-permission.outputs.has-permission }}
run-e2e: ${{ startsWith(github.event.comment.body,'/run-e2e') && steps.checkUserMember.outputs.isTeamMember == 'true' }}
pr_num: ${{ steps.parser.outputs.pr_num }}
image_tag: "pr-${{ steps.parser.outputs.pr_num }}-${{ github.event.comment.id }}"
steps:
- name: Check user permission
if: startsWith(github.event.comment.body,'/run-e2e')
id: check-permission
uses: scherermichael-oss/action-has-permission@master
- uses: tspascoal/get-user-teams-membership@v1
id: checkUserMember
with:
required-permission: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
username: ${{ github.actor }}
team: 'keda-e2e-test-executors'
GITHUB_TOKEN: ${{ secrets.GH_CHECKING_USER_AUTH }}

- name: Update comment with the execution url
if: ${{ startsWith(github.event.comment.body,'/run-e2e') && steps.check-permission.outputs.has-permission }}
if: ${{ startsWith(github.event.comment.body,'/run-e2e') && steps.checkUserMember.outputs.isTeamMember == 'true' }}
uses: peter-evans/create-or-update-comment@v2
with:
comment-id: ${{ github.event.comment.id }}
Expand All @@ -44,6 +42,16 @@ jobs:
container: ghcr.io/kedacore/build-tools:main
if: needs.triage.outputs.run-e2e == '1'
steps:
- uses: actions/github-script@v6
name: Remove ok-to-merge label
with:
script: |
github.rest.issues.removeAllLabels({
JorTurFer marked this conversation as resolved.
Show resolved Hide resolved
issue_number: ${{ steps.parser.outputs.pr_num }},
owner: context.repo.owner,
repo: context.repo.repo,
})

- uses: actions/checkout@v3

- name: Checkout Pull Request
Expand Down Expand Up @@ -77,6 +85,16 @@ jobs:
concurrency: pr-e2e-tests
if: needs.triage.outputs.run-e2e == '1'
steps:
- uses: actions/github-script@v6
name: Remove ok-to-merge label
with:
script: |
github.rest.issues.removeAllLabels({
JorTurFer marked this conversation as resolved.
Show resolved Hide resolved
issue_number: ${{ steps.parser.outputs.pr_num }},
owner: context.repo.owner,
repo: context.repo.repo,
})

- uses: actions/checkout@v3

- name: Checkout Pull Request
Expand Down Expand Up @@ -158,6 +176,18 @@ jobs:
commentId: ${{ github.event.comment.id }}
reaction: "+1"

- uses: actions/github-script@v6
if: steps.test.outcome == 'success'
name: Add ok-to-merge label
with:
script: |
github.rest.issues.addLabels({
issue_number: ${{ needs.triage.outputs.pr_num }},
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['ok-to-merge']
JorTurFer marked this conversation as resolved.
Show resolved Hide resolved
})

- name: React to comment with failure
uses: dkershner6/reaction-action@v1
if: steps.test.outcome != 'success'
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ To learn more about our roadmap, we recommend reading [this document](ROADMAP.md

### Other

- TODO ([#XXX](https://github.com/kedacore/keda/issue/XXX))
- **General:** Improve e2e on PR process. ([3004](https://github.com/kedacore/keda/issues/3004))

## v2.7.1

Expand Down