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

Ignore backport / autocut / dependabot branches for gradle checks on push #3816

Conversation

peterzhuamazon
Copy link
Member

Signed-off-by: Peter Zhu zhujiaxi@amazon.com

Description

Ignore backport / autocut / dependentbot branches for gradle checks.
These branches come and go and are not long-lived, thus no reason to even run gradle check on push.
They can run gradle check on pull_request_target event.

Issues Resolved

opensearch-project/opensearch-build#851

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
@peterzhuamazon peterzhuamazon added the enhancement Enhancement or improvement to existing feature or request label Jul 7, 2022
@peterzhuamazon peterzhuamazon requested review from a team and reta as code owners July 7, 2022 22:10
@peterzhuamazon peterzhuamazon self-assigned this Jul 7, 2022
@peterzhuamazon peterzhuamazon changed the title Ignore backport / autocut / dependentbot branches for gradle checks on push Ignore backport / autocut / dependabot branches for gradle checks on push Jul 7, 2022
@peterzhuamazon peterzhuamazon added backport 1.x backport 2.x Backport to 2.x branch backport 2.0 Backport to 2.0 branch backport 1.3 Backport to 1.3 branch backport 2.1 labels Jul 7, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2022

Gradle Check (Jenkins) Run Completed with:

@dreamer-89 dreamer-89 requested review from adnapibar and mch2 July 7, 2022 23:52
@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2022

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2022

Gradle Check (Jenkins) Run Completed with:

Copy link
Member

@andrross andrross left a comment

Choose a reason for hiding this comment

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

This looks good to me, but I have a related question...

We run the gradle check workflow when a PR is created against one of the mainstream branches, but we also run the check again when the merge is made? Is that right?

@peterzhuamazon
Copy link
Member Author

peterzhuamazon commented Jul 8, 2022

This looks good to me, but I have a related question...

We run the gradle check workflow when a PR is created against one of the mainstream branches, but we also run the check again when the merge is made? Is that right?

Hi @andrross,

Exactly.

  1. PR created/updated/reopened will trigger gradle check against the HEAD commit as part of pull_request_target event.
  2. PR merged will trigger gradle check against the branch merged to as part of push event.

That is the point of this change so backport/depandabot/autocut will still trigger 1 and 2, while ignore the trigger towards those temp branches used to just create the PR.

Thanks.

@andrross
Copy link
Member

andrross commented Jul 8, 2022

Thanks @peterzhuamazon!

PR merged will trigger gradle check against the branch merged to as part of push event.

I know this is a bit off topic, but I'm curious about exactly how this works. Does it happen before or after the push? What happens if it fails? If there's any documentation please let me know and I can RTFM :)

@andrross andrross merged commit 360f4f6 into opensearch-project:main Jul 8, 2022
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 8, 2022
…3816)

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
(cherry picked from commit 360f4f6)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 8, 2022
…3816)

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
(cherry picked from commit 360f4f6)
@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2022

Gradle Check (Jenkins) Run Completed with:

@peterzhuamazon
Copy link
Member Author

peterzhuamazon commented Jul 8, 2022

Thanks @peterzhuamazon!

PR merged will trigger gradle check against the branch merged to as part of push event.

I know this is a bit off topic, but I'm curious about exactly how this works. Does it happen before or after the push? What happens if it fails? If there's any documentation please let me know and I can RTFM :)

Hi @andrross,

if people creating a PR from their fork, due to the branch used to open PR is on fork, only PR event trigger gradle check, push wont.
Once PR merged due to the branch they merge to have a push happens, push event trigger.

if people creating a PR with a branch directly in this repo (aka dependabot, backport), due to those branches are created fresh, their 1st creation is considered a fresh push, thus trigger push. And since they also have PR thus trigger PR event. This means 2 gradle check and the push one is unnecessary.

There is literally a workflow in this repo to remove backport branches periodically therefore no need to even run those push events on these backport/dependabot branches.

Thanks.

@peterzhuamazon peterzhuamazon deleted the gradle-check-ignore-branches-2 branch July 8, 2022 18:07
@andrross
Copy link
Member

andrross commented Jul 8, 2022

I'm curious about the gradle check workflow that happens upon merge into main once the PR is approved. I see that the gradle check failed for the workflow that ran after this PR was merged. How are these failures supposed to be handled? In this case it seems to be an existing flaky test (#3579) but if it was a problem caused by the merge is there any mechanism to handle it?

peterzhuamazon added a commit that referenced this pull request Jul 8, 2022
…3816) (#3828)

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
(cherry picked from commit 360f4f6)

Co-authored-by: Peter Zhu <zhujiaxi@amazon.com>
peterzhuamazon added a commit that referenced this pull request Jul 8, 2022
…3816) (#3827)

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
(cherry picked from commit 360f4f6)

Co-authored-by: Peter Zhu <zhujiaxi@amazon.com>
peterzhuamazon added a commit that referenced this pull request Jul 8, 2022
…3816) (#3825)

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
(cherry picked from commit 360f4f6)

Co-authored-by: Peter Zhu <zhujiaxi@amazon.com>
peterzhuamazon added a commit that referenced this pull request Jul 8, 2022
…3816) (#3824)

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
(cherry picked from commit 360f4f6)

Co-authored-by: Peter Zhu <zhujiaxi@amazon.com>
CEHENKLE pushed a commit that referenced this pull request Jul 8, 2022
…3816) (#3826)

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
(cherry picked from commit 360f4f6)

Co-authored-by: Peter Zhu <zhujiaxi@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.x backport 1.3 Backport to 1.3 branch backport 2.x Backport to 2.x branch backport 2.0 Backport to 2.0 branch backport 2.1 enhancement Enhancement or improvement to existing feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants