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

allow overriding ci comment #2871

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "openapi-workspaces",
"license": "MIT",
"private": true,
"version": "1.0.4",
"version": "1.0.5",
"workspaces": [
"projects/json-pointer-helpers",
"projects/openapi-io",
Expand Down
2 changes: 1 addition & 1 deletion projects/fastify-capture/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@useoptic/fastify-capture",
"license": "MIT",
"packageManager": "[email protected]",
"version": "1.0.4",
"version": "1.0.5",
"main": "build/index.js",
"types": "build/index.d.ts",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion projects/json-pointer-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@useoptic/json-pointer-helpers",
"license": "MIT",
"packageManager": "[email protected]",
"version": "1.0.4",
"version": "1.0.5",
"main": "build/index.js",
"types": "build/index.d.ts",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion projects/openapi-io/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@useoptic/openapi-io",
"license": "MIT",
"packageManager": "[email protected]",
"version": "1.0.4",
"version": "1.0.5",
"main": "build/index.js",
"types": "build/index.d.ts",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion projects/openapi-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@useoptic/openapi-utilities",
"license": "MIT",
"packageManager": "[email protected]",
"version": "1.0.4",
"version": "1.0.5",
"main": "build/index.js",
"types": "build/index.d.ts",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion projects/optic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@useoptic/optic",
"license": "MIT",
"packageManager": "[email protected]",
"version": "1.0.4",
"version": "1.0.5",
"main": "build/index.js",
"types": "build/index.d.ts",
"files": [
Expand Down
3 changes: 3 additions & 0 deletions projects/optic/src/commands/ci/comment/comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const registerCiComment = (cli: Command, config: OpticCliConfig) => {
'--enterprise-base-url <enterprise-base-url>',
'(only for enterprise versions of github or gitlab) - the base url to your enterprise github / gitlab instance'
)
.option('--comment-url <comment-url>', 'override the url of the comment')
.option('--verbose', 'show all operations changed in each API', false)
.description('comment on a pull request / merge request')
.action(
Expand All @@ -60,6 +61,7 @@ export const registerCiComment = (cli: Command, config: OpticCliConfig) => {

type CommonOptions = {
verbose: boolean;
commentUrl: string;
};

type UnvalidatedOptions = CommonOptions & {
Expand Down Expand Up @@ -153,6 +155,7 @@ const getCiCommentAction =
await commenter.getComment(COMPARE_SUMMARY_IDENTIFIER);
const body = generateCompareSummaryMarkdown({ sha: options.sha }, data, {
verbose: options.verbose,
overrideUrl: options.commentUrl,
});

if (maybeComment) {
Expand Down
6 changes: 3 additions & 3 deletions projects/optic/src/commands/ci/comment/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const getCaptureIssuesLabel = ({
export const generateCompareSummaryMarkdown = (
commit: { sha: string },
results: CiRunDetails,
options: { verbose: boolean }
options: { verbose: boolean; overrideUrl?: string }
) => {
const anyCompletedHasWarning = results.completed.some(
(s) => s.warnings.length > 0
Expand Down Expand Up @@ -122,7 +122,7 @@ ${s.apiName}
<td>

${getOperationsText(s.comparison.groupedDiffs, {
webUrl: s.opticWebUrl,
webUrl: options.overrideUrl || s.opticWebUrl,
verbose: options.verbose,
labelJoiner: ',\n',
})}
Expand Down Expand Up @@ -163,7 +163,7 @@ ${

<td>

${s.opticWebUrl ? `[View report](${s.opticWebUrl})` : ''}
${options.overrideUrl || s.opticWebUrl ? `[View report](${options.overrideUrl || s.opticWebUrl})` : ''}

</td>
</tr>`
Expand Down
2 changes: 1 addition & 1 deletion projects/rulesets-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@useoptic/rulesets-base",
"license": "MIT",
"packageManager": "[email protected]",
"version": "1.0.4",
"version": "1.0.5",
"main": "build/index.js",
"types": "build/index.d.ts",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion projects/standard-rulesets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@useoptic/standard-rulesets",
"license": "MIT",
"packageManager": "[email protected]",
"version": "1.0.4",
"version": "1.0.5",
"main": "build/index.js",
"types": "build/index.d.ts",
"files": [
Expand Down
Loading