This repository has been archived by the owner on Apr 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Implement 'merge' command options --fail and --update-commit-st…
…atus
- Loading branch information
Showing
10 changed files
with
109 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import yargs from 'yargs'; | ||
|
||
export default function fail(numFindings: number): void { | ||
if (numFindings > 0) { | ||
yargs.exit(1, new Error(`${numFindings} findings`)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { URL } from 'url'; | ||
|
||
export default function reportUploadURL(numFindings: number, url?: URL): void { | ||
let message = `Uploaded ${numFindings} findings`; | ||
if (url) { | ||
message += ` to ${url}`; | ||
} | ||
console.log(message); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import postCommitStatus from '../integration/github/commitStatus'; | ||
|
||
export default async function updateCommitStatus( | ||
numFindings: number, | ||
numChecks: number | ||
): Promise<void> { | ||
if (numFindings > 0) { | ||
await postCommitStatus( | ||
'failure', | ||
`${numChecks} checks, ${numFindings} findings. See CI job log for details.` | ||
); | ||
console.log(`Commit status updated to: failure (${numFindings} findings)`); | ||
} else { | ||
await postCommitStatus('success', `${numChecks} checks passed`); | ||
console.log(`Commit status updated to: success.`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { URL } from 'url'; | ||
|
||
export default interface Location { | ||
url: URL; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Configuration } from '@appland/client'; | ||
import { ScanSummary } from 'src/report/scanSummary'; | ||
|
||
export default interface ScannerJob { | ||
id: number; | ||
created_at: string; | ||
updated_at: string; | ||
mapset_id: number; | ||
merge_key?: string; | ||
summary: ScanSummary; | ||
configuration: Configuration; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters