Skip to content
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

Placeholders for the original PR author, and user that made the label or comment #75

Closed
nh2 opened this issue Jun 26, 2021 · 4 comments · Fixed by #84
Closed

Placeholders for the original PR author, and user that made the label or comment #75

nh2 opened this issue Jun 26, 2021 · 4 comments · Fixed by #84
Labels
enhancement New feature or request

Comments

@nh2
Copy link

nh2 commented Jun 26, 2021

I would like to automatically subscribe to the backport PR by @-mentioning them:

  • the user who attached the label (or wrote the /backport comment) that triggered the backport PR
  • the author of the original, non-backport PR

The new pull_description functionality from PR #64 by @korthout is perfect for that, but we would need placeholder variables for those two users.

@korthout
Copy link
Owner

korthout commented Jun 27, 2021

@nh2 Sounds like a great addition! I'm almost done finishing up a pull request for #3 by adding a new placeholder ${issue_refs}. And I think I'll work on these next.

For the author of the original pull, I think something like ${pull_author} would be fitting.

For the other type of user, I'm not sure. Perhaps ${sender} (matching the GitHub naming) or ${triggered_by} (feels a bit more in the action's domain). Do you have any suggestions or preferences?

@korthout korthout added the enhancement New feature or request label Jun 27, 2021
@nh2
Copy link
Author

nh2 commented Jun 27, 2021

For the author of the original pull, I think something like ${pull_author} would be fitting.

Yes sounds good, or ${original_pull_author} if we want to be super specific.

Perhaps ${sender} (matching the GitHub naming) or ${triggered_by}

How about ${backport_trigger_user}?

Also I think the docs of such feature should then explain whether the placeholder already contains the @, or not -- for example, would "triggered by @${backport_trigger_user}" @-mention them?

Not including the @ in the placeholder could allow users of the bot to skip the @-mentioning (and thus the subscription), while still writing which user triggered it.

@korthout
Copy link
Owner

@nh2 Thanks for the suggestions! I'll have to think a bit about what I like best for naming.

I totally agree with the @ character. Leaving it out is more flexible. I'll make sure the doc is clear on what the placeholder is replaced with.

@korthout
Copy link
Owner

korthout commented Jul 4, 2021

Hi @nh2. I've added the pull_author placeholder. You can prefix it with an @ character like this: @${pull_author} to mention the user and subscribe them to notifications for the newly created backport pull request.

Note that I have not yet released a new version officially, but you can just refer to latest commit on main: 4c106a2.

Let me know if you run into any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants