-
Notifications
You must be signed in to change notification settings - Fork 20
cherry-picked PR #14
base: master
Are you sure you want to change the base?
cherry-picked PR #14
Conversation
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 have quite a few comments, but I'm very excited to see this feature arriving. :)
@@ -52,6 +53,11 @@ def main(): | |||
with open(os.environ['GITHUB_EVENT_PATH'], 'r') as f: | |||
event = json.load(f) | |||
print(json.dumps(event, indent=4)) | |||
|
|||
# Check if it's a push event |
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.
Suggest this would be easier to test and maintain as a standalone action. There isn't any conceptual relationship between this functionality and JIRA, and the script doesn't use any functions from the jira sync code.
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 plan to refactor the github-actions so it is standalone action. Unfortunately this requires much more effort than I anticipated initially and I suggest we address that in new pull request.
new_title = '[Merged] ' + original_title | ||
pull_request.edit(title=new_title) | ||
# Thank contributor for opening pull request. Let them know we didn't throw it away | ||
pull_request.create_issue_comment('The pull request has been cherry-picked, the commit is linked above.\ |
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.
Sometimes we actually do "close" a PR by doing something different to what the author originally intended, and with a totally different commit. We try to avoid this, but it's necessary sometimes.
Ideally this action would check if the commit author is the same as the author of any of the commits in the PR branch, and only continue if it is. However this is probably a rare enough occasion that you can consider it a "nice to have". :)
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.
Thank you for suggestion. I have noted this feature request and will implement it in the future.
sync_issues_to_jira/push_event.py
Outdated
|
||
|
||
def parse_commit_message(commit_message): | ||
# Regex matches numbers that come after Fix, fix, Fixed, fixed, Fixes, fixes keyword followed by any |
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.
Our internal guide suggests writing "Merges ..." as well (which isn't a GitHub keyword) and then manually telling the author their PR has been cherry-picked. This is something I originally did a lot as it seemed more polite. However, in recenttimes most people (including me) don't do this any more and they will write "Closes" or "Fixes".
I will send you a link to the page, up to you if you prefer to update the script to make the original workflow convenient or update the workflow to match the current behaviour.
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 update workflow after this functionality is live in github-actions.
@tom-borcin I would ask to address the two remaining requests, if you can:
I think the easiest way to handle the latter is to still require
Besides that, there is one more thing we can address by this I think we can use the same approach, triggering an action on a push event (this time for release branches only), detecting One idea I have is to let the action accept several arguments:
This way we can use the same action in both cases, specifying different arguments. |
@tom-borcin Can we close this PR? |
Added functionality to leave comment and add [Merged] keyword to cherry-picked pull request. It is triggered by push event and searches the commit message for pull request number to be handled.