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

fix: delay snapshots temporarily #391

Merged
merged 6 commits into from
Apr 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/release-pr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,26 @@ export class ReleasePR {
this.gh = this.gitHubInstance(options.octokitAPIs);
}

async delay({ms = 3000}) {
new Promise((resolve, reject) => {
setTimeout(() => {
return resolve();
}, ms);
});
}

async run() {
// TODO: this temporarily resolves a race condition between creating a release
// and updating tags on the release PR. This should be replaced by a queuing
// mechanism to delay/retry this request.
if (this.snapshot) {
checkpoint(
'snapshot: sleeping for 10 seconds...',
CheckpointType.Success
);
await this.delay({ms: 10000});
chingor13 marked this conversation as resolved.
Show resolved Hide resolved
checkpoint('snapshot: finished sleeping', CheckpointType.Success);
}
const pr: GitHubReleasePR | undefined = await this.gh.findMergedReleasePR(
this.labels
);
Expand Down