Update misleading dry-run message when no comment will be posted
Problem
When I define a rule with an action like this:
- name: Re-open closed issues that have a new comment
conditions:
state: closed
ruby: resource[:closed_at] < resource[:updated_at]
actions:
status: reopen
labels:
- reopened
Running gitlab-triage --dry-run
shows the following message:
The following comments would be posted for the rule **Re-open closed issues that have a new comment**:
.# https://gitlab.com/gitlab-examples/ops/service-desk-triage/service-desk/-/issues/1
```
\/label ~"reopened"
\/reopen
```
In reality, no comment will actually be posted. Instead, the bot will apply the label and reopen the issue (as expected).
The problem is that the dry-run makes me think a comment will be posted.
When using gitlab-triage
on Service Desk issues, every non-internal comment results in an email sent to a customer. In this scenario, I want to make sure that the actions I define will not result in any comment being posted. With the current dry-run message, I would be worried that my customers will receive a weird email that says /label ~"reopened" /reopen
, which would be really bad. That might make me not want to use gitlab-triage
at all.
Proposal
When there is no comment:
action defined in a rule, running a --dry-run
should output this message instead:
The following actions would be applied for the rule **Re-open closed issues that have a new comment**:
.# https://gitlab.com/gitlab-examples/ops/service-desk-triage/service-desk/-/issues/1
```
\/label ~"reopened"
\/reopen
```