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] Monorepo diff plugin for integration tests #4906

Merged
merged 18 commits into from
Jun 13, 2024
Merged

Conversation

pazone
Copy link
Contributor

@pazone pazone commented Jun 11, 2024

What does this PR do?

Use monorepo diff plugin to run integration tests for pull requests and branches.
The plugin specifies a list of watched paths for pull requests. If a PR modifies files under a path from the list - integration tests will be executed.

The main pipeline triggers elastic-agent-extended-testing if all conditions are met:

  • At least one of the listed paths is modified by a PR
  • skip-it label is not set

When a PR is merged to main or a release branch the integration tests will be triggered in any case

That's how it looks now:

Screenshot 2024-06-12 at 15 47 30

Why is it important?

The previous approach wasn't flexible enough and the separate integration testing pipeline didn't allow to run integration tests conditionally due to required checks limitation.

Important: if we add skip-it label - the PR will be mergeable without running integration tests.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool
  • I have added an integration test or an E2E test

Additional checks

  • Draft PRs shouldn't trigger integration tests by default (Need to enhance buildkite-pr-bot and pass GITHUB_PULL_REQUEST_DRAFT env variable to the build)
  • /test comment must trigger unit and integration tests also for draft PRs
  • A PR modifying the files from watch list must run integration tests
  • If a PR doesn't modify the listed files integration tests shouldn't be launched
  • A PR labeled with skip-it must not trigger integration tests

Disruptive User Impact

How to test this PR locally

Related issues

Questions to ask yourself

  • How are we going to support this in production?
  • How are we going to measure its adoption?
  • How are we going to debug this?
  • What are the metrics I should take care of?
  • ...

@pazone pazone added enhancement New feature or request Team:Ingest-EngProd labels Jun 11, 2024
Copy link
Contributor

mergify bot commented Jun 11, 2024

This pull request does not have a backport label. Could you fix it @pazone? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 8./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@pazone pazone added the skip-it Skips integration tests for a PR label Jun 11, 2024
@pazone
Copy link
Contributor Author

pazone commented Jun 11, 2024

/test

@pazone pazone removed the skip-it Skips integration tests for a PR label Jun 11, 2024
@pazone
Copy link
Contributor Author

pazone commented Jun 11, 2024

/test

1 similar comment
@pazone
Copy link
Contributor Author

pazone commented Jun 12, 2024

/test

@pazone
Copy link
Contributor Author

pazone commented Jun 12, 2024

/test

@pazone
Copy link
Contributor Author

pazone commented Jun 12, 2024

/test

@pazone pazone added the backport-v8.14.0 Automated backport with mergify label Jun 12, 2024
@mergify mergify bot removed the backport-skip label Jun 12, 2024
@pazone pazone marked this pull request as ready for review June 12, 2024 14:09
@pazone pazone requested a review from a team as a code owner June 12, 2024 14:09
@pazone pazone requested review from michalpristas and pchila June 12, 2024 14:09
Copy link
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

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

Looks good.

@pazone
Copy link
Contributor Author

pazone commented Jun 12, 2024

@cmacknz @blakerouse @rdner Could you please take a look at the list of watched paths?

@pazone pazone requested a review from cmacknz June 12, 2024 14:34
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@pazone pazone merged commit fd8d1ee into main Jun 13, 2024
14 checks passed
@pazone pazone deleted the ci_integration_trigger_fix branch June 13, 2024 10:03
mergify bot pushed a commit that referenced this pull request Jun 13, 2024
* [CI] Monorepo diff plugin for integration tests

* [CI] Monorepo diff plugin for integration tests

* [CI] Monorepo diff plugin for integration tests

* [CI] Monorepo diff plugin for integration tests

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Cleanup

* Cleanup

* added missing watch paths

(cherry picked from commit fd8d1ee)

# Conflicts:
#	.buildkite/pull-requests.json
rdner pushed a commit that referenced this pull request Jun 14, 2024
#4922)

* [CI] Monorepo diff plugin for integration tests (#4906)

* [CI] Monorepo diff plugin for integration tests

* [CI] Monorepo diff plugin for integration tests

* [CI] Monorepo diff plugin for integration tests

* [CI] Monorepo diff plugin for integration tests

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Cleanup

* Cleanup

* added missing watch paths

(cherry picked from commit fd8d1ee)

# Conflicts:
#	.buildkite/pull-requests.json

* Fixed conflicts

* Fixed conflicts

---------

Co-authored-by: Pavel Zorin <pavel.zorin@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.14.0 Automated backport with mergify enhancement New feature or request skip-changelog Team:Ingest-EngProd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants