From 02b07c9e18764766e125fa9cf6b163b70471b5db Mon Sep 17 00:00:00 2001 From: Nathan Gendron Date: Fri, 27 Sep 2024 15:33:50 -0400 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=94=A8=20Make=20sure=20we're=20on=20m?= =?UTF-8?q?ain=20in=20pnpm=5Fversion=5Fpatch.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/pnpm_version_patch.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/pnpm_version_patch.sh b/scripts/pnpm_version_patch.sh index 88b9bdf..af5556b 100755 --- a/scripts/pnpm_version_patch.sh +++ b/scripts/pnpm_version_patch.sh @@ -1,7 +1,15 @@ #!/bin/sh +git checkout main +git pull --autostash --prune --rebase + VERSION=$(pnpm version patch --no-git-tag-version) +pnpm i +pnpm lint:fix + +git status + echo 'Do you want to publish @coderabbitai/bitbucket@'$VERSION'? (y/n) ' read Y if [ "$Y" = "y" ]; then From d4c3118b2006ac638aed51c495fb5fb4f12e7a5e Mon Sep 17 00:00:00 2001 From: Nathan Gendron Date: Fri, 27 Sep 2024 15:44:18 -0400 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=8F=B7=EF=B8=8F=20Manually=20extract?= =?UTF-8?q?=20webhook=20types=20for=20PRCommentAdded?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webhooks/events/pr/comment_added.ts | 50 ++++++++++++++++--- 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/src/server/webhooks/events/pr/comment_added.ts b/src/server/webhooks/events/pr/comment_added.ts index 3e63843..0c78f70 100644 --- a/src/server/webhooks/events/pr/comment_added.ts +++ b/src/server/webhooks/events/pr/comment_added.ts @@ -1,28 +1,49 @@ +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 role: SchemaPullRequestParticipant["role"] readonly status: string 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 tasks?: unknown[] readonly text: string + readonly threadResolved: boolean readonly updatedDate: number readonly version: number } @@ -34,7 +55,7 @@ export interface PRCommentAdded { /** The comment created. */ readonly comment: Comment /** Id of the parent comment if one exists. */ - readonly commentParentId: number + readonly commentParentId?: number readonly date: string readonly eventKey: "pr:comment:added" /** The pull request comment on. */ @@ -44,22 +65,26 @@ export interface PRCommentAdded { 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 { readonly repositoryId: number + readonly suggestionState: string } 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[] @@ -76,16 +101,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 eeb854b831f183339713fc8abfa246b23bf8bc35 Mon Sep 17 00:00:00 2001 From: Nathan Gendron Date: Mon, 30 Sep 2024 12:08:23 -0400 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=94=96=20v1.0.6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7f9841e..5d0184e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@coderabbitai/bitbucket", - "version": "1.0.5", + "version": "1.0.6", "description": "CodeRabbit's TypeScript API client for connecting to Bitbucket Cloud and Bitbucket Data Center", "keywords": [ "bitbucket-api-v1",