Skip to contentSkip to conversation

Xen project CI systems and committer workflow

DISCUSSION Wei Liu 8 participants 16 messages Apr 18, 2019 – Apr 30, 2019

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

Hi all

We now have Gitlab CI as a complementary system to Osstest and have planned to add bots. It's high time we think about how we integrate them and how it may improve our workflow.

## Requirements

1. We want to have light weight build tests before a patch series is reviewed or committed.

2. We don't want to push broken patches to central repository such that everyone is blocked.

3. We don't want to significantly change committer workflow.

Requirement 2 means that our current branching model will need to be changed. Details will follow.

## Overview of automation systems

- Gitlab CI

It is capable of running build tests with relatively short turnaround time.

- Bots like Patchew and Patchwork

They are able to slurp patches from xen-devel and maybe run customised scripts on those patches.

- Osstest

Pushgate, integration test system. It runs more sophisticated tests compared to Gitlab CI. Turnaround time is long.

## New world

There will be an unified endpoint for committers and bots. Committers and bots will have their git trees. Patches are committed to those trees. An automated system will get patches from those trees and trigger CI runs.

The system will pick up commits from one of the trees, merge them with master and send the merge to CI systems.

For bots, only Gitlab CI build tests will run. Results are sent back to xen-devel.

For committers' trees, at first Gitlab CI build tests are run, if the result is successful, the merge commit is submitted to osstest. If osstest deems the merge is good, the merge is pushed (published) to xen.git, otherwise the merge is discarded. Test results are sent back to xen-devel.

With this system, all published commits should have already passed Gitlab CI and osstest tests.

## Gaps

The component / system which merges trees and drives CI systems is missing.

Patchew and Patchwork don't do all the things we care about yet.

## Concerns

For individual committers, turnaround time may become longer since you need to wait for other trees to be processed.

Gitlab CI doesn't have a self pushgate. If it is broken by accident Osstest will be blocked.

Thoughts and comments?

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

author
#1 lore raw

Cc Anthony as well. Forgot to do that. Sorry.

Quoted 66 lines · Wei Liu

Hi all

We now have Gitlab CI as a complementary system to Osstest and have planned to add bots. It's high time we think about how we integrate them and how it may improve our workflow.

## Requirements

1. We want to have light weight build tests before a patch series is reviewed or committed.

2. We don't want to push broken patches to central repository such that everyone is blocked.

3. We don't want to significantly change committer workflow.

Requirement 2 means that our current branching model will need to be changed. Details will follow.

## Overview of automation systems

- Gitlab CI

It is capable of running build tests with relatively short turnaround time.

- Bots like Patchew and Patchwork

They are able to slurp patches from xen-devel and maybe run customised scripts on those patches.

- Osstest

Pushgate, integration test system. It runs more sophisticated tests compared to Gitlab CI. Turnaround time is long.

## New world

There will be an unified endpoint for committers and bots. Committers and bots will have their git trees. Patches are committed to those trees. An automated system will get patches from those trees and trigger CI runs.

The system will pick up commits from one of the trees, merge them with master and send the merge to CI systems.

For bots, only Gitlab CI build tests will run. Results are sent back to xen-devel.

For committers' trees, at first Gitlab CI build tests are run, if the result is successful, the merge commit is submitted to osstest. If osstest deems the merge is good, the merge is pushed (published) to xen.git, otherwise the merge is discarded. Test results are sent back to xen-devel.

With this system, all published commits should have already passed Gitlab CI and osstest tests.

## Gaps

The component / system which merges trees and drives CI systems is missing.

Patchew and Patchwork don't do all the things we care about yet.

## Concerns

For individual committers, turnaround time may become longer since you need to wait for other trees to be processed.

Quoted 7 lines

Gitlab CI doesn't have a self pushgate. If it is broken by accident Osstest will be blocked.

Thoughts and comments?

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#2 lore raw
Quoted 8 lines · Wei Liu

Cc Anthony as well. Forgot to do that. Sorry.

Quoted 5 lines · Wei Liu

Hi all

We now have Gitlab CI as a complementary system to Osstest and have planned to add bots. It's high time we think about how we integrate them and how it may improve our workflow.

FWIW, I planned on submitting on a talk on this. I plan on giving an overview to everyone at the summit and allowing for discussion. Potentially even hosting a BoF if there is interest in discussing this further.

--
Doug

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#3 lore raw
In reply to Wei Liu

This all sounds good.

Wei Liu writes ("Xen project CI systems and committer workflow"):

Quoted 5 lines

## Gaps

The component / system which merges trees and drives CI systems is missing.

Patchew and Patchwork don't do all the things we care about yet.

We need to decide how the plumbing should be arranged.

Quoted 4 lines

## Concerns

For individual committers, turnaround time may become longer since you need to wait for other trees to be processed.

This will probably be worth it.

A problem we identified in IRL discussion is that currently we rely rather too much on osstest retesting the same tree, because of heisenbugs. With the new scheme it would spend more of its time testing things which would never be retested. So I think in your `gaps' we need this:

osstest facility to automatically retry failing tests

(This feels like admitting defeat but I have occasionally had a campaign of trying to squash heisenbugs and it is *really hard work*. I doubt we can get rid of them completely.)

Quoted 2 lines

Gitlab CI doesn't have a self pushgate. If it is broken by accident Osstest will be blocked.

Could we plan some kind of procedural or robotic workaround ?

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#4 lore raw
Quoted 5 lines · Ian Jackson
Quoted 3 lines

Gitlab CI doesn't have a self pushgate. If it is broken by accident Osstest will be blocked.

Could we plan some kind of procedural or robotic workaround ?

So my thoughts around this are on priority values. Admittedly it could use some refinement but roughly speaking if someone pushed a series that broke osstest we could have a fix-up series/patch where it was acked and it was given a priority weight higher than any other series. This would cause the GitLab CI loop to test that series and get that pushed above all others.

Similarly to avoid bogging down testing for small changes like docs/comments/etc having a "rollup" tag which would have GitLab CI create a series from all things currently labeled "rollup" as push them as a whole.

--
Doug

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#5 lore raw
In reply to Wei Liu
Quoted 11 lines · Wei Liu

Hi all

We now have Gitlab CI as a complementary system to Osstest and have planned to add bots. It's high time we think about how we integrate them and how it may improve our workflow.

## Requirements

1. We want to have light weight build tests before a patch series is reviewed or committed.

Quoted 7 lines

2. We don't want to push broken patches to central repository such that everyone is blocked.

3. We don't want to significantly change committer workflow.

Requirement 2 means that our current branching model will need to be changed. Details will follow.

While everything presented here is fine to do as a matter of policy, the committers still need to retain the ability to actually push directly to the staging branches on xen.git

The security team needs to be able to make embargoed content appear at the point of public disclosure.  The security team already takes responsibility for all testing of this content before the public embargo point, and this policy will need to continue.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#6 lore raw

Andrew Cooper writes ("Re: Xen project CI systems and committer workflow"):

Quoted 3 lines

While everything presented here is fine to do as a matter of policy, the committers still need to retain the ability to actually push directly to the staging branches on xen.git

Why ?

In particular, this seems to presuppose that these "staging" branches continue to exist.

One of our strange practices is that we push things to a non-rewinding branch before they have been tested. Now, OK, we have been doing that for over a decade - since before people really invented the modern concept of "CI" - but that doesn't make it sensible.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#7 lore raw
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 18.04.19 at 16:02, <[email protected]> wrote:

Andrew Cooper writes ("Re: Xen project CI systems and committer workflow"):

Quoted 3 lines

While everything presented here is fine to do as a matter of policy, the committers still need to retain the ability to actually push directly to the staging branches on xen.git

Why ?

Quoted 7 lines

In particular, this seems to presuppose that these "staging" branches continue to exist.

One of our strange practices is that we push things to a non-rewinding branch before they have been tested. Now, OK, we have been doing that for over a decade - since before people really invented the modern concept of "CI" - but that doesn't make it sensible.

Now the question of course is - why do you consider this practice "strange"? And what do you mean by "before they have been tested"? Any submitter should have tested their patches. Yes, not everyone tests all possible (basic) configurations, but we spot such issues in review more often than they slip through, I think. And I don't expect CI will come anywhere near testing all _possible_ configurations, i.e. the risk of subtle breakage won't get eliminated altogether anyway.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#8 lore raw

Hi Jan,

Quoted 16 lines · Jan Beulich
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 18.04.19 at 16:02, <[email protected]> wrote:

Andrew Cooper writes ("Re: Xen project CI systems and committer workflow"):

Quoted 3 lines

While everything presented here is fine to do as a matter of policy, the committers still need to retain the ability to actually push directly to the staging branches on xen.git

Why ?

Quoted 7 lines

In particular, this seems to presuppose that these "staging" branches continue to exist.

One of our strange practices is that we push things to a non-rewinding branch before they have been tested. Now, OK, we have been doing that for over a decade - since before people really invented the modern concept of "CI" - but that doesn't make it sensible.

Quoted 5 lines

Now the question of course is - why do you consider this practice "strange"? And what do you mean by "before they have been tested"? Any submitter should have tested their patches. Yes, not everyone tests all possible (basic) configurations, but we spot such issues in review more often than they slip through, I think.

It is fairly common to see breakage on Arm because changes was only compiled on x86. The most common argument is "I don't have setup to build Arm".

The CI would allow us to test on every arch, different variation of .config (and possibly compiler).

Quoted 3 lines

And I don't expect CI will come anywhere near testing all _possible_ configurations, i.e. the risk of subtle breakage won't get eliminated altogether anyway.

Nothing is fully bullet-proof, but this is an improvement over manual testing on most of the build configuration today. The CI actually proved the usefulness by catching build bug in random .config the last few months.

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#9 lore raw
Quoted 35 lines · Julien Grall

Hi Jan,

Quoted 19 lines · Jan Beulich
Quoted 11 lines
Quoted 1 line
Quoted 1 line · On 18.04.19 at 16:02, <[email protected]> wrote:

Andrew Cooper writes ("Re: Xen project CI systems and committer workflow"):

Quoted 5 lines

While everything presented here is fine to do as a matter of policy, the
committers still need to retain the ability to actually push directly to
the staging branches on xen.git

Why ?

Quoted 7 lines

In particular, this seems to presuppose that these "staging" branches continue to exist.

One of our strange practices is that we push things to a non-rewinding branch before they have been tested.  Now, OK, we have been doing that for over a decade - since before people really invented the modern concept of "CI" - but that doesn't make it sensible.

Quoted 5 lines

Now the question of course is - why do you consider this practice "strange"? And what do you mean by "before they have been tested"? Any submitter should have tested their patches. Yes, not everyone tests all possible (basic) configurations, but we spot such issues in review more often than they slip through, I think.

It is fairly common to see breakage on Arm because changes was only compiled on x86. The most common argument is "I don't have setup to build Arm".

The CI would allow us to test on every arch, different variation of .config (and possibly compiler).

Quoted 7 lines
Quoted 3 lines

And I don't expect CI will come anywhere near testing all _possible_ configurations, i.e. the risk of subtle breakage won't get eliminated altogether anyway.

Nothing is fully bullet-proof, but this is an improvement over manual testing on most of the build configuration today. The CI actually proved the usefulness by catching build bug in random .config the last few months.

Furthermore, the long-term goal is to extend the boundary of things that we test, such that what gets tested is far wider than it would even be practical for submitters to test. (This was partially the goal of the SUPPORT.md, to have a place to enumerate testing status; and also partially the goal of the osstest stretch upgrade, to enable osstest to provide gcov reports to highlight testing deficiencies.)

Computers are good at boring, repetitive tasks like extensive testing; humans are bad at it. There's no reason to make humans do work that a computer can do better.

-George

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#10 lore raw
In reply to Andrew Cooper
Quoted 24 lines · Andrew Cooper
Quoted 11 lines · Wei Liu

Hi all

We now have Gitlab CI as a complementary system to Osstest and have planned to add bots. It's high time we think about how we integrate them and how it may improve our workflow.

## Requirements

1. We want to have light weight build tests before a patch series is reviewed or committed.

Quoted 7 lines

2. We don't want to push broken patches to central repository such that everyone is blocked.

3. We don't want to significantly change committer workflow.

Requirement 2 means that our current branching model will need to be changed. Details will follow.

While everything presented here is fine to do as a matter of policy, the committers still need to retain the ability to actually push directly to the staging branches on xen.git

Quoted 6 lines

The security team needs to be able to make embargoed content appear at the point of public disclosure.  The security team already takes responsibility for all testing of this content before the public embargo point, and this policy will need to continue.

~Andrew

What about the ability to push a branch to the CI loop with the highest priority so that its picked up immediately? There has been more than one XSA where the patches provided in the emails don't apply cleanly or don't build so it does seem valuable to still run the CI loop.

--
Doug

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

author
#11 lore raw
In reply to Andrew Cooper
Quoted 15 lines · Andrew Cooper
Quoted 14 lines · Wei Liu

Hi all

We now have Gitlab CI as a complementary system to Osstest and have planned to add bots. It's high time we think about how we integrate them and how it may improve our workflow.

## Requirements

1. We want to have light weight build tests before a patch series is reviewed or committed.

2. We don't want to push broken patches to central repository such that everyone is blocked.

Quoted 9 lines
Quoted 4 lines

3. We don't want to significantly change committer workflow.

Requirement 2 means that our current branching model will need to be changed. Details will follow.

While everything presented here is fine to do as a matter of policy, the committers still need to retain the ability to actually push directly to the staging branches on xen.git

But that would mean skipping all tests? I don't think that's desirable.

Quoted 4 lines

The security team needs to be able to make embargoed content appear at the point of public disclosure.  The security team already takes responsibility for all testing of this content before the public embargo point, and this policy will need to continue.

I think as long as the system provides the capability to 1) run flights in secret and 2) expedite certain flights, enforcing this policy even on security team should be fine.

#1 makes sure security patches can be tested before they are published. #2 makes sure once they are published, they will be tested at the highest priority.

Wei.

Quoted 2 lines

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#12 lore raw
In reply to Wei Liu
Quoted 52 lines · Wei Liu

Hi all

We now have Gitlab CI as a complementary system to Osstest and have planned to add bots. It's high time we think about how we integrate them and how it may improve our workflow.

## Requirements

1. We want to have light weight build tests before a patch series is reviewed or committed.

2. We don't want to push broken patches to central repository such that everyone is blocked.

3. We don't want to significantly change committer workflow.

Requirement 2 means that our current branching model will need to be changed. Details will follow.

## Overview of automation systems

- Gitlab CI

It is capable of running build tests with relatively short turnaround time.

- Bots like Patchew and Patchwork

They are able to slurp patches from xen-devel and maybe run customised scripts on those patches.

- Osstest

Pushgate, integration test system. It runs more sophisticated tests compared to Gitlab CI. Turnaround time is long.

## New world

There will be an unified endpoint for committers and bots. Committers and bots will have their git trees. Patches are committed to those trees. An automated system will get patches from those trees and trigger CI runs.

The system will pick up commits from one of the trees, merge them with master and send the merge to CI systems.

For bots, only Gitlab CI build tests will run. Results are sent back to xen-devel.

For committers' trees, at first Gitlab CI build tests are run, if the result is successful, the merge commit is submitted to osstest. If osstest deems the merge is good, the merge is pushed (published) to xen.git, otherwise the merge is discarded. Test results are sent back to xen-devel.

Quoted 8 lines

With this system, all published commits should have already passed Gitlab CI and osstest tests.

## Gaps

The component / system which merges trees and drives CI systems is missing.

Patchew and Patchwork don't do all the things we care about yet.

I understand the general principle and I am on board. But I missing some details.

Is the idea that each committer would have his own git tree and branch with a specific name which would be picked up automatically by the CI-loop daily? In the style of linux-next? If it passed, it is given to OSSTest automatically and eventually committed?

Or is it the idea that each committer would have a way to manually submit a branch to the CI-loop for testing when he wished to do so? In the style of github pull-requests-based CI-loops? If this is the case, then we just need a way to trigger the CI-loops on a given branch?

In any case, my only feedback would be to also allow CI-loops on branches that are *not* meant to be committed automatically if tests pass. So that we can apply a complex series to a branch and see if tests pass before doing reviews or running experiments.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

author
#13 lore raw
Quoted 62 lines · Stefano Stabellini
Quoted 52 lines · Wei Liu

Hi all

We now have Gitlab CI as a complementary system to Osstest and have planned to add bots. It's high time we think about how we integrate them and how it may improve our workflow.

## Requirements

1. We want to have light weight build tests before a patch series is reviewed or committed.

2. We don't want to push broken patches to central repository such that everyone is blocked.

3. We don't want to significantly change committer workflow.

Requirement 2 means that our current branching model will need to be changed. Details will follow.

## Overview of automation systems

- Gitlab CI

It is capable of running build tests with relatively short turnaround time.

- Bots like Patchew and Patchwork

They are able to slurp patches from xen-devel and maybe run customised scripts on those patches.

- Osstest

Pushgate, integration test system. It runs more sophisticated tests compared to Gitlab CI. Turnaround time is long.

## New world

There will be an unified endpoint for committers and bots. Committers and bots will have their git trees. Patches are committed to those trees. An automated system will get patches from those trees and trigger CI runs.

The system will pick up commits from one of the trees, merge them with master and send the merge to CI systems.

For bots, only Gitlab CI build tests will run. Results are sent back to xen-devel.

For committers' trees, at first Gitlab CI build tests are run, if the result is successful, the merge commit is submitted to osstest. If osstest deems the merge is good, the merge is pushed (published) to xen.git, otherwise the merge is discarded. Test results are sent back to xen-devel.

Quoted 8 lines

With this system, all published commits should have already passed Gitlab CI and osstest tests.

## Gaps

The component / system which merges trees and drives CI systems is missing.

Patchew and Patchwork don't do all the things we care about yet.

Quoted 7 lines

I understand the general principle and I am on board. But I missing some details.

Is the idea that each committer would have his own git tree and branch with a specific name which would be picked up automatically by the CI-loop daily? In the style of linux-next? If it passed, it is given to OSSTest automatically and eventually committed?

Branch / tree -- whichever works best.

If the target under test passes, it will eventually be committed to xen.git; otherwise the target is discarded and submitters / committers get notified what failed.

Quoted 6 lines

Or is it the idea that each committer would have a way to manually submit a branch to the CI-loop for testing when he wished to do so? In the style of github pull-requests-based CI-loops? If this is the case, then we just need a way to trigger the CI-loops on a given branch?

This is the same as above. How the system works internally has no visible effect on committer workflow.

In both cases, you just need to follow instructions to commit to a tree / branch / repository.

Quoted 4 lines

In any case, my only feedback would be to also allow CI-loops on branches that are *not* meant to be committed automatically if tests pass. So that we can apply a complex series to a branch and see if tests pass before doing reviews or running experiments.

Understood.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#14 lore raw
In reply to Wei Liu
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 18.04.19 at 14:31, <[email protected]> wrote:

## New world

There will be an unified endpoint for committers and bots. Committers and bots will have their git trees. Patches are committed to those trees. An automated system will get patches from those trees and trigger CI runs.

Quoted 5 lines

The system will pick up commits from one of the trees, merge them with master and send the merge to CI systems.

For bots, only Gitlab CI build tests will run. Results are sent back to xen-devel.

This and ...

Quoted 4 lines

For committers' trees, at first Gitlab CI build tests are run, if the result is successful, the merge commit is submitted to osstest. If osstest deems the merge is good, the merge is pushed (published) to xen.git, otherwise the merge is discarded. Test results are sent back to xen-devel.

... this sounds like a lot of extra mail traffic. Already for the osstest reports I wonder how many people actually look at them (at a minimum level of detail). The more relatively similar mails, the more likely it is in my opinion that some relevant one may not be paid attention to.

Quoted 2 lines

With this system, all published commits should have already passed Gitlab CI and osstest tests.

While this is certainly desirable as a goal, is the problem of occasional build issues really this big, warranting introduction of further overhead?

Quoted 4 lines

## Concerns

For individual committers, turnaround time may become longer since you need to wait for other trees to be processed.

Together with this larger latency, chances increase that two committers pick up the same patch or series. With today's single central instance everyone pushes to it is at least possible to check whether something has gone in already before starting to commit things. Iirc whenever I ended up trying to commit a patch that was already there, it was because of me not having checked (again), rather than because of an actual race.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#15 lore raw
Quoted 6 lines · Jan Beulich
Quoted 2 lines

With this system, all published commits should have already passed Gitlab CI and osstest tests.

While this is certainly desirable as a goal, is the problem of occasional build issues really this big, warranting introduction of further overhead?

You seem to have missed the conjuction at the end of the sentence you're relpying to:

"...and osstest tests".

It's not mainly to stop occasional build issues; it's to stop long-running pushgate failures.

Quoted 5 lines
Quoted 4 lines

## Concerns

For individual committers, turnaround time may become longer since you need to wait for other trees to be processed.

Quoted 8 lines

Together with this larger latency, chances increase that two committers pick up the same patch or series. With today's single central instance everyone pushes to it is at least possible to check whether something has gone in already before starting to commit things. Iirc whenever I ended up trying to commit a patch that was already there, it was because of me not having checked (again), rather than because of an actual race.

If this becomes an issue, I'm sure we can sort out a technical solution.
A pre-push script that checks other "open" submissions for duplicates
shouldn't be difficult to implement. Having a unified place for
committers to simply approve posts for merging (rather than submitting a pull request) would be a longer-term improvement.

-George

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel