Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

CI: separate JJBB definitions for pull requests, PR merge and external e2e calls #3253

Merged
merged 8 commits into from
Dec 2, 2022

Conversation

pazone
Copy link
Contributor

@pazone pazone commented Nov 30, 2022

What does this PR do?

Creates 3 separate JJBB workflows:

  1. e2e-testing-mbp.yml - For external e2e tests executions ONLY. When another pipeline triggers the tests
  2. e2e-testing-pr-mbp.yml - For pull requests to this repo ONLY
  3. e2e-testing-pr-merge-mbp.yml - For PR merges to main ,8.x or 7.17

Why is it important?

Single Jenkinsfile for all operations is overcomplicated

Related issues

@pazone pazone requested a review from v1v November 30, 2022 15:52
@mergify
Copy link
Contributor

mergify bot commented Nov 30, 2022

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 7./d branch. /d is the digit
    NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Nov 30, 2022
@pazone pazone added backport-v8.0.0 Automated backport with mergify backport-v8.3.0 Automated backport with mergify backport-v8.1.0 Automated backport with mergify backport-v8.2.0 Automated backport with mergify backport-v7.17.0 Automated backport with mergify backport-v8.4.0 Automated backport with mergify backport-v8.5.0 Automated backport with mergify backport-v8.6.0 Automated backport with mergify labels Nov 30, 2022
@mergify mergify bot removed the backport-skip Skip notification from the automated backport with mergify label Nov 30, 2022
@elasticmachine
Copy link
Contributor

elasticmachine commented Nov 30, 2022

❕ Build Aborted

There is a new build on-going so the previous on-going builds have been aborted.

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

  • Start Time: 2022-12-02T11:35:15.431+0000

  • Duration: 4 min 33 sec

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@v1v
Copy link
Member

v1v commented Nov 30, 2022

there is no need to backport the jjb files

@v1v v1v removed backport-v8.0.0 Automated backport with mergify backport-v8.3.0 Automated backport with mergify backport-v8.1.0 Automated backport with mergify backport-v8.2.0 Automated backport with mergify backport-v7.17.0 Automated backport with mergify backport-v8.4.0 Automated backport with mergify backport-v8.5.0 Automated backport with mergify backport-v8.6.0 Automated backport with mergify labels Nov 30, 2022
@v1v v1v added the backport-skip Skip notification from the automated backport with mergify label Nov 30, 2022
Copy link
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.

What's the reason for using two new MBPs rather than the traditional MBP with the same pipeline for branches and PRs?

@pazone
Copy link
Contributor Author

pazone commented Nov 30, 2022

What's the reason for using two new MBPs rather than the traditional MBP with the same pipeline for branches and PRs?

@v1v To have separate Jenkinsfiles. Can we use one jjb for multiple pipeline scripts?

@kuisathaverat
Copy link
Contributor

kuisathaverat commented Nov 30, 2022

What's the reason for using two new MBPs rather than the traditional MBP with the same pipeline for branches and PRs?

We need a pipeline job per branch and PR so MBP fit the use case. Also, the MBP creates the jobs on GitHub events and registers the triggers, with regular pipelines in case of reprovision of the instance we will lose the triggers and we have to manually trigger the jobs. It is not the real reason why @pazone did it, but it is a good reason to do it for jobs that have triggers.

@v1v
Copy link
Member

v1v commented Nov 30, 2022

We need a pipeline job per branch and PR so MBP fit the use case.

I don't understand the reason yet for two different Multibranch pipelines, one related to the PRs and another one for the branches.

I understand there is no need to use a single pipeline but MBP instead.

As far as I see, the proposal for PRs and branches could be merged in the same multibranch pipeline, aka MBP, as we normally do in other places.

Can you please elaborate what's the difference between the merge.groovy and pull-request.groovy files? And what's the reason they cannot be merged in one groovy` file instead?

@pazone
Copy link
Contributor Author

pazone commented Nov 30, 2022

We need a pipeline job per branch and PR so MBP fit the use case.

I don't understand the reason yet for two different pipelines one related to the PRs and another one for the branches.

As far as I see, the proposal for PRs and branches could be merged in the same pipeline as we normally do in other places.

Can you please elaborate what's the difference between the merge.groovy and pull-request.groovy files? And what's the reason they cannot be merged in one groovy` file instead?

@v1v pull request flow will be a bit more complicated.
If ansible stuff is changed it will build temporary AMIs, run tests using new VMs and deregister the AMIs
Merge workflow builds and publishes new AMIs marked as ready to use .ci/ansible is changed.
It's made in order to avoid code complexity and make pipelines straightforward.

@v1v
Copy link
Member

v1v commented Dec 1, 2022

If ansible stuff is changed it will build temporary AMIs, run tests using new VMs and deregister the AMIs

If no ansible stuff is changed, what's the flow in place for both cases (prs and branches)?

IIUC, those are not independent pipelines but stages, will something like the below pseudo-code could work?

stage('prs') {
...
}
stage('branches') {
...
}

I somehow prefer to use the same pipeline for branches and PRs. Maybe there is a need to:

  • One pipeline for ansible stuff, regardless of the type of changes (PRs or branches)
  • Another pipeline for non-ansible stuff, regardless of the type of changes (PRs or branches)

And the pipeline ansible stuff will trigger the non-ansible stuff so it can test other things given the AMIs.

I'm just guessing, as I don't know the implementation details about the pipeline specifics.

In any case, I'm not blocking this PR, but commenting about this

branch-discovery: no-pr
head-filter-regex: '(main|PR-.*|8\.\d+|7\.17|feature-.*)'
head-filter-regex: '(main|8\.\d+|7\.17|feature-.*)'
Copy link
Contributor

@kuisathaverat kuisathaverat Dec 1, 2022

Choose a reason for hiding this comment

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

this changes the current behavior on the stable branch without a change in the pipelines, this breaks the CI. the PR will not be processed until all new pipelines are develop.

Copy link
Contributor

Choose a reason for hiding this comment

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

A proposal here, do not touch the main pipeline (.ci/jobs/e2e-testing-mbp.yml) until everything is working. So, create a new file like this one with a different job.name, and use it until you have a process refined and working. For that, you will have to limit the head-filter-regex to a specific branch(where you are working) and PR (only your test PRs). then we can see which changes we can incorporate on the main branch without issues.

Copy link
Contributor

Choose a reason for hiding this comment

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

WYT @v1v

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kuisathaverat Great solution! Could you please take a look now?

Copy link
Contributor

Choose a reason for hiding this comment

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

we still making changes in .ci/jobs/e2e-testing-mbp.yml that is something we do not want

@kuisathaverat kuisathaverat self-requested a review December 1, 2022 12:59
@@ -9,7 +9,7 @@
scm:
- github:
branch-discovery: no-pr
head-filter-regex: '(main|8\.\d|7\.17|feature-.*)'
head-filter-regex: '(main|PR-.*|8\.\d|7\.17|feature-.*)'
Copy link
Contributor

Choose a reason for hiding this comment

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

no here

@@ -1,8 +1,8 @@
---
Copy link
Contributor

Choose a reason for hiding this comment

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

create a new job from scratch

branch-discovery: no-pr
head-filter-regex: '(main|PR-.*|8\.\d+|7\.17|feature-.*)'
head-filter-regex: '(main|8\.\d+|7\.17|feature-.*)'
Copy link
Contributor

Choose a reason for hiding this comment

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

limit the branches to your working branches and PRs

@pazone pazone merged commit 756d28c into elastic:main Dec 2, 2022
@elasticmachine
Copy link
Contributor

💔 Build Failed

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

Expand to view the summary

Build stats

  • Start Time: 2022-12-02T11:36:43.696+0000

  • Duration: 9 min 51 sec

Pipeline error 1

This error is likely related to the pipeline itself. Click here
and then you will see the error (either incorrect syntax or an invalid configuration).

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport-skip Skip notification from the automated backport with mergify
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants