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

chore: Automatically add labels for all e2e-tests stages to PRs #3048

Closed
wants to merge 8 commits into from

Conversation

tomkerkhove
Copy link
Member

@tomkerkhove tomkerkhove commented May 16, 2022

Automatically add labels for all e2e-tests stages to PRs:

  • Automatically add 'e2e-tests/not-run' label to new PRs
  • Automatically add 'e2e-tests/failed-run' when tests have failed for a PR
  • Automatically add 'e2e-tests/running' when tests are running for a PR
  • Rename ok-to-merge to e2e-tests/ok-to-merge so that it's clear to end-users what the label stands for.

Checklist

  • Commits are signed with Developer Certificate of Origin (DCO - learn more)

@tomkerkhove tomkerkhove requested a review from a team as a code owner May 16, 2022 06:25
@tomkerkhove tomkerkhove requested a review from JorTurFer May 16, 2022 06:25
@JorTurFer
Copy link
Member

JorTurFer commented May 16, 2022

I agree with the renaming of the label, but I'm not sure if adding a second label is worth 🤔
I mean, having two labels we have to manage both during the e2e tests

@tomkerkhove
Copy link
Member Author

It allows for easier to see if the tests have ran or not and filtering IMO. Also, end-users know there are e2e tests that can be ran if they want to

Signed-off-by: Tom Kerkhove <[email protected]>
@tomkerkhove
Copy link
Member Author

I would even introduce a e2e-tests/failed to indicate that tests failed.

@tomkerkhove tomkerkhove changed the title chore: Automatically add 'e2e-tests/not-run' label to new PRs chore: Automatically add labels for all e2e-tests stages to PRs May 16, 2022
@tomkerkhove
Copy link
Member Author

tomkerkhove commented May 16, 2022

I went even further @JorTurFer to show all stages :)

  • Automatically add 'e2e-tests/not-run' label to new PRs
  • Automatically add 'e2e-tests/failed-run' when tests have failed for a PR
  • Automatically add 'e2e-tests/running' when tests are running for a PR
  • Rename ok-to-merge to e2e-tests/ok-to-merge so that it's clear to end-users what the label stands for.

That way, contributors have a better understanding of what is going on in addition to the comment that has the link.

This allows them to have a quick idea where it is, without having to go in details.

@zroubalik
Copy link
Member

zroubalik commented May 16, 2022

Is there any real benefit behind adding this complexity? Also I think that the original name was chosen because sometimes you'd like to mark the PR as ok even without running the e2e. For example if it is adding some stuff where it doesn't make sense to run e2e.

on:
pull_request:
types:
- opened
Copy link
Member

Choose a reason for hiding this comment

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

Should we do this also in reopen?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd keep the current label state as the test might have already ran successfully, no?

Comment on lines +95 to +125
- name: Remove '${{ env.E2E_LABELS_NOTRUN}}' label
id: remove-not-run-label
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
gh pr edit ${{ needs.triage.outputs.pr_num }} --remove-label '${{ env.E2E_LABELS_NOTRUN}}'

- name: Remove '${{ env.E2E_LABELS_PASSED}}' label
id: remove-pass-label
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
gh pr edit ${{ needs.triage.outputs.pr_num }} --remove-label '${{ env.E2E_LABELS_PASSED}}'

- name: Remove '${{ env.E2E_LABELS_FAILED }}' label
id: remove-failed-label
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
gh pr edit ${{ needs.triage.outputs.pr_num }} --remove-label '${{ env.E2E_LABEL}}'
gh pr edit ${{ needs.triage.outputs.pr_num }} --remove-label '${{ env.E2E_LABELS_FAILED }}'

- name: Add '${{ env.E2E_LABELS_RUNNING }}' label
id: add-running-label
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
gh pr edit ${{ needs.triage.outputs.pr_num }} --add-label '${{ env.E2E_LABELS_RUNNING }}'
Copy link
Member

Choose a reason for hiding this comment

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

Should we merge these 3 steps into a single one? We can reduce a lot of lines just appending the gh lines to one of them

Copy link
Member Author

@tomkerkhove tomkerkhove May 16, 2022

Choose a reason for hiding this comment

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

Good idea, but will see if we want this based on the main conversation

id: remove-label
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
gh pr edit ${{ needs.triage.outputs.pr_num }} --remove-label '${{ env.E2E_LABEL}}'
gh pr edit ${{ needs.triage.outputs.pr_num }} --remove-label '${{ env.E2E_LABELS_PASSED}}'
Copy link
Member

Choose a reason for hiding this comment

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

Should we add here other labels like not-run?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea, but will see if we want this based on the main conversation

@tomkerkhove
Copy link
Member Author

Is there any real benefit behind adding this complexity?

Yes, #3048 (comment) & #3048 (comment) - It's basically to make it more contributor-friendly as not everyone knows how the whole e2e tests work.

Also, if you are checking the PR list it doesn't give you an idea how they are doing in terms of tests.

But if I'm the only one then I'm happy to drop this.

Also I think that the original name was chosen because sometimes you'd like to mark the PR as ok even without running the e2e. For example if it is adding some stuff where it doesn't make sense to run e2e.

That's a fair ask - Happy to revert

@JorTurFer
Copy link
Member

I have to recognize that seeing how it looks in k8s repo I get better your point, but I still have doubts about if this is overkill for us.
I mean, the amount of contributors we have right now is small, but it's true this could be a reason for contributing more than once... My only concert is how much complex the workflows will turn into if we have to manage 4 different labels right now. When we move the e2e test to Golang, probably this will be easier because it could be managed by code (I hope) instead of by actions in the workflow

@tomkerkhove
Copy link
Member Author

I have to recognize that seeing how it looks in k8s repo I get better your point, but I still have doubts about if this is overkill for us. I mean, the amount of contributors we have right now is small, but it's true this could be a reason for contributing more than once...

This is indeed to provide a more robust approach as we've seen growth in PRs and contributors lately.

My only concert is how much complex the workflows will turn into if we have to manage 4 different labels right now.

I think this PR is doing an OK job in managing them, no? I think it's fairly simple to do this at the moment.

When we move the e2e test to Golang, probably this will be easier because it could be managed by code (I hope) instead of by actions in the workflow

Why would this be different if we have our tests in Go vs JS? The PR experience is still the same, or am I missing something?

@tomkerkhove
Copy link
Member Author

#3071 is a lot better, abandon 🚢

@tomkerkhove tomkerkhove deleted the tomkerkhove-patch-1 branch May 31, 2022 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants