Skip to content

Commit

Permalink
Merge pull request #26332 from Expensify/Rory-DontRemoveDeployBlockers
Browse files Browse the repository at this point in the history
[No QA] Include closed and demoted blockers in the checklist when updating
  • Loading branch information
luacmartins authored Aug 30, 2023
2 parents c9a5f41 + 3ac2b6a commit a644050
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ async function run() {
repo: CONST.APP_REPO,
labels: CONST.LABELS.DEPLOY_BLOCKER,
});

// First, make sure we include all current deploy blockers
const deployBlockers = _.reduce(
openDeployBlockers,
(memo, deployBlocker) => {
Expand All @@ -83,6 +85,15 @@ async function run() {
[],
);

// Then make sure we include any demoted or closed blockers as well, and just check them off automatically
for (const deployBlocker of currentChecklistData.deployBlockers) {
const isResolved = _.findIndex(deployBlockers, (openBlocker) => openBlocker.number === deployBlocker.number) < 0;
deployBlockers.push({
...deployBlocker,
isResolved,
});
}

const didVersionChange = newVersion ? newVersion !== currentChecklistData.tag : false;
checklistBody = await GithubUtils.generateStagingDeployCashBody(
newTag,
Expand Down
11 changes: 11 additions & 0 deletions .github/actions/javascript/createOrUpdateStagingDeploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ async function run() {
repo: CONST.APP_REPO,
labels: CONST.LABELS.DEPLOY_BLOCKER,
});

// First, make sure we include all current deploy blockers
const deployBlockers = _.reduce(
openDeployBlockers,
(memo, deployBlocker) => {
Expand All @@ -93,6 +95,15 @@ async function run() {
[],
);

// Then make sure we include any demoted or closed blockers as well, and just check them off automatically
for (const deployBlocker of currentChecklistData.deployBlockers) {
const isResolved = _.findIndex(deployBlockers, (openBlocker) => openBlocker.number === deployBlocker.number) < 0;
deployBlockers.push({
...deployBlocker,
isResolved,
});
}

const didVersionChange = newVersion ? newVersion !== currentChecklistData.tag : false;
checklistBody = await GithubUtils.generateStagingDeployCashBody(
newTag,
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/createOrUpdateStagingDeployTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ describe('createOrUpdateStagingDeployCash', () => {
if (args.labels === CONST.LABELS.DEPLOY_BLOCKER) {
return {
data: [
...currentDeployBlockers,
// Suppose the first deploy blocker is demoted, it should not be removed from the checklist and instead just be checked off
...currentDeployBlockers.slice(1),
{
html_url: 'https://github.com/Expensify/App/issues/11', // New
number: 11,
Expand Down Expand Up @@ -363,7 +364,7 @@ describe('createOrUpdateStagingDeployCash', () => {
`${lineBreak}${closedCheckbox}${basePRList[6]}` +
`${lineBreak}${openCheckbox}${basePRList[7]}${lineBreak}` +
`${lineBreakDouble}${deployBlockerHeader}` +
`${lineBreak}${openCheckbox}${basePRList[5]}` +
`${lineBreak}${closedCheckbox}${basePRList[5]}` +
`${lineBreak}${openCheckbox}${basePRList[8]}` +
`${lineBreak}${closedCheckbox}${basePRList[9]}` +
`${lineBreak}${openCheckbox}${baseIssueList[0]}` +
Expand Down

0 comments on commit a644050

Please sign in to comment.