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
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
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 }}
41 changes: 32 additions & 9 deletions .github/workflows/pr-e2e.yml
Original file line number Diff line number Diff line change
@@ -2,26 +2,28 @@ name: pr-e2e-tests
on:
issue_comment:
types: [created]

env:
E2E_LABEL: ok-to-merge

jobs:
triage:
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 }}
@@ -46,6 +48,13 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Remove label
id: remove
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr edit ${{ needs.triage.outputs.pr_num }} --remove-label '${{ env.E2E_LABEL}}'
- name: Checkout Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -79,6 +88,13 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Remove label
id: remove
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr edit ${{ needs.triage.outputs.pr_num }} --remove-label '${{ env.E2E_LABEL}}'
- name: Checkout Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -158,6 +174,13 @@ jobs:
commentId: ${{ github.event.comment.id }}
reaction: "+1"

- name: Remove label
id: remove
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr edit ${{ needs.triage.outputs.pr_num }} --add-label '${{ env.E2E_LABEL}}'
- name: React to comment with failure
uses: dkershner6/reaction-action@v1
if: steps.test.outcome != 'success'
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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