feat: add a comment to merged pull requests on successful deployment - #4041
feat: add a comment to merged pull requests on successful deployment#4041mcdurdin wants to merge 1 commit into
Conversation
Adds a comment to new pull requests when there is a successful build and deploy. Runs on TeamCity. Test-bot: skip
| const exitCode = await new Promise( (resolve) => { | ||
| child.on('close', resolve); | ||
| }); |
There was a problem hiding this comment.
Does this work if the child is already closed when we come here?
There was a problem hiding this comment.
Not that it would matter, but the indentation in this file is off (4-space-indentation instead of 2).
| * 0 if no pulls associated with the current version, or | ||
| * -1 on error. | ||
| */ | ||
|
|
| export const findAndReportOnNewPullRequests = async ( | ||
| octokit: GitHub, from: string, to?: string, omitFirstCommit?: boolean | ||
| ): Promise<number> => { | ||
|
|
| import { GitHub } from './find-and-report-on-new-pull-requests.js'; | ||
| import { graphql, getPullRequestFiles } from './graphql/queries.js'; | ||
|
|
||
| export const getListOfKeyboardsForPullRequest = async (octokit: GitHub, number: number): Promise<string[]> => { |
There was a problem hiding this comment.
| export const getListOfKeyboardsForPullRequest = async (octokit: GitHub, number: number): Promise<string[]> => { | |
| export const getListOfKeyboardsForPullRequest = async (octokit: GitHub, prNumber: number): Promise<string[]> => { |
| sinon.restore(); | ||
| }); | ||
|
|
||
| pull_responses.forEach( (value, id) => |
There was a problem hiding this comment.
Isn't this the wrong way round? I.e. should it be
| pull_responses.forEach( (value, id) => | |
| pull_responses.forEach( (id, value) => |
| "name": "@keymanapp/auto-history-action", | ||
| "private": true, | ||
| "scripts": { | ||
| "build:ts": "tsc --project tsconfig.production.json", |
There was a problem hiding this comment.
I don't see a tsconfig.production.json file
| function do_report() { | ||
| "${REPO_ROOT}/resources/build/version/build.sh" configure build | ||
| local BUILDID="${BUILD_URL##*/}" | ||
| node resources/build/version run --teamcity-token "$TEAMCITY_TOKEN" --github-token "$GITHUB_TOKEN" --build-id "$BUILDID" |
There was a problem hiding this comment.
A bit confusing to have a function do_report and a tool that has a report command, but then we call it with run... But having the run command documented in the tool might already help.
| } | ||
| }) | ||
| .help() | ||
| .alias('help', 'h') |
There was a problem hiding this comment.
to make sure we document all commands and options, we could add strict().
| .alias('help', 'h') | |
| .alias('help', 'h') | |
| .strict() |
| sinon.restore(); | ||
| }); | ||
|
|
||
| pull_responses.forEach( (value, id) => |
There was a problem hiding this comment.
We might want to rename id to pr since ids is the list of keyboards which suggests a relationship between id and ids.
Adds a comment to new pull requests when there is a successful build and deploy. Runs on TeamCity.
Test-bot: skip
Fixes: #3543