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.

Revisions and Commits

rOMWC Wikimedia - MediaWiki Config
rMSCA Scap
Restricted Differential Revision
Restricted Differential Revision

Event Timeline

mmodell added a revision: Restricted Differential Revision.Sep 14 2016, 10:26 AM

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

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

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

mmodell added a revision: Restricted Differential Revision.Oct 5 2016, 2:33 AM

Change 306259 merged by jenkins-bot:
Scap swat command

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