Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.

chore: support filtering the upstream cause in the isUpstreamTrigger step#1031

Merged
mdelapenya merged 10 commits intoelastic:masterfrom
mdelapenya:is-upstream-pr-trigger-step
Mar 11, 2021
Merged

chore: support filtering the upstream cause in the isUpstreamTrigger step#1031
mdelapenya merged 10 commits intoelastic:masterfrom
mdelapenya:is-upstream-pr-trigger-step

Conversation

@mdelapenya
Copy link
Copy Markdown
Contributor

@mdelapenya mdelapenya commented Mar 11, 2021

What does this PR do?

It updates the isUpstreamTrigger step to identify whether the upstream trigger was caused by a PR or not, passing a filter in a backwards compatible mode.

As @v1v suggested during the review, consumers will use the step exactly the same as before, but now supporting a filter string parameter:

whenTrue(isUpstreamTrigger()) {
   //
}

whenTrue(isUpstreamTrigger(filter: 'PR-')) {
  //
}

Why is it important?

In certain cases, we want the downstream job to act in a different manner for PRs than for branches, like selecting a subset of the downstream project's test suite.

Related issues

Relates elastic/e2e-testing#873

@mdelapenya mdelapenya self-assigned this Mar 11, 2021
@mdelapenya mdelapenya requested a review from a team March 11, 2021 09:51
Comment thread vars/isUpstreamPRTrigger.groovy Outdated
@ghost
Copy link
Copy Markdown

ghost commented Mar 11, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #1031 updated

  • Start Time: 2021-03-11T12:30:59.029+0000

  • Duration: 8 min 6 sec

  • Commit: dd564f6

Test stats 🧪

Test Results
Failed 0
Passed 1066
Skipped 2
Total 1068

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 1066
Skipped 2
Total 1068

@mdelapenya mdelapenya requested a review from v1v March 11, 2021 11:59
@mdelapenya mdelapenya marked this pull request as ready for review March 11, 2021 12:02
@mdelapenya mdelapenya changed the title feat: add isUpstreamPRTrigger step chore: support filtering the upstream cause in the isUpstreamTrigger step Mar 11, 2021
Comment thread vars/isUpstreamTrigger.groovy Outdated
@botelastic botelastic Bot added the groovy label Mar 11, 2021
mdelapenya and others added 2 commits March 11, 2021 13:12
Co-authored-by: Ivan Fernandez Calvo <kuisathaverat@users.noreply.github.com>
Comment thread vars/isUpstreamTrigger.groovy
Comment thread vars/isUpstreamTrigger.txt
Copy link
Copy Markdown
Member

@v1v v1v left a comment

Choose a reason for hiding this comment

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

+1 after the docs change

Comment thread vars/README.md Outdated
Comment thread vars/isUpstreamTrigger.groovy Outdated
@mdelapenya mdelapenya merged commit 3645309 into elastic:master Mar 11, 2021
@mdelapenya mdelapenya added the enhancement New feature or request label Mar 11, 2021
v1v added a commit that referenced this pull request Mar 11, 2021
* upstream/master: (27 commits)
  docs: update CHANGELOG.md
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release v1.1.201
  chore: support filtering the upstream cause in the isUpstreamTrigger step (#1031)
  Slack notification with the total build time (#1033)
  docs: update CHANGELOG.md
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release v1.1.200
  Add withNode step (#1030)
  docs: update CHANGELOG.md
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release v1.1.199
  Add isStaticWorker step (#1028)
  docs: update CHANGELOG.md
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release v1.1.198
  add noTags - fixes #1024 (#1025)
  docs: update CHANGELOG.md
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release v1.1.197
  ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants