From 4cdda293905a87ade53317dfc7857a31696405c7 Mon Sep 17 00:00:00 2001 From: Nathan Gendron Date: Fri, 27 Sep 2024 14:25:30 -0400 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=94=A8=20Add=20script=20for=20patchin?= =?UTF-8?q?g=20version=20and=20creating=20release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/pnpm_version_patch.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 scripts/pnpm_version_patch.sh diff --git a/scripts/pnpm_version_patch.sh b/scripts/pnpm_version_patch.sh new file mode 100644 index 0000000..88b9bdf --- /dev/null +++ b/scripts/pnpm_version_patch.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +VERSION=$(pnpm version patch --no-git-tag-version) + +echo 'Do you want to publish @coderabbitai/bitbucket@'$VERSION'? (y/n) ' +read Y +if [ "$Y" = "y" ]; then + echo "Publishing version $VERSION" +else + git checkout -- package.json + exit 1 +fi + +git commit --all --message "🔖 $VERSION" +git tag --annotate --message "🔖 $VERSION" --sign $VERSION +git push +git push --tags + +gh release create $VERSION --generate-notes --title $VERSION --verify-tag From 315997930360971db8031fe4dfa283c1cca24d01 Mon Sep 17 00:00:00 2001 From: Nato Boram Date: Fri, 27 Sep 2024 15:25:42 -0400 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=8F=B7=EF=B8=8F=20Manually=20update?= =?UTF-8?q?=20types=20for=20`pr:comment:edited`=20(#7)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webhooks/events/pr/comment_edited.ts | 52 ++++++++++++++++--- 1 file changed, 45 insertions(+), 7 deletions(-) diff --git a/src/server/webhooks/events/pr/comment_edited.ts b/src/server/webhooks/events/pr/comment_edited.ts index 0b12f91..742f273 100644 --- a/src/server/webhooks/events/pr/comment_edited.ts +++ b/src/server/webhooks/events/pr/comment_edited.ts @@ -1,28 +1,50 @@ +import type { + SchemaApplicationUser, + SchemaProject, + SchemaPullRequestParticipant, + SchemaRepository, + SchemaRestMinimalRef, +} from "../../../openapi/openapi-typescript.js" + export interface Actor { readonly active: boolean readonly displayName: string readonly emailAddress: string readonly id: number + readonly links: ActorLinks readonly name: string readonly slug: string - readonly type: string + readonly type: SchemaApplicationUser["type"] +} + +export interface ActorLinks { + readonly self: Self[] } export interface Author { readonly approved: boolean - readonly role: string - readonly status: string + readonly role: SchemaPullRequestParticipant["role"] + readonly status: SchemaPullRequestParticipant["status"] readonly user: Actor } +export interface Clone { + readonly href: string + readonly name: string +} + export interface Comment { readonly author: Actor readonly comments: unknown[] readonly createdDate: number readonly id: number readonly properties: Properties - readonly tasks: unknown[] + readonly severity: string + readonly state: string readonly text: string + readonly threadResolved: boolean + readonly threadResolvedDate: number + readonly threadResolver: Actor readonly updatedDate: number readonly version: number } @@ -34,7 +56,7 @@ export interface PRCommentEdited { /** The comment edited. */ readonly comment: Comment /** Id of the parent comment if one exists. */ - readonly commentParentId: number + readonly commentParentId?: number readonly date: string readonly eventKey: "pr:comment:edited" /** Text of the previous comment. */ @@ -46,9 +68,10 @@ export interface PRCommentEdited { export interface Project { readonly id: number readonly key: string + readonly links: ActorLinks readonly name: string readonly public: boolean - readonly type: string + readonly type: SchemaProject["type"] } export interface Properties { @@ -59,9 +82,11 @@ export interface PullRequest { readonly author: Author readonly closed: boolean readonly createdDate: number + readonly description: string readonly draft: boolean readonly fromRef: Ref readonly id: number + readonly links: ActorLinks readonly locked: boolean readonly open: boolean readonly participants: unknown[] @@ -78,16 +103,29 @@ export interface Ref { readonly id: string readonly latestCommit: string readonly repository: Repository + readonly type: SchemaRestMinimalRef["type"] } export interface Repository { + readonly archived: boolean readonly forkable: boolean + readonly hierarchyId: string readonly id: number + readonly links: RepositoryLinks readonly name: string readonly project: Project readonly public: boolean readonly scmId: string readonly slug: string - readonly state: string + readonly state: SchemaRepository["state"] readonly statusMessage: string } + +export interface RepositoryLinks { + readonly clone: Clone[] + readonly self: Self[] +} + +export interface Self { + readonly href: string +} From ff81b2db2645ae2f037cf514a32d96cf6aa57604 Mon Sep 17 00:00:00 2001 From: Nathan Gendron Date: Fri, 27 Sep 2024 15:26:43 -0400 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=94=96=20v1.0.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- scripts/pnpm_version_patch.sh | 0 2 files changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 scripts/pnpm_version_patch.sh diff --git a/package.json b/package.json index f93e16c..7f9841e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@coderabbitai/bitbucket", - "version": "1.0.4", + "version": "1.0.5", "description": "CodeRabbit's TypeScript API client for connecting to Bitbucket Cloud and Bitbucket Data Center", "keywords": [ "bitbucket-api-v1", diff --git a/scripts/pnpm_version_patch.sh b/scripts/pnpm_version_patch.sh old mode 100644 new mode 100755