Page MenuHomePhabricator

Create `scap swat` command to automate patch merging & testing during a swat deployment
Closed, ResolvedPublic

Description

scap swat -h

user@tin:/srv/mediawiki-staging$ scap swat -h

usage: scap swat [-h] [-c CONF_FILE] [--no-shared-authsock]
                 [-D <name>:<value>] [-v] [-e ENVIRONMENT]
                 <sub-command> ...

scap swat: cherry-pick and deploy patches for Mediawiki SWAT.

optional arguments:
  -h, --help            show this help message and exit

global arguments:
  Although these arguments can be passed to all scap (sub-)commands,         
  not all commands are affected by every global argument.

  -c CONF_FILE, --conf CONF_FILE
                        Path to configuration file
  --no-shared-authsock  Ignore any shared ssh-auth configuration
  -D <name>:<value>, --define <name>:<value>
                        Set a configuration value
  -v, --verbose         Verbose output
  -e ENVIRONMENT, --environment ENVIRONMENT
                        environment in which to execute scap

swat sub-commands:
  Mediawiki SWAT deployment helper.

  <sub-command>
    merge               scap swat
    pick                Cherry-pick one or more changes to all active wiki
                        branches.
    revert              revert a change in gerrit
    search              execute a gerrit query
    show                Display details about the given changeids

Usage Examples:
----------------
Query changes from gerrit and display the results:
    scap swat search 'status:open'

Cherry-pick a patch to active deployment branches:
    scap swat pick 123456

Specify a specific branch target:
    scap swat pick 123456 --branch 1.28.0-wmf.1

Diplay detailed information about a change in gerrit:
    scap swat show 123456

Merge a patch
    scap swat merge 123456

More info: https://wikitech.wikimedia.org/wiki/SWAT_deploys

scap swat merge

user@tin:/srv/mediawiki-staging$ scap swat merge -h

usage: scap swat merge [-h] [-b BRANCH] [-m MESSAGE [MESSAGE ...]]
                       [-c CONF_FILE] [--no-shared-authsock]
                       [-D <name>:<value>] [-v] [-e ENVIRONMENT]
                       changeid [changeid ...]

scap swat

positional arguments:
  changeid              Change-id or gerrit patch url

optional arguments:
  -h, --help            show this help message and exit
  -b BRANCH, --branch BRANCH
                        One or more branches to merge into. Default: active
                        wmf/branches.
  -m MESSAGE [MESSAGE ...], --message MESSAGE [MESSAGE ...]
                        Include a message or comment with your action.

scap swat pick

user@tin:/srv/mediawiki-staging$ scap swat pick -h

usage: scap swat pick [-h] [-b BRANCH] [-m MESSAGE [MESSAGE ...]]
                      [-c CONF_FILE] [--no-shared-authsock]
                      [-D <name>:<value>] [-v] [-e ENVIRONMENT]
                      changeid

Cherry-pick one or more changes to all active wiki branches.
Once the changes have been cherry-picked, merge them and deploy.

positional arguments:
  changeid              The ChangeId of a patch to merge.

optional arguments:
  -h, --help            show this help message and exit
  -b BRANCH, --branch BRANCH
                        One or more branches to merge into. Default: active
                        wmf/branches.
  -m MESSAGE [MESSAGE ...], --message MESSAGE [MESSAGE ...]
                        Include a message or comment with your action.

Details

Related Gerrit Patches:
operations/mediawiki-config : masterScap swat command

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 12 2016, 10:50 PM
mmodell triaged this task as High priority.Aug 26 2016, 12:45 AM
mmodell updated the task description. (Show Details)Aug 31 2016, 6:54 PM
mmodell edited projects, added Scap (Scap3-MediaWiki-MVP); removed Scap.
Krinkle updated the task description. (Show Details)Sep 20 2016, 11:21 PM
Krinkle added a subscriber: Krinkle.

Change 306259 had a related patch set uploaded (by 20after4):
Scap swat command

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

mmodell updated the task description. (Show Details)Oct 1 2016, 10:55 PM
mmodell updated the task description. (Show Details)Oct 1 2016, 11:03 PM

Mentioned in SAL (#wikimedia-releng) [2016-10-04T01:14:21Z] <twentyafterfour> New scap command line autocompletions are now installed on deployment-tin and deployment-mira refs T142880

Change 306259 merged by jenkins-bot:
Scap swat command

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