Skip to content

feat: add a comment to merged pull requests on successful deployment - #4041

Open
mcdurdin wants to merge 1 commit into
masterfrom
feat/3543-report-merged-pull-requests
Open

feat: add a comment to merged pull requests on successful deployment#4041
mcdurdin wants to merge 1 commit into
masterfrom
feat/3543-report-merged-pull-requests

Conversation

@mcdurdin

@mcdurdin mcdurdin commented Jun 26, 2026

Copy link
Copy Markdown
Member

Adds a comment to new pull requests when there is a successful build and deploy. Runs on TeamCity.

Test-bot: skip
Fixes: #3543

Adds a comment to new pull requests when there is a successful build
and deploy. Runs on TeamCity.

Test-bot: skip
@mcdurdin
mcdurdin requested a review from ermshiperete June 29, 2026 13:55
Comment on lines +22 to +24
const exitCode = await new Promise( (resolve) => {
child.on('close', resolve);
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work if the child is already closed when we come here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
*/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

export const findAndReportOnNewPullRequests = async (
octokit: GitHub, from: string, to?: string, omitFirstCommit?: boolean
): Promise<number> => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

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[]> => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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) =>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this the wrong way round? I.e. should it be

Suggested change
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",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to make sure we document all commands and options, we could add strict().

Suggested change
.alias('help', 'h')
.alias('help', 'h')
.strict()

sinon.restore();
});

pull_responses.forEach( (value, id) =>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to rename id to pr since ids is the list of keyboards which suggests a relationship between id and ids.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Notify Contributor Following Deployment to Keyman.com

2 participants