Skip to content

Commit

Permalink
Include entrypoint in github comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey committed May 31, 2024
1 parent f600628 commit 5e40c18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion azure-pipelines-userTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
- script: |
npm ci
npm run build
node dist/postGithubComments ${{ parameters.REQUESTING_USER }} ${{ parameters.SOURCE_ISSUE }} ${{ parameters.STATUS_COMMENT }} ${{ parameters.DISTINCT_ID }} ${{ parameters.TOP_REPOS }} '$(Pipeline.Workspace)' '$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)&view=artifacts&type=publishedArtifacts' ${{ parameters.POST_RESULT }} ${{ parameters.REPO_COUNT }} '$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_apis/build/builds/$(Build.BuildId)/artifacts'
node dist/postGithubComments ${{ parameters.ENTRYPOINT }} ${{ parameters.REQUESTING_USER }} ${{ parameters.SOURCE_ISSUE }} ${{ parameters.STATUS_COMMENT }} ${{ parameters.DISTINCT_ID }} ${{ parameters.TOP_REPOS }} '$(Pipeline.Workspace)' '$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)&view=artifacts&type=publishedArtifacts' ${{ parameters.POST_RESULT }} ${{ parameters.REPO_COUNT }} '$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_apis/build/builds/$(Build.BuildId)/artifacts'
displayName: 'Update PR comment with new errors'
env:
GITHUB_PAT: $(GITHUB_PAT)
8 changes: 4 additions & 4 deletions src/postGithubComments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import pu = require("./utils/packageUtils");

const { argv } = process;

if (argv.length !== 12) {
console.error(`Usage: ${path.basename(argv[0])} ${path.basename(argv[1])} <user_to_tag> <pr_number> <comment_number> <distinct_id> <is_top_repos_run> <result_dir_path> <artifacts_uri> <post_result> <repo_count> <get_artifacts_api>`);
if (argv.length !== 13) {
console.error(`Usage: ${path.basename(argv[0])} ${path.basename(argv[1])} <entrypoint> <user_to_tag> <pr_number> <comment_number> <distinct_id> <is_top_repos_run> <result_dir_path> <artifacts_uri> <post_result> <repo_count> <get_artifacts_api>`);
process.exit(-1);
}

const [, , userToTag, prNumber, commentNumber, distinctId, isTop, resultDirPath, artifactsUri, post, repoCount, getArtifactsApi] = argv;
const [, , entrypoint, userToTag, prNumber, commentNumber, distinctId, isTop, resultDirPath, artifactsUri, post, repoCount, getArtifactsApi] = argv;
const isTopReposRun = isTop.toLowerCase() === "true";
const postResult = post.toLowerCase() === "true";

Expand Down Expand Up @@ -76,7 +76,7 @@ const outputs = resultPaths.map(p =>
.replaceAll(getArtifactsApiUrlPlaceholder, getArtifactsApi));

const suiteDescription = isTopReposRun ? `top ${repoCount} repos` : "user tests";
let header = `@${userToTag} Here are the results of running the ${suiteDescription} comparing \`${oldTscResolvedVersion}\` and \`${newTscResolvedVersion}\`:
let header = `@${userToTag} Here are the results of running the ${suiteDescription} with ${entrypoint} comparing \`${oldTscResolvedVersion}\` and \`${newTscResolvedVersion}\`:
${summary.join("\n")}`;

Expand Down

0 comments on commit 5e40c18

Please sign in to comment.