Commit graph

16 commits

Author SHA1 Message Date
Dennis Kempin
45df242c01 merge bot: Skip installing python version if it exists already
If the version is installed, but not the default selected, pyenv
can fail.

BUG=None
TEST=Testing in prod..

Change-Id: I5063051dd300f9dbbb057e429a84062341b3324c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3585859
Reviewed-by: Anton Romanov <romanton@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
2022-04-14 22:23:43 +00:00
Dennis Kempin
9740b944eb merge buildes: Fix formatting of version check
The script broke after the formatter wrapped the string.

BUG=None
TEST=./ci/kokoro/simulate.py build-merge-into-chromeos.sh

Change-Id: Id6e972d786d5a58f6cbb43f80d02f0aa26483967
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3585858
Reviewed-by: Anton Romanov <romanton@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
2022-04-14 22:06:34 +00:00
Dennis Kempin
b193738186 New merge bot
The new merge bot is written in python to allow us to improve the
merge process.

The new process is as follows:
- The merge bot will only create a new merge when the previous
  ones have been submitted.
- When the bot creates a new merge, it'll split the merge commits
  into smaller changes to make bisection easier.

This allows us to only ever deal with one set of merge commits
instead of piling on new merges day after day.

For dry runs, the new process is:
- The bot will check existing dry runs and abandon them if the CQ
  is done.
- The bot will vote Verified+-1 to indicate if the dry run passed.
- If no more dry runs are active, it'll create a new one.

This ensures we always have a dry run in the CQ and can easily see
in gerrit which ones have passed.

The python script will also allow us to add convenience features
for oncall for retrying bratches, etc.

BUG=b:227347397
TEST=The script can be run locally:
./tools/chromeos/merge_bot update-merges
./tools/chromeos/merge_bot update-dry-runs

Change-Id: I51fc0741f5032868ad07f5e926e570e29cc461fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3583254
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-04-14 21:38:07 +00:00
Dennis Kempin
5b8a837485 Kokoro merge bot: Remove rebase for now
The recent cherry-pick of a revert has diverged the tree and caused
the commits inside the merge to be rebased as well, which uploads new
gerrit CLs for each commit.

BUG=None
TEST=./ci/kokoro/simulate.py ./ci/kokoro/build-x86_64.sh

Change-Id: I01af93c989ab0aba4c2d599d0625f921315a0600
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3566120
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-04-06 17:32:10 +00:00
Dennis Kempin
e871ee9601 Kokoro merge bot: Rebase merges before uploading
This allows the bot to account for manually cherry-picked commits.

To make rebases work properly, we had to fix the commit message
trailers to be added in a separate paragraph. This ensures
git inspect-trailers can add and find the Commit-Id trailer.

BUG=b:226975273
TEST=./ci/kokoro/simulate.py ./ci/kokoro/build-merge-into-chromeos.sh

Change-Id: If008be1f1c671ef1d79c6f223f10ea0e8f6742b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3561015
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Maciek Swiech <drmasquatch@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-03-30 22:57:48 +00:00
Dennis Kempin
cbe2e12759 Kokoro: Use unique identifiers for gerrit API
Change-Ids can refer to multiple CLs when they are cherry-picked.
Use the 'id' field instead wich contains repo and branch info and
is unique across gerrit.

BUG=None
TEST=./ci/kokoro/simulate.py ./ci/kokoro/build-merge-into-chromeos.sh

Change-Id: I7074e310ec7f795527610010c849acceaeb0eb06
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3556231
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
2022-03-28 19:25:44 +00:00
Dennis Kempin
145f452cf5 merge-into-chromeos: Exclude dry runs from previous merge commits
Otherwise we end up with this: https://crrev.com/c/3422185

BUG=None
TEST=None

Change-Id: I8abd0e3f4465e9ae2ae34630dde5a3b15e190b09
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3421734
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-28 01:32:07 +00:00
Dennis Kempin
32c3f30e05 merge-into-chromeos: Set Bot-Commit+1 as well
This is an experiment to figure out the permissions needed by
crosvm-bot.
See https://crbug.com/1289780 for details.

BUG=chromium:1289780
TEST=None

Change-Id: Ic202532ceaa2b0d86f51c8670137bde2d8f16868
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3419296
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-27 20:08:51 +00:00
Dennis Kempin
d6c3154b13 merge-into-chromeos: Create a dry run merge as well
The dry run merge is re-created every day and automatically
set to CQ+1. This allows us to check for bad crosvm changes
while we submit parts of the merge chain.

BUG=b:215741244
TEST=./tools/ci/simulate merge-into-chromeos.sh

Change-Id: I0773a99f9858962e9f25bebff1b233d455d33cdd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3417508
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-26 20:47:46 +00:00
Dennis Kempin
bf0066f4f9 merge-into-chromeos: Only merge if N commits have been added
We currently have a lot of merges with just 1 or 2 commits in them.
That's a lot of noise.

This CL makes the builder wait until we got at least 5 commits to
merge. This will delay merge commits being created, but our merge
process is usually a few days behind due to CQ delays, so it does
not matter much.

The MIN_COMMIT_COUNT variable can be overwritten when triggering
a manual build in Fusion.

BUG=b:215389423
TEST=./ci/kokoro/simulate build-merge-into-chromeos.sh

Change-Id: Ia24ee0b615ad402060775530e9eb0def7742200e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3402501
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-20 18:11:34 +00:00
Dennis Kempin
fe0d2a633a merge-into-chromeos: Automatically set CQ+1
Since we have a chain of commits, we need to set all of
them to CQ+1 for the dry run to happen.
Unfortunately, the CQ will only ever run a single build
for a chain of commits. So the dry run will only happen
when all builds have finished.

BUG=b:213932296
TEST=./ci/kokoro/simulate build-merge-into-chromeos.sh

Change-Id: I1883b22ab97da604a4188528ccfb3231a23cb7f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3384220
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
2022-01-12 20:26:36 +00:00
Dennis Kempin
5a250fcb26 merge-into-chromeos: Create chain of merge commits
We can use the gerrit api to detect previous merge commits
the bot has made, then use those as the base for the next merge.

This will create smaller merges and is easier to manage as we do not
have to abandon so many changes.

One complication is detecting possible cherry picks the oncall may
have added to the previous merge commit.

Only open merge commits are taken into account.

BUG=b:213932296
TEST=./ci/kokoro/simulate build-merge-into-chromeos.sh

Change-Id: I795109be4c45bec49068c3e292a3947505755442
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3381832
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
2022-01-11 23:35:39 +00:00
Dennis Kempin
e204dda759 Kokoro: Allow manual merge targets in merge-into-chromeos
This allows us to manually specify the merge target when triggering
the Kokoro job to do partial merges.

BUG=b:209034086
TEST=None

Change-Id: If68231b46981dec679445dde50e1fb5ff66e57c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3340211
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-12-14 23:41:33 +00:00
Dennis Kempin
cd0c2b846a kokoro: Add user name / email to commits
This prevents gerrit from claiming we are forging email addresses.

BUG=b:209034086
TEST=None

Change-Id: I9f5bab0684f40ad5220d8c88d89a34e23facab99
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3321734
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2021-12-08 18:50:50 +00:00
Dennis Kempin
f18de38a02 kokoro: clean repo before merging
There can be leftover files from a previous build.

BUG=b:209034086
TEST=./ci/kokoro/simulate build-merge-into-chromeos.sh

Change-Id: I0f7223bc6dd1769db04408f595764931c3ff2af8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3321730
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
2021-12-07 21:03:03 +00:00
Dennis Kempin
fbb2de0188 kokoro: Various fixes to merge-into-chromeos job
- Adds the needed job config
- Makes a copy of the script before git checkout
- Follow naming scheme of other build scripts
- Add reviewer when uploading

BUG=b:209034086
TEST=./ci/kokoro/simulate build-merge-into-chromeos.sh

Change-Id: I279ff6aca7c3c304354a238ebd5c40b4dd272385
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3321726
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
2021-12-07 20:50:29 +00:00
Renamed from ci/kokoro/merge-into-chromeos.sh (Browse further)