Page MenuHomePhabricator

investigate updating test2 Jenkins builds weekly to pull by branch
Closed, ResolvedPublic

Description

I learned today from Rob Lanphier that it has recently become possible to do this reliably in every extension repo as well as mw core:

$ git checkout wmf/1.23wmf17

For example:

/VisualEditor$ git checkout wmf/1.23wmf17
Branch wmf/1.23wmf17 set up to track remote branch wmf/1.23wmf17 from origin.
Switched to a new branch 'wmf/1.23wmf17'

The current branch of each wiki is tracked in https://git.wikimedia.org/blob/operations%2Fmediawiki-config/HEAD/wikiversions.json

The current branch of core (which should be consistent across all extensions also) is available on https://test2.wikipedia.org/wiki/Special:Version (and theoretically in the API somewhere)

It would be good if we could change our Jenkins builds with test2 as a target to pull the current wmf branch instead of master.

In the short term, we could update the build config manually every Thursday.

In the slightly longer term it should be possible to read Special:Version or the wikiversions.json file in order to determine at run time the proper version of the tests appropriate for test2 (and any other target environment not beta labs, e.g. enwiki or commons)


Version: unspecified
Severity: enhancement

Details

Reference
bz62509

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 2:59 AM
bzimport added a project: Quality-Assurance.
bzimport set Reference to bz62509.
  • Bug 64611 has been marked as a duplicate of this bug. ***

From bug 64611:

When browsertests hit the production wikis, we should fetch the extension wmf branch that match the targeted website. The mapping of wiki vs wmf branch can be found via the dblist files in operations/mediawiki-config.git

Instead of using the Jenkins git plugin, we will have to use a script to find out which branch to check.

hashar added a comment.May 6 2014, 4:33 PM

I am pretty sure I have a good idea about fixing this :-]

Change 131768 had a related patch set uploaded by Hashar:
Api: expose git branch in siteinfo

https://gerrit.wikimedia.org/r/131768

Change 131861 had a related patch set uploaded by Hashar:
mw-api-siteinfo: fetch siteinfo from MW API

https://gerrit.wikimedia.org/r/131861

hashar added a comment.May 6 2014, 8:29 PM

The mw-api-siteinfo.py script will let us do something like:

$ mw-api-siteinfo.py http://test2.wikipedia.org/ git_branch
1.24wmf2
$

We can then checkout that branch in the extensions to run the matching set of browser tests.

Change 131768 merged by jenkins-bot:
API: Expose git branch in siteinfo

https://gerrit.wikimedia.org/r/131768

Change 131935 had a related patch set uploaded by Hashar:
API: Expose git branch in siteinfo

https://gerrit.wikimedia.org/r/131935

Change 131936 had a related patch set uploaded by Hashar:
API: Expose git branch in siteinfo

https://gerrit.wikimedia.org/r/131936

hashar added a comment.May 7 2014, 7:54 PM

I will try to get it included in the currently deployed wmf installations, else the patch will land under the next two weeks.

The tiny python script will let us easily get the branch of a target wiki. Knowing it, we can then git checkout that branch before starting the browsertests.

I might be able to handle that during this week hackaton, no promise though.

Change 131935 abandoned by Reedy:
API: Expose git branch in siteinfo

Reason:
1.24wmf2 is not used now

https://gerrit.wikimedia.org/r/131935

Change 131936 abandoned by Hashar:
API: Expose git branch in siteinfo

Reason:
No urgency to have this deployed in 1.24wmf3 since commit is in the branch wmf/1.24wmf4 which is going to be deployed on the remaining production wikis on May 15th ( https://wikitech.wikimedia.org/wiki/Deployment ).

https://gerrit.wikimedia.org/r/131936

Change 131861 merged by jenkins-bot:
mw-api-siteinfo: fetch siteinfo from MW API

https://gerrit.wikimedia.org/r/131861

The lame mw-api-siteinfo.py is now deployed. We can use to query the target MediaWiki installation to grab the branch and attempt to check it out before running the browser tests.

Should do git checkout -f iirc.

Change 134236 had a related patch set uploaded by Hashar:
Get mw branch from target URL and check it out

https://gerrit.wikimedia.org/r/134236

Change 134376 had a related patch set uploaded by Hashar:
mw-sort-wmf-branches: sort wmf branchs numerically

https://gerrit.wikimedia.org/r/134376

Change 134376 merged by jenkins-bot:
mw-sort-wmf-branches: sort wmf branchs numerically

https://gerrit.wikimedia.org/r/134376

Change 134236 merged by jenkins-bot:
Get mw branch from target URL and check it out

https://gerrit.wikimedia.org/r/134236

Change 134483 had a related patch set uploaded by Hashar:
Fallback to master branch when test repo miss branch

https://gerrit.wikimedia.org/r/134483

Change 134483 merged by jenkins-bot:
Fallback to master branch when test repo miss branch

https://gerrit.wikimedia.org/r/134483

I tested it on a few change and it seems to be working fine.

The qa/browsertests.git is missing wmf branches, so I have added a fallback to the 'master' branch.

Lets see what happens tomorrow :)

Gilles from the Multimedia team reported an issue with the browser tests running some outdated version of the code. Turns out the repo was not reset to origin/master but to local master branch.

Fixed up with https://gerrit.wikimedia.org/r/#/c/134576/

I think this was implemented entirely back in May 2014. The fix was to have MediaWiki API the branch it runs then have the browser test checkout the matching branch, fall backing to master if the branch is not found.