Peter Xu <pet...@redhat.com> writes: > On Wed, May 07, 2025 at 12:58:34PM -0300, Fabiano Rosas wrote: >> Stefan reports that during QEMU release, pushing a series with the >> VERSION bump commit, but not pushing the new git tag in the same >> command will cause a failure of the build-previous-qemu job at the git >> fetch step. >> >> Since the job is intended to produce a build of the previous QEMU >> version for consumption by the migration-compat-* jobs, there's no >> reason to produce a build of the release commit because the migration >> job would end up testing the release against itself. >> >> Skip the job when VERSION contains the newly release version number. >> >> I'm opting for 'exit 0' for both the build and the test jobs because >> allow_failure would mask any real error in the jobs. It also avoids >> having an orange ! on every release pipeline. >> >> Reported-by: Stefan Hajnoczi <stefa...@redhat.com> >> Signed-off-by: Fabiano Rosas <faro...@suse.de> > > This is better than before for sure: > > Reviewed-by: Peter Xu <pet...@redhat.com> > > Though nitpicks below. > >> --- >> .gitlab-ci.d/buildtest.yml | 8 +++++++- >> 1 file changed, 7 insertions(+), 1 deletion(-) >> >> diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml >> index ccf69fb8dd..159bdde2e8 100644 >> --- a/.gitlab-ci.d/buildtest.yml >> +++ b/.gitlab-ci.d/buildtest.yml >> @@ -203,6 +203,11 @@ build-previous-qemu: >> GIT_FETCH_EXTRA_FLAGS: --prune --quiet >> before_script: >> - source scripts/ci/gitlab-ci-section >> + # Skip if this series contains the release bump commit. During the >> + # release process there might be a window of commits when the >> + # version tag is not yet present in the remote and git fetch would >> + # fail. >> + - if grep -q "\.0$" VERSION; then exit 0; fi >> - export QEMU_PREV_VERSION="$(sed 's/\([0-9.]*\)\.[0-9]*/v\1.0/' >> VERSION)" >> - git remote add upstream https://gitlab.com/qemu-project/qemu >> - git fetch upstream >> refs/tags/$QEMU_PREV_VERSION:refs/tags/$QEMU_PREV_VERSION >> @@ -226,7 +231,8 @@ build-previous-qemu: >> # Use the migration-tests from the older QEMU tree. This avoids >> # testing an old QEMU against new features/tests that it is not >> # compatible with. >> - - cd build-previous >> + # Skip if build-previous-qemu has failed. > > This is inaccurate? As this job could only run if the dependent job > succeeded IIUC (aka, exit 0 means success). Meanwhile.. > >> + - cd build-previous || exit 0 > > .. It'll be nice if we could still fail this job if something wrong > happened in build-previous.. > > Maybe it's clearer we check .0 here too? It's oneliner so we could dup it > I guess.
Ok, let me respin... > I wished the CI jobs can have nested "rules:".. > IIUC, we can't use rules because they're evaluated before the pipeline starts, so the repo would not have been cloned yet. >> # old to new >> - QTEST_QEMU_BINARY_SRC=./qemu-system-${TARGET} >> QTEST_QEMU_BINARY=../build/qemu-system-${TARGET} >> ./tests/qtest/migration-test >> -- >> 2.35.3 >>