reviewboard.reviews.conditions¶
Condition choices and operators for review requests and related objects.
-
class
ReviewRequestConditionChoiceMixin
[source]¶ Bases:
object
Mixin for condition choices that operate off review requests.
This will set state needed to match against the choice.
-
class
AnyReviewGroupsPublicOperator
(choice)[source]¶ Bases:
djblets.conditions.operators.BaseConditionOperator
An operator for matching against any public review groups.
-
matches
(match_value, **kwargs)[source]¶ Return whether any review groups are public.
Parameters: - match_value (list of reviewboard.reviews.models.group.Group) – The review groups to match.
- **kwargs (dict) – Unused keyword arguments.
Returns: True
if any review groups are public.False
if all are invite-only or the list is empty.Return type:
-
-
class
AllReviewGroupsInviteOnlyOperator
(choice)[source]¶ Bases:
djblets.conditions.operators.BaseConditionOperator
An operator for matching against all invite-only review groups.
-
matches
(match_value, **kwargs)[source]¶ Return whether all review groups in the list are invite-only.
Parameters: - match_value (list of reviewboard.reviews.models.group.Group) – The review groups to match.
- **kwargs (dict) – Unused keyword arguments.
Returns: True
if all review group in the list are invite-only.False
if any are public, or the list is empty.Return type:
-
-
class
ReviewGroupsChoice
(**kwargs)[source]¶ Bases:
djblets.conditions.choices.BaseConditionModelMultipleChoice
A condition choice for matching review groups.
This is used to match a
Group
against a list of groups, against no group (empty list), or against a group’s public/invite-only state.-
get_queryset
()[source]¶ Return the queryset used to look up review group choices.
Returns: The queryset for review groups. Return type: django.db.models.query.QuerySet
-
get_match_value
(review_groups, value_state_cache, **kwargs)[source]¶ Return the review groups used for matching.
Parameters: - review_groups (django.db.models.query.QuerySet) – The provided queryset for review groups.
- **kwargs (dict) – Unused keyword arguments.
Returns: The list of review groups.
Return type: list of reviewboard.reviews.models.group.Group
-
-
class
ReviewRequestBranchChoice
(**kwargs)[source]¶ Bases:
reviewboard.reviews.conditions.ReviewRequestConditionChoiceMixin
,djblets.conditions.choices.BaseConditionStringChoice
A condition choice for matching a review request’s branch.
-
get_match_value
(review_request, **kwargs)[source]¶ Return the branch text used for matching.
Parameters: - review_request (reviewboard.reviews.models.review_request.ReviewRequest) – The provided review request.
- **kwargs (dict) – Unused keyword arguments.
Returns: The review request’s branch text.
Return type: unicode
-
-
class
ReviewRequestDescriptionChoice
(**kwargs)[source]¶ Bases:
reviewboard.reviews.conditions.ReviewRequestConditionChoiceMixin
,djblets.conditions.choices.BaseConditionStringChoice
A condition choice for matching a review request’s description.
-
get_match_value
(review_request, **kwargs)[source]¶ Return the description text used for matching.
Parameters: - review_request (reviewboard.reviews.models.review_request.ReviewRequest) – The provided review request.
- **kwargs (dict) – Unused keyword arguments.
Returns: The review request’s description text.
Return type: unicode
-
-
class
BaseReviewRequestDiffFileChoice
(**kwargs)[source]¶ Bases:
reviewboard.reviews.conditions.ReviewRequestConditionChoiceMixin
,djblets.conditions.choices.ConditionChoiceMatchListItemsMixin
,djblets.conditions.choices.BaseConditionStringChoice
A condition choice for matching affected diff files on a review request.
This matches against a list of file paths that were added/modified/deleted on the latest diffset of a review request.
-
get_match_value
(review_request, value_state_cache, **kwargs)[source]¶ Return the list of filenames used for matching.
Parameters: - review_request (reviewboard.reviews.models.review_request.ReviewRequest) – The provided review request.
- **kwargs (dict) – Unused keyword arguments.
Returns: The set of filenames.
Return type: set of unicode
-
-
class
ReviewRequestAnyDiffFileChoice
(**kwargs)[source]¶ Bases:
reviewboard.reviews.conditions.BaseReviewRequestDiffFileChoice
-
class
ReviewRequestAllDiffFilesChoice
(**kwargs)[source]¶ Bases:
reviewboard.reviews.conditions.BaseReviewRequestDiffFileChoice
-
class
ReviewRequestOwnerChoice
(**kwargs)[source]¶ Bases:
reviewboard.site.conditions.LocalSiteModelChoiceMixin
,reviewboard.reviews.conditions.ReviewRequestConditionChoiceMixin
,djblets.conditions.choices.BaseConditionModelMultipleChoice
A condition choice for matching a review request’s owner.
-
class
ReviewRequestReviewerChoice
(**kwargs)[source]¶ Bases:
reviewboard.site.conditions.LocalSiteModelChoiceMixin
,reviewboard.reviews.conditions.ReviewRequestConditionChoiceMixin
,djblets.conditions.choices.BaseConditionModelMultipleChoice
A condition choice for matching a review request’s reviewer.
-
get_match_value
(review_request, **kwargs)[source]¶ Return the reviewers used for matching.
Parameters: - review_request (reviewboard.reviews.models.review_request.ReviewRequest) – The provided review request.
- **kwargs (dict, unused) – Unused keyword arguments.
Returns: List of the review request’s reviewers.
Return type: list of django.contrib.auth.models.User
-
-
class
ReviewRequestParticipantChoice
(**kwargs)[source]¶ Bases:
reviewboard.site.conditions.LocalSiteModelChoiceMixin
,reviewboard.reviews.conditions.ReviewRequestConditionChoiceMixin
,djblets.conditions.choices.BaseConditionModelMultipleChoice
A condition choice for matching a review request’s participant.
-
get_match_value
(review_request, **kwargs)[source]¶ Return the participants used for matching.
Parameters: - review_request (reviewboard.reviews.models.review_request.ReviewRequest) – The provided review request.
- **kwargs (dict, unused) – Unused keyword arguments.
Returns: The review request’s participants.
Return type: set of django.contrib.auth.models.User
-
-
class
ReviewRequestSummaryChoice
(**kwargs)[source]¶ Bases:
reviewboard.reviews.conditions.ReviewRequestConditionChoiceMixin
,djblets.conditions.choices.BaseConditionStringChoice
A condition choice for matching a review request’s summary.
-
get_match_value
(review_request, **kwargs)[source]¶ Return the summary text used for matching.
Parameters: - review_request (reviewboard.reviews.models.review_request.ReviewRequest) – The provided review request.
- **kwargs (dict) – Unused keyword arguments.
Returns: The review request’s summary text.
Return type: unicode
-
-
class
ReviewRequestTestingDoneChoice
(**kwargs)[source]¶ Bases:
djblets.conditions.choices.BaseConditionStringChoice
A condition choice for matching a review request’s Testing Done field.
-
get_match_value
(review_request, **kwargs)[source]¶ Return the testing done text used for matching.
Parameters: - review_request (reviewboard.reviews.models.review_request.ReviewRequest) – The provided review request.
- **kwargs (dict) – Unused keyword arguments.
Returns: The review request’s testing done text.
Return type: unicode
-
-
class
ReviewRequestRepositoriesChoice
(**kwargs)[source]¶ Bases:
reviewboard.reviews.conditions.ReviewRequestConditionChoiceMixin
,reviewboard.scmtools.conditions.RepositoriesChoice
A condition choice for matching a review request’s repositories.
-
get_match_value
(review_request, **kwargs)[source]¶ Return the repository used for matching.
Parameters: - review_request (reviewboard.reviews.models.review_request.ReviewRequest) – The provided review request.
- **kwargs (dict) – Unused keyword arguments.
Returns: The review request’s repository.
Return type:
-
-
class
ReviewRequestRepositoryTypeChoice
(**kwargs)[source]¶ Bases:
reviewboard.reviews.conditions.ReviewRequestConditionChoiceMixin
,reviewboard.scmtools.conditions.RepositoryTypeChoice
A condition choice for matching a review request’s repository types.
-
get_match_value
(review_request, **kwargs)[source]¶ Return the repository used for matching.
Parameters: - review_request (reviewboard.reviews.models.review_request.ReviewRequest) – The provided review request.
- **kwargs (dict) – Unused keyword arguments.
Returns: The review request’s repository.
Return type:
-
-
class
ReviewRequestReviewGroupsChoice
(**kwargs)[source]¶ Bases:
reviewboard.reviews.conditions.ReviewRequestConditionChoiceMixin
,reviewboard.reviews.conditions.ReviewGroupsChoice
A condition choice for matching a review request’s review groups.
-
get_match_value
(review_request, **kwargs)[source]¶ Return the review groups used for matching.
Parameters: - review_request (reviewboard.reviews.models.review_request.ReviewRequest) – The provided review request.
- **kwargs (dict) – Extra keyword arguments.
Returns: The queryset for a review request’s target review groups.
Return type:
-
-
class
ReviewRequestConditionChoices
(choices=[])[source]¶ Bases:
djblets.conditions.choices.ConditionChoices
A standard set of review request condition choices.
This provides a handful of condition choices that are useful for review requests. They can be used in integrations or any other place where conditions are used.
-
choice_classes
= [<class 'reviewboard.reviews.conditions.ReviewRequestBranchChoice'>, <class 'reviewboard.reviews.conditions.ReviewRequestDescriptionChoice'>, <class 'reviewboard.reviews.conditions.ReviewRequestRepositoriesChoice'>, <class 'reviewboard.reviews.conditions.ReviewRequestRepositoryTypeChoice'>, <class 'reviewboard.reviews.conditions.ReviewRequestReviewGroupsChoice'>, <class 'reviewboard.reviews.conditions.ReviewRequestOwnerChoice'>, <class 'reviewboard.reviews.conditions.ReviewRequestReviewerChoice'>, <class 'reviewboard.reviews.conditions.ReviewRequestParticipantChoice'>, <class 'reviewboard.reviews.conditions.ReviewRequestSummaryChoice'>, <class 'reviewboard.reviews.conditions.ReviewRequestTestingDoneChoice'>][source]¶
-