[PP-1] MR retesting with GitLab CI

Created on 13 September 2023, over 1 year ago
Updated 9 February 2024, 11 months ago

Problem/Motivation

DrupalCI currently incorporates RTBC retesting of patches and MRs, it would be useful to have similar functionality on GitLab CI.

There are a few use cases for RTBC retesting, so it might be worth seeing if we can change some things for Gitlab CI.

1. It is good for core committers to know that the latest test run on an MR is fresh - in that there is not too much diversion between the MR and HEAD, this reduces the likelihood of a commit breaking HEAD due to other changes that have happened in between.

However re-running an MR pipeline does not actually help with this, it would also need to be rebased on HEAD.

2. It is good for core contributors to know if their MR no longer rebases cleanly or has started to fail tests due to changes in core. But once again this requires a rebase.

2B. This applies to needs review issues as much as RTBC issues. The needs review queue used to be thousands of issues long, but is now shorter than the RTBC queue.

Steps to reproduce

Proposed resolution

To get something similar, we would need automated rebasing - is this feasible to set up? Could we do something like spin off a branch, attempt to rebase that branch, fail the job if there are merge conflicts? Then set this up so it runs on all MRs after each core commit.

Perhaps we could run just the lint steps after a successful automated rebase instead of the full test run, that would give us 99% of the benefit of automated retesting with less CPU power. Once we're using gitlab issues we could restrict that to only RTBC issues too.

Committers could manually run full pipelines when they're reviewing something that hasn't had an update recently, now that test runs are under 20 minutes this would be an easy manual step if they notice things look a bit stale at the start of a review.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Postponed

Version

3.0

Component

Code

Created by

🇬🇧United Kingdom catch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @catch
  • 🇬🇧United Kingdom catch
  • 🇬🇧United Kingdom catch
  • Status changed to Postponed over 1 year ago
  • 🇬🇧United Kingdom catch

    The more I think about this, potentially the less there is to actually do here since more of it is baked into gitlab. Possibly nothing, however I opened 📌 Mark issues needs work when MRs can't be merged or pipelines fail Active and postponing on that.

  • 🇬🇧United Kingdom catch

    Discussing more in slack:

    When MRs are tested, we test them merged with the target branch, so we're always testing the result as if they'd just been merged. So if an MR is being committed to but hasn't been brought up to speed with HEAD for a while, it's still tested against HEAD so that doesn't matter.

    If an MR isn't mergeable, gitlab detects this without a CI run and warns you.

    The remaining thing then is the situation when an issue is RTBCed when the last MR run was weeks ago (which happens quite often), or stays RTBC for a long time without a new MR run (which also happens quite often). This is probably handled by using the gitlab rebase button manually.

    So I think the only question then is would we want to set up some kind of auto-fast-forward rebase of MRs that are old but still apply. Maybe not.

  • 🇺🇸United States drumm NY, US

    When using GitLab’s merge UI, there is the capability for maintainers to “merge if pipelines pass” https://docs.gitlab.com/ee/ci/pipelines/merge_trains.html

    I believe the main drawbacks of GitLab’s merge UI for core are:

    • Git commit authorship is set to the merge request author. There are a number of GitLab issues about this, starting from https://gitlab.com/gitlab-org/gitlab/-/issues/26902
    • GitLab’s commit message templating won’t have an option for a list of usernames
  • 🇺🇸United States drumm NY, US

    RTBC retesting on DrupalCI was expensive. If I recall correctly, 20% of all compute for DrupalCI at times, highly dependent on the RTBC queue.

    If we were to rebase every MR on every commit, and run pipelines, that would be incredibly wasteful, expensive, and a lot of junk to read through in the MR activity.

    If a MR can be automatically rebased without conflicts, it probably does not need a rebase. The pipelines already test the merged result with upstream commits at the time. Viewing the MR page will tell you if there are merge conflicts and a manual rebase is needed.

    In my view, the missing piece is committers knowing that tests still pass as they merge.

  • 🇬🇧United Kingdom catch

    In my view, the missing piece is committers knowing that tests still pass as they merge.

    Yes it happens pretty rarely but it can be very confusing when it does. Being able to use merge trains seems like the ideal end point, but we are still downloading the diff with curl and committing locally, so quite a long distance.

Production build 0.71.5 2024