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

[No QA] Add better logging for StagingDeployCash #3642

Merged
merged 2 commits into from
Jun 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ const run = function () {
// Look at the state of the most recent StagingDeployCash,
// if it is open then we'll update the existing one, otherwise, we'll create a new one.
shouldCreateNewStagingDeployCash = Boolean(stagingDeployResponse.data[0].state !== 'open');
if (shouldCreateNewStagingDeployCash) {
console.log('Latest StagingDeployCash is closed, creating a new one.', stagingDeployResponse.data[0]);
} else {
console.log(
'Latest StagingDeployCash is open, updating it instead of creating a new one.',
'Current:', stagingDeployResponse.data[0],
'Previous:', stagingDeployResponse.data[1],
);
}

// Parse the data from the previous StagingDeployCash
// (newest if there are none open, otherwise second-newest)
Expand All @@ -51,6 +60,10 @@ const run = function () {

// Find the list of PRs merged between the last StagingDeployCash and the new version
const mergedPRs = GitUtils.getPullRequestsMergedBetween(previousStagingDeployCashData.tag, newVersion);
console.log(
'The following PRs have been merged between the previous StagingDeployCash and new version:',
mergedPRs,
);

if (shouldCreateNewStagingDeployCash) {
// We're in the create flow, not update
Expand Down
13 changes: 13 additions & 0 deletions .github/actions/createOrUpdateStagingDeploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ const run = function () {
// Look at the state of the most recent StagingDeployCash,
// if it is open then we'll update the existing one, otherwise, we'll create a new one.
shouldCreateNewStagingDeployCash = Boolean(stagingDeployResponse.data[0].state !== 'open');
if (shouldCreateNewStagingDeployCash) {
console.log('Latest StagingDeployCash is closed, creating a new one.', stagingDeployResponse.data[0]);
} else {
console.log(
'Latest StagingDeployCash is open, updating it instead of creating a new one.',
'Current:', stagingDeployResponse.data[0],
'Previous:', stagingDeployResponse.data[1],
);
}

// Parse the data from the previous StagingDeployCash
// (newest if there are none open, otherwise second-newest)
Expand All @@ -61,6 +70,10 @@ const run = function () {

// Find the list of PRs merged between the last StagingDeployCash and the new version
const mergedPRs = GitUtils.getPullRequestsMergedBetween(previousStagingDeployCashData.tag, newVersion);
console.log(
'The following PRs have been merged between the previous StagingDeployCash and new version:',
mergedPRs,
);

if (shouldCreateNewStagingDeployCash) {
// We're in the create flow, not update
Expand Down