Description of the problem
Lately (about the last month) I noticed a wried behavior with gitStream in our Repo where it is auto-approving PRs.
For example (can't provide link to the PR since it's a private repo):
When I opened a PR for a python file client.py (+16 lines added -1 removed = total of 17 lines) the gitStream bot auto-approved the CR.
The bot label it as a safe-changes, so i tried to validate the conditions for save_changes automation, but couldn't find any reason to categorize the PR as safe-changes
the condition is:
{{ is.safe }}
where:
docs: {{ files | allDocs }}
tests: {{ files | allTests }}
asset: {{ files | match(regex=r/\.(png|svg|gif|css)$/) | every }}
formatting: {{ source.diff.files | isFormattingChange }}
safe: {{ is.docs or is.tests or is.asset or is.formatting }}
Steps to reproduce the behavior:
The .cm automation file:
# -*- mode: yaml -*-
manifest:
version: 1.0
automations:
safe_changes:
if:
{{ is.safe }}
run:
action: approve@v1
action: add-label@v1
args:
label: 'safe-changes'
small_changes:
if:
{{ is.small_changes }}
run:
action: approve@v1
action: add-label@v1
args:
label: 'small-changes'
is:
docs: {{ files | allDocs }}
tests: {{ files | allTests }}
asset: {{ files | match(regex=r/.(png|svg|gif|css)$/) | every }}
formatting: {{ source.diff.files | isFormattingChange }}
safe: {{ is.docs or is.tests or is.asset or is.formatting }}
2. The PR URL (as it contains the repo and PR identifiers)
Can't provide as its a private repo, but can be reproduced with any dummy repo with python file
**Expected behavior**
Shouldn't give any label as it's not match the automation conditions
**Screenshots**
![image](https://github.com/user-attachments/assets/0fdc199d-7af5-4aa1-a9ac-e379592f0d35)
![image](https://github.com/user-attachments/assets/c844aed4-f55e-4d25-b971-77b4ff2edcc4)
![image](https://github.com/user-attachments/assets/cfc6b44e-ede4-40b7-aed7-02b78425a18f)
![image](https://github.com/user-attachments/assets/1953f8bf-f344-421e-9fd2-86f7d351495b)
![image](https://github.com/user-attachments/assets/41f67d90-97d2-4187-a679-438f4f0d2a82)
![image](https://github.com/user-attachments/assets/c6f4a781-9bcf-4db7-ac59-31e86a438151)
![image](https://github.com/user-attachments/assets/c98cddae-00e2-4bc8-85cc-9ae7419c552d)
Description of the problem Lately (about the last month) I noticed a wried behavior with gitStream in our Repo where it is auto-approving PRs.
For example (can't provide link to the PR since it's a private repo): When I opened a PR for a python file
client.py
(+16 lines added -1 removed = total of 17 lines) the gitStream bot auto-approved the CR. The bot label it as asafe-changes
, so i tried to validate the conditions for save_changes automation, but couldn't find any reason to categorize the PR assafe-changes
the condition is:
{{ is.safe }}
where:
Steps to reproduce the behavior:
.cm
automation file:automations: safe_changes: if:
{{ is.safe }} run:
action: approve@v1
action: add-label@v1 args: label: 'safe-changes'
small_changes: if:
{{ is.small_changes }} run:
action: approve@v1
action: add-label@v1 args: label: 'small-changes'
is: docs: {{ files | allDocs }} tests: {{ files | allTests }} asset: {{ files | match(regex=r/.(png|svg|gif|css)$/) | every }} formatting: {{ source.diff.files | isFormattingChange }} safe: {{ is.docs or is.tests or is.asset or is.formatting }}
additions: {{ branch.diff.files_metadata | map(attr='additions') | sum }} deletions: {{ branch.diff.files_metadata | map(attr='deletions') | sum }} small_changes: {{ (is.additions + is.deletions) <= 10 }}