Extension:CodeReview/API

From MediaWiki.org
Jump to navigation Jump to search

CodeDiff[edit]

Parameters[edit]

  • repo: Name of repository to look at
  • rev: Revision ID to fetch diff of Type: integer Possible values: >= 1



action=codediff

(main | codediff)

Fetch formatted diff from CodeReview's backing revision control system.

Parameters:
repo

Name of repository to look at.

This parameter is required.
rev

Revision ID to fetch diff of.

This parameter is required.
The value must be no less than 1.
Type: integer
Example:
Fetch a diff for MediaWiki revision 42080
api.php?action=codediff&repo=MediaWiki&rev=42080 [open in sandbox]

CodeRevisionUpdate[edit]

Parameters[edit]

  • repo: Name of repository
  • rev: Revision ID number Type: integer Possible values: >= 1
  • comment: Comment to add to the revision
  • status: Status to set the revision to
  • addtags: Tags to be added to the revision No more than 50 (500 for bots) allowed.
  • removetags: Tags to be removed to the revision No more than 50 (500 for bots) allowed.
  • addflags: Code Signoff flags to assign to the revision by the current user Possible values: inspected, tested
  • removeflags: Code Signoff flags to strike from to the revision by the current user Possible values: inspected, tested
  • addreferences: Add references to this revision No more than 50 (500 for bots) allowed.
  • removereferences: Remove references to this revision No more than 50 (500 for bots) allowed.
  • addreferenced: Add referenced revisions from this revision No more than 50 (500 for bots) allowed.
  • removereferenced: Remove referenced revisions from this revision No more than 50 (500 for bots) allowed.
  • token: A "csrf" token retrieved from action=query&meta=tokens



action=coderevisionupdate

(main | coderevisionupdate)
  • This module requires read rights.
  • This module requires write rights.
  • This module only accepts POST requests.
  • Source: CodeReview
  • License: GPL-2.0-or-later

Submit comments, new status and tags to a revision.

Parameters:
repo

Name of repository.

This parameter is required.
rev

Revision ID number.

This parameter is required.
The value must be no less than 1.
Type: integer
comment

Comment to add to the revision.

status

Status to set the revision to.

One of the following values: new, fixme, reverted, resolved, ok, deferred, old
addtags

Tags to be added to the revision.

Separate values with | or alternative. Maximum number of values is 50 (500 for bots).
removetags

Tags to be removed from the revision.

Separate values with | or alternative. Maximum number of values is 50 (500 for bots).
addflags

Code Signoff flags to assign to the revision by the current user.

Values (separate with | or alternative): inspected, tested
removeflags

Code Signoff flags to strike from the revision by the current user.

Values (separate with | or alternative): inspected, tested
addreferences

Add references to this revision.

Type: list of integers
Separate values with | or alternative. Maximum number of values is 50 (500 for bots).
removereferences

Remove references from this revision.

Type: list of integers
Separate values with | or alternative. Maximum number of values is 50 (500 for bots).
addreferenced

Add referenced revisions from this revision.

Type: list of integers
Separate values with | or alternative. Maximum number of values is 50 (500 for bots).
removereferenced

Remove referenced revisions from this revision.

Type: list of integers
Separate values with | or alternative. Maximum number of values is 50 (500 for bots).
token

A "csrf" token retrieved from action=query&meta=tokens

This parameter is required.

Lists[edit]


list=codecomments (cc)

(main | query | codecomments)

List comments on revisions in CodeReview.

Parameters:
ccrepo

Name of the repository.

This parameter is required.
cclimit

How many comments to return.

No more than 500 (5,000 for bots) allowed.
Type: integer or max
Default: 10
ccstart

Timestamp to start listing at.

Type: timestamp (allowed formats)
ccprop

Which properties to return. revision is a deprecated alias for status.

Values (separate with | or alternative): timestamp, user, status, text, revid, revision
Default: timestamp|user|status|revid

list=codepaths (cp)

(main | query | codepaths)

Get a list of 10 paths in a given repository, based on the input path prefix.

Parameters:
cprepo

Name of the repository.

This parameter is required.
cppath

Path prefix to filter on.

This parameter is required.

list=coderevisions (cr)

(main | query | coderevisions)

List revisions in CodeReview.

Parameters:
crrepo

Name of the repository.

This parameter is required.
crlimit

How many revisions to return.

No more than 500 (5,000 for bots) allowed.
Type: integer or max
Default: 10
crpath

Only show revisions in these paths.

crstart

Timestamp to start listing at.

Type: integer
crrevs

List of revisions to get information about. Overrides crstart.

The values must be no less than 1.
Type: list of integers
Separate values with | or alternative. Maximum number of values is 50 (500 for bots).
crprop

Which properties to return.

Values (separate with | or alternative): revid, status, commentcount, path, message, author, tags, timestamp, followups, followedup
Default: revid|status|author|timestamp

list=codetags (ct)

(main | query | codetags)

Get a list of tags applied to revisions in a given repository.

Parameter:
ctrepo

Name of the repository.

This parameter is required.