Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add support for reviewer changes in merge requests #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions gitlab_matrix/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,12 @@ class GitlabAssigneeChanges(GitlabChangeWrapper, SerializableAttrs):
current: List[GitlabUser]


@dataclass
class GitlabReviewersChanges(GitlabChangeWrapper, SerializableAttrs):
previous: List[GitlabUser]
current: List[GitlabUser]


@dataclass
class GitlabLabelChanges(GitlabChangeWrapper, SerializableAttrs):
previous: List[GitlabLabel]
Expand Down Expand Up @@ -290,6 +296,7 @@ class GitlabChanges(SerializableAttrs):
title: Optional[GitlabStringChange] = None
labels: Optional[GitlabLabelChanges] = None
assignees: Optional[GitlabAssigneeChanges] = None
reviewers: Optional[GitlabReviewersChanges] = None
time_estimate: Optional[GitlabIntChange] = None
total_time_spent: Optional[GitlabIntChange] = None
weight: Optional[GitlabIntChange] = None
Expand Down
3 changes: 3 additions & 0 deletions templates/macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,6 @@
{%- macro assignee_changes(added, removed) -%}
{{ list_changes(added, removed, "assigned", "unassigned", user_link) }}
{%- endmacro -%}
{%- macro reviewers_changes(added, removed) -%}
{{ list_changes(added, removed, "assigned", "unassigned", user_link) }}
{%- endmacro -%}
3 changes: 3 additions & 0 deletions templates/messages/issue_update.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
{% elif changes.assignees %}
{{ assignee_changes(changes.assignees.added, changes.assignees.removed) }}
{{ issue_or_merge_link(object_attributes) }}
{% elif changes.reviewers %}
{{ reviewers_changes(changes.reviewers.added, changes.reviewers.removed) }}
{{ issue_or_merge_link(object_attributes) }}
{% elif changes.time_estimate %}
{% if not changes.time_estimate.current %}
removed the time estimate of {{ issue_or_merge_link(object_attributes) }}
Expand Down