Reviewer Actions (autotransform.step.action.reviewers)

All Actions associated with a Change’s reviewers.

class autotransform.step.action.reviewers.AddOwnersAsReviewersAction

Bases: Action

Adds the owners of a Schema as reviewers for the Change.

name

The name of the component.

Type:

ClassVar[ActionName]

name: ClassVar[ActionName] = 'add_owners_as_reviewers'
run(change: Change) bool

Adds owners as reviewers to the specified Change.

Parameters:

change (Change) – The Change to add reviewers to.

Returns:

Whether the reviewers were added successful.

Return type:

bool

class autotransform.step.action.reviewers.AddOwnersAsTeamReviewersAction

Bases: Action

Adds the owners of a Schema as team reviewers for the Change.

name

The name of the component.

Type:

ClassVar[ActionName]

name: ClassVar[ActionName] = 'add_owners_as_team_reviewers'
run(change: Change) bool

Adds owners as team reviewers to the specified Change.

Parameters:

change (Change) – The Change to add team reviewers to.

Returns:

Whether the team reviewers were added successful.

Return type:

bool

class autotransform.step.action.reviewers.AddReviewersAction(*, reviewers: List[str] = None, team_reviewers: List[str] = None)

Bases: Action

Adds reviewers to an existing Change.

reviewers

The list of reviewers to add. Defaults to [].

Type:

optional, List[str]

team_reviewers

The list of team reviewers to add. Defaults to [].

Type:

optional, List[str]

name

The name of the component.

Type:

ClassVar[ActionName]

classmethod labels_must_be_non_empty(v: List[str]) List[str]

Validates the reviewers are not empty strings.

Parameters:

v (List[str]) – The reviewers to add to the Change.

Raises:

ValueError – Raises an error if a reviewer is an empty string.

Returns:

The unmodified reviewers to add.

Return type:

List[str]

name: ClassVar[ActionName] = 'add_reviewers'
reviewers: List[str]
run(change: Change) bool

Adds reviewers to the specified Change.

Parameters:

change (Change) – The Change to add reviewers to.

Returns:

Whether the reviewers were added successful.

Return type:

bool

classmethod some_reviewers_must_be_provided(values: Dict[str, Any]) Dict[str, Any]

Checks that either reviewers or team reviewers are supplied.

Parameters:

values (Dict[str, Any]) – The values for the action.

Raises:

ValueError – Raises an error if neither reviewers nor team reviewers are supplied.

Returns:

The unmodified values.

Return type:

Dict[str, Any]

team_reviewers: List[str]
classmethod team_reviewers_must_be_non_empty(v: List[str]) List[str]

Validates the team reviewers are not empty strings.

Parameters:

v (List[str]) – The team reviewers to add to the Change.

Raises:

ValueError – Raises an error if a team reviewer is an empty string.

Returns:

The unmodified team reviewers to add.

Return type:

List[str]