Page MenuHomePhabricator

When starting from a release branch, the selected patches seemingly don't get applied
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue

  1. Navigate to https://patchdemo.wmcloud.org/.
  2. Under 'Start with version', select REL1_43.
  3. Under 'Then, apply patches', enter 1134228, and select the patch that comes up (https://gerrit.wikimedia.org/r/1134228).
  4. Click the 'Create demo' button.

What happens?
The wiki is successfully created, but the patch doesn't get applied.

The wiki-creation console output shows that Patch Demo is doing something to try to apply the patch:

Fetching and applying patches (1/1)...

PATCHDEMO='/var/www/html' NAME='2f40feaf77' REPO='w/.' REF='refs/changes/28/1134228/1' BASE='origin/master' HASH='b06a1063087dd14e120317684630b7e9181d323b'  \
/var/www/html/new/applypatch.sh
+ cd /var/www/html/wikis/2f40feaf77/w/.
+ git fetch origin refs/changes/28/1134228/1
From https://gerrit.wikimedia.org/r/mediawiki/core
 * branch                    refs/changes/28/1134228/1 -> FETCH_HEAD
+ :
+ git rev-list --cherry-pick --right-only HEAD...b06a1063087dd14e120317684630b7e9181d323b '^origin/master' --count
+ grep '^0$'
0

However, the patch doesn't actually seem to get applied -- https://gerrit.wikimedia.org/r/1134228 adds Special:Versions as an alias to Special:Version; but the created wiki doesn't recognize that alias.

What should have happened instead?:
The patch should have been applied to the wiki. If the patch can't be applied, IMO the wiki creation should fail.

Other information/Notes
One use case for this functionality (i.e., applying patches to release-branches) is being able to work out whether or not a given patch has caused a specific regression. E.g., for T396233, I suspected that it might have been caused by https://gerrit.wikimedia.org/r/1143497; and I was hoping to test this theory by (a) applying that patch to a demo-wiki running REL1_44, and (b) comparing the results to a REL1_44 wiki with no patches applied.

Event Timeline

I was able to recreate this with a local checkout. When we apply patches, we check everything between REL1_43's HEAD and the patch and get all the changes that are not in master (since that's what your patch is based on). BUT it looks like your change is already in master, so it gets excluded by this check:

git rev-list --cherry-pick --right-only HEAD...b06a1063087dd14e120317684630b7e9181d323b '^origin/master'

I have not yet groked to fullness why we need this list, but we'll need to find a new way to get dependencies for any changes we're cherry picking.