Page MenuHomePhabricator

Display mergeable status in scap backport --list output
Closed, ResolvedPublic

Description

Per suggestions in https://gerrit.wikimedia.org/r/c/mediawiki/tools/scap/+/765649/8#message-5b2170443703f5a09556027a24d5efd902dbc9f1

  1. it would be nice to display the "mergeable" attribute along with project/branch/subject in the list; 2) verify "mergeable" before asking whether to backport it, much like you've done with the dependency checks.

Event Timeline

TLDR: use mergeable field from the response.

The scap plugin queries the REST API /changes/{change-id}/detail which returns a ChangeInfo entity. The mergeability is in the mergeable field:

mergeable
optional
Whether the change is mergeable.
Only set for open changes if change.mergeabilityComputationBehavior is API_REF_UPDATED_AND_CHANGE_REINDEX.

We use the default REF_UPDATED_AND_CHANGE_REINDEX which says:

Gerrit will never serve mergeable in ChangeInfo objects.

But it is definitely populated:

curl -s 'https://gerrit.wikimedia.org/r/changes/integration%2Fquibble~764754/detail'|tail -n1|jq '.mergeable'
true

That might be a documentation error, it seems the default is API_REF_UPDATED_AND_CHANGE_REINDEX which does populate the mergeabe field.

I have raised that cause it is a breaking change for Gerrit 3.4 and I have filed T303970 to ensure we don't break it.

Change 810078 had a related patch set uploaded (by Jeena Huneidi; author: Jeena Huneidi):

[mediawiki/tools/scap@master] Scap backport --list: Add mergeable column

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

Change 822463 had a related patch set uploaded (by Jeena Huneidi; author: Jeena Huneidi):

[mediawiki/tools/train-dev@master] Update prettytable version for scap

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

Change 822463 merged by jenkins-bot:

[mediawiki/tools/train-dev@master] Update prettytable version for scap

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

Change 822673 had a related patch set uploaded (by Jeena Huneidi; author: Jeena Huneidi):

[mediawiki/tools/train-dev@master] Change prettytable version for scap

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

Change 822673 merged by jenkins-bot:

[mediawiki/tools/train-dev@master] Change prettytable version for scap

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

Change 810078 merged by jenkins-bot:

[mediawiki/tools/scap@master] Scap backport --list: Add mergeable column

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