Skip to content

[DYN-3364] Cherry-pick workflow#11415

Merged
QilongTang merged 41 commits intoDynamoDS:masterfrom
Astul-Betizagasti:cherry-pick
Jan 21, 2021
Merged

[DYN-3364] Cherry-pick workflow#11415
QilongTang merged 41 commits intoDynamoDS:masterfrom
Astul-Betizagasti:cherry-pick

Conversation

@Astul-Betizagasti
Copy link
Contributor

@Astul-Betizagasti Astul-Betizagasti commented Jan 20, 2021

Purpose

Includes a GitHub workflow that automates cherry-picking commits from master to other branches on the repository.

How it works

Include the following command on the description of the "squash and merge" box when merging a pull request

Cherry-pick to: 'branch-name'

Example:
image

Other valid variations of the command are:

  • cherry-pick to: 'branch-name'
  • cherry-pick to:'branch-name'
  • Cherry-pick to:'branch-name'

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated

Reviewers

Aaron Tang (@QilongTang )

FYIs

Alfredo Pozo (@alfredo-pozo )

Astul-Betizagasti and others added 30 commits July 6, 2020 17:48
Master update from public repo
- name: Create PR to branch
#If a target branch was found will run the action
if: env.destination_branch != 'invalid'
uses: gorillio/github-action-cherry-pick@master
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only concern for me is if this action will be maintained on the long term, because is not supported by someone like GitHub or Microsoft, on that case I will prefer to create our own script that will do the logic.

What do you think @QilongTang ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alfredo-pozo You have a good point. I am less worried about this given Git cli commands are very backward compatible. I am hesitate to invest too much in writing our own action not because it's not useful but because of the effort to maintain them. We will rely on a lot of actions to finish our automations so I say we leave it as it is for now and focus on other Dynamo improvements. Thank you for the comment though

#Extracts the branch name
if($commitData){
$splitedData = $commitData.Line.split("'")
$branchName = $splitedData[1]
Copy link
Contributor

@QilongTang QilongTang Jan 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this means the Cherry-pick to branchname needs to be in the first line of the commit message right? Otherwise, other commit message may rune this condition, would you add comments?
e.g.

  • commit message add resource string 'xxx'
  • ...

Cherry-pick to 'target branch'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "cherry-pick to: 'branch'" command is captured on line 4 and currently it can be in any part of the description. The lines you selected (8,9) are the ones that extract the branch name from the command. Maybe "commitData" isn't the best name for that variable as it can generate some confusion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, so the commitData will be the string Cherry-pick to 'target branch'? Would you add the format as comment on line 4?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct, added the comment and changed that variable name for something more representative of its value

steps:
- name: checkout
uses: actions/checkout@v2
#Removes posible conflicting characters on the commit message
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conflicting characters are?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, quotation marks, this is because the content of the message will be passed to a script as a parameter (line 28) and quotation marks will split the text as if it where multiple parameters.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, please put this as comment below this line. After that we can merge this and give it a try.

@QilongTang
Copy link
Contributor

Looks good, just curious what conflicting characters will be replaced

@QilongTang QilongTang merged commit 8d4ab31 into DynamoDS:master Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants