-
Notifications
You must be signed in to change notification settings - Fork 45
Description
Describe the bug
The add-label action is documented as a "managed" action that should automatically remove labels when their triggering conditions no longer apply. However, in practice, labels added by gitStream persist even after the conditions change. Specifically, our missing-jira label remains on MRs even after a Jira ticket link is added to the PR description.
To Reproduce
Steps to reproduce the behavior:
- The
.cmautomation file:
# -*- mode: yaml -*-
manifest:
version: 1.0
automations:
label_missing_jira_info:
# Triggered for PRs that don't have a link to a Jira ticket in the PR description.
if:
- {{ not has.jira_ticket_in_desc }}
- {{ not (branch.author | includes(term="RENOVATE")) }}
run:
- action: add-label@v1
args:
label: "missing-jira"
color: 'F6443B'
has:
jira_ticket_in_desc: {{ pr.description | includes(regex=r/atlassian.net\/browse\/\w+-\d+\b/) }}- Example PR URLs demonstrating the issue:
- PR relevant content: All three MRs had Jira ticket links in their descriptions added (matching the regex pattern
atlassian.net\/browse\/\w+-\d+\b) but still have themissing-jiralabel applied
Expected behavior
According to the gitStream documentation,
when a PR updates existing labels that were added by gitStream are re-evaluated and those that are not applicable are removed.
When a Jira link is added to the PR description, the condition {{ not has.jira_ticket_in_desc }} should evaluate to false, and gitStream should automatically remove the missing-jira label during re-evaluation.
These MRs all had commits pushed to them after too, and successful GitStream runs
Screenshots
Additional context
- This is an organization-level automation in the
cmrepository that applies to all connected repositories - Running gitStream Docker image version: v1.0.158
- The automation uses the
add-label@v1action which is documented as a managed action - There is no
remove-labelaction available in gitStream, so we rely on the documented managed behavior - This affects multiple repositories across the organization (android, ios, core, etc.)