-
-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add assignees option to the copy and backport commands #2336
feat: add assignees option to the copy and backport commands #2336
Conversation
Similar to #2334. I've no clue how to test this locally, though my changes in the test data were good enough 👑 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can be more generic like assign
action does, for example:
voluptuous.Required("assignees", default[]: [types.Jinja2])
And then the configuration will look like this:
backport:
assignees: ["{{ author }}"]
What do you think?
@v1v this pull request is now in conflict 😩 |
docs/mergify_engine_gendoc.py
Outdated
f.write( | ||
f"""<head> | ||
<meta http-equiv="refresh" content="0; URL={url}"> | ||
<link rel="canonical" href="{url}"> | ||
</head> | ||
""") | ||
""" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated change caused by the tox -e black
command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will fix the tox target
e646b00
to
80754d1
Compare
I've just changed the implementation to use the suggestion from #2336 (review) Though, I might need some help with the test data |
Fixtures for the functional need to setup a GitHub app and a couple of GitHub accounts and API keys. I will take care of it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just post some remarks, but I have already fixed them locally. You don't have to fix them.
I'm currently generating the fixtures.
mergify_engine/duplicate_pull.py
Outdated
@@ -349,4 +351,10 @@ async def duplicate( | |||
json={"labels": effective_labels}, | |||
) | |||
|
|||
if assignees is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need also checks len(assignes) > 0
to avoid useless HTTP request
docs/mergify_engine_gendoc.py
Outdated
f.write( | ||
f"""<head> | ||
<meta http-equiv="refresh" content="0; URL={url}"> | ||
<link rel="canonical" href="{url}"> | ||
</head> | ||
""") | ||
""" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will fix the tox target
80754d1
to
90bf0c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just small doc change
docs/source/actions/backport.rst
Outdated
- The users to assign to the pull request. | ||
|
||
The list of users in ``assignees`` is based on :ref:`data type template`, you can use | ||
e.g. ``{{author}}`` to assign the pull request to its author. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The users to assign to the pull request. | |
The list of users in ``assignees`` is based on :ref:`data type template`, you can use | |
e.g. ``{{author}}`` to assign the pull request to its author. | |
- Users to assign the newly created pull request. As the type is :ref:`data type template`, you could use, e.g., ``{{author}}`` to assign the pull request to its original author. |
docs/source/actions/backport.rst
Outdated
@@ -94,5 +100,6 @@ added and the pull request merged: | |||
backport: | |||
branches: | |||
- stable | |||
assignees: ["{{ author }}"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assignees: ["{{ author }}"] | |
assignees: | |
- "{{ author }}" |
I feel it's more readable :)
docs/source/actions/copy.rst
Outdated
* - ``assignees`` | ||
- list of :ref:`data type template` | ||
- | ||
- The users to assign to the pull request. | ||
|
||
The list of users in ``assignees`` is based on :ref:`data type template`, you can use | ||
e.g. ``{{author}}`` to assign the pull request to its author. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change like backport above.
90bf0c2
to
791fd5c
Compare
Description of the change
Add assignees option to the copy and backport commands
Related issues
Fix #2287
Checklists
Development
hotfix
labelCode Review
Code review policies are handled and automated by Mergify.
remaining, pull request is retested against its base branch.