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

[ci] Don't trigger BK PR jobs on pushes #15426

Merged
merged 2 commits into from
Oct 11, 2023

Conversation

dliappis
Copy link
Contributor

Release notes

[rn:skip]

What does this PR do?

Currently while PR jobs get triggered as expected in Buildkite via the bot, they also get re-triggered after something gets pushed, including e.g. the squash merge commit when the PR is merged.

This commit disables this behavior as documented in Buildkite1.

Related issues

Footnotes

  1. https://buildkite.com/docs/apis/rest-api/pipelines

Currently while PR jobs get triggered as expected in Buildkite via
the bot, they also get re-triggered after something gets pushed,
including e.g. the squash merge commit when the PR is merged.

This commit disables this behavior as documented in Buildkite[^1].

Relates:

- elastic#15402
- elastic/ingest-dev#1721

[^1]: https://buildkite.com/docs/apis/rest-api/pipelines
@@ -243,7 +243,8 @@ spec:
provider_settings:
build_pull_request_forks: false
build_pull_requests: true # requires filter_enabled and filter_condition settings as below when used with buildkite-pr-bot
build_tags: true
build_branches: false
build_tags: false
filter_enabled: true
filter_condition: >-
build.pull_request.id == null || (build.creator.name == 'elasticmachine' && build.pull_request.id != null)

Choose a reason for hiding this comment

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

This might need adjustment as well. As the filter condition indicates, it will allow the pipeline to trigger when there is no build.pull_request.id which is the case of a branch commit in the base branch, and allow to trigger the pipeline when the creator iselasticmachine for the event of a PR.

I would change this and keep only the right side of the || meaning

Suggested change
build.pull_request.id == null || (build.creator.name == 'elasticmachine' && build.pull_request.id != null)
build.creator.name == 'elasticmachine' && build.pull_request.id != null

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you! Addressed in d23aa37

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed offline, I left build_branches and build_tags set to false as well.

@dliappis dliappis requested a review from alexsapran October 11, 2023 08:27
@elastic-sonarqube
Copy link

SonarQube Quality Gate

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@dliappis dliappis merged commit d4eccd2 into elastic:main Oct 11, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants