[GH Actions] Create getPullRequestsMergedBetween function
See original GitHub issueIf you haven’t already, check out our contributing guidelines for onboarding!
Problem
As part of our new Expensify.cash Deploy & QA process, we need a way to be able to figure out the set of PRs that moved the application from some older version to some newer version.
Why is this important?
This operation has myriad usages in the Deploy & QA process. One such use is to gather the PRs that have been deployed to staging since the previously QA’d version, so that Applause can QA all those PRs.
Solution
Create a Javascript function in expensify-common called getPullRequestsMergedBetween
that will take in two git refs, and will gather a list of PR numbers of all PRs merged between those two refs by:
-
Executing the following shell command to list all commit messages between the two refs:
git log --format="%s" ${FROM_REF}...${TO_REF}
-
Apply this regex to parse the PR numbers of merged PRs from the results:
/Merge pull request #(\d{1,6})/g
-
Return the resulting list of PR numbers.
To be considered complete
- Document manual testing done
- Provide automated unit tests for this function
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (15 by maintainers)
Top GitHub Comments
Hi @arielgreen
I would like to work on this issue. Here is my proposal:
getPullRequestsMergedBetween
function that will take 2 git refs as parameters inGithubUtils
class.git log --format="%s" ${FROM_REF}...${TO_REF}
command viaexec
function like this https://github.com/Expensify/Expensify.cash/blob/0421229ce750290d181c2e150cf97a2640c59c37/.github/actions/bumpVersion/bumpVersion.js#L17new RegExp(/Merge pull request #(\d{1,6})/, 'g');
A question for you, in which context are we going to call this function? Are we going to get the repository folder as a parameter or are we going to have something like
octokit
client?@tugbadogan nothing else to do here, so I’ll close this issue. There’s a standard 7-day wait period between the time your PR is merged and when we pay out issues, to allow some time to see if your code introduces any unforeseen regressions.