From ad4ccb5444e7416e22d182d8059da3f44584db9b Mon Sep 17 00:00:00 2001 From: Keith Daulton Date: Mon, 2 Oct 2023 15:33:48 -0400 Subject: [PATCH] adds nodeId to issues and PRs --- src/git/models/issue.ts | 4 ++++ src/git/models/pullRequest.ts | 2 ++ src/plus/github/github.ts | 5 +++++ src/plus/github/models.ts | 6 ++++++ src/plus/gitlab/gitlab.ts | 3 +++ src/plus/gitlab/models.ts | 1 + src/webviews/settings/settingsWebview.ts | 1 + 7 files changed, 22 insertions(+) diff --git a/src/git/models/issue.ts b/src/git/models/issue.ts index 1860991..a3a4272 100644 --- a/src/git/models/issue.ts +++ b/src/git/models/issue.ts @@ -9,6 +9,7 @@ export interface IssueOrPullRequest { readonly type: IssueOrPullRequestType; readonly provider: RemoteProviderReference; readonly id: string; + readonly nodeId: string | undefined; readonly title: string; readonly url: string; readonly date: Date; @@ -58,6 +59,7 @@ export function serializeIssueOrPullRequest(value: IssueOrPullRequest): IssueOrP icon: value.provider.icon, }, id: value.id, + nodeId: value.nodeId, title: value.title, url: value.url, date: value.date, @@ -183,6 +185,7 @@ export function serializeIssue(value: IssueShape): IssueShape { icon: value.provider.icon, }, id: value.id, + nodeId: value.nodeId, title: value.title, url: value.url, date: value.date, @@ -223,6 +226,7 @@ export class Issue implements IssueShape { constructor( public readonly provider: RemoteProviderReference, public readonly id: string, + public readonly nodeId: string | undefined, public readonly title: string, public readonly url: string, public readonly date: Date, diff --git a/src/git/models/pullRequest.ts b/src/git/models/pullRequest.ts index b78ed86..3222100 100644 --- a/src/git/models/pullRequest.ts +++ b/src/git/models/pullRequest.ts @@ -73,6 +73,7 @@ export function serializePullRequest(value: PullRequest): PullRequestShape { icon: value.provider.icon, }, id: value.id, + nodeId: value.nodeId, title: value.title, url: value.url, date: value.date, @@ -133,6 +134,7 @@ export class PullRequest implements PullRequestShape { readonly url: string; }, public readonly id: string, + public readonly nodeId: string | undefined, public readonly title: string, public readonly url: string, public readonly state: PullRequestState, diff --git a/src/plus/github/github.ts b/src/plus/github/github.ts index 834194a..12e1dcf 100644 --- a/src/plus/github/github.ts +++ b/src/plus/github/github.ts @@ -103,6 +103,7 @@ headRepository { url } permalink +id number title state @@ -155,6 +156,7 @@ const issueNodeProperties = ` comments { totalCount } + id number title url @@ -488,6 +490,7 @@ export class GitHubApi implements Disposable { createdAt closed closedAt + id title url state @@ -496,6 +499,7 @@ export class GitHubApi implements Disposable { createdAt closed closedAt + id title url state @@ -524,6 +528,7 @@ export class GitHubApi implements Disposable { provider: provider, type: issue.type, id: String(number), + nodeId: issue.id, date: new Date(issue.createdAt), title: issue.title, closed: issue.closed, diff --git a/src/plus/github/models.ts b/src/plus/github/models.ts index 6ad2707..41aa614 100644 --- a/src/plus/github/models.ts +++ b/src/plus/github/models.ts @@ -45,6 +45,8 @@ export interface GitHubCommitRef { export type GitHubContributor = Endpoints['GET /repos/{owner}/{repo}/contributors']['response']['data'][0]; export interface GitHubIssueOrPullRequest { + id: string; + nodeId: string; type: IssueOrPullRequestType; number: number; createdAt: string; @@ -76,6 +78,7 @@ export interface GitHubPullRequest { }; permalink: string; number: number; + id: string; title: string; state: GitHubPullRequestState; updatedAt: string; @@ -172,6 +175,7 @@ export function fromGitHubPullRequest(pr: GitHubPullRequest, provider: RichRemot url: pr.author.url, }, String(pr.number), + pr.id, pr.title, pr.permalink, fromGitHubPullRequestState(pr.state), @@ -253,6 +257,7 @@ export function fromGitHubPullRequestDetailed( url: pr.author.url, }, String(pr.number), + pr.id, pr.title, pr.permalink, fromGitHubPullRequestState(pr.state), @@ -309,6 +314,7 @@ export function fromGitHubIssueDetailed(value: GitHubIssueDetailed, provider: Ri icon: provider.icon, }, String(value.number), + value.id, value.title, value.url, new Date(value.createdAt), diff --git a/src/plus/gitlab/gitlab.ts b/src/plus/gitlab/gitlab.ts index 0c14952..0b35ea5 100644 --- a/src/plus/gitlab/gitlab.ts +++ b/src/plus/gitlab/gitlab.ts @@ -320,6 +320,7 @@ export class GitLabApi implements Disposable { provider: provider, type: 'issue', id: issue.iid, + nodeId: undefined, date: new Date(issue.createdAt), title: issue.title, closed: issue.state === 'closed', @@ -335,6 +336,7 @@ export class GitLabApi implements Disposable { provider: provider, type: 'pullrequest', id: mergeRequest.iid, + nodeId: undefined, date: new Date(mergeRequest.createdAt), title: mergeRequest.title, closed: mergeRequest.state === 'closed', @@ -487,6 +489,7 @@ export class GitLabApi implements Disposable { url: pr.author?.webUrl ?? '', }, String(pr.iid), + undefined, pr.title, pr.webUrl, fromGitLabMergeRequestState(pr.state), diff --git a/src/plus/gitlab/models.ts b/src/plus/gitlab/models.ts index f319ac1..9742f91 100644 --- a/src/plus/gitlab/models.ts +++ b/src/plus/gitlab/models.ts @@ -98,6 +98,7 @@ export function fromGitLabMergeRequestREST(pr: GitLabMergeRequestREST, provider: url: pr.author?.web_url ?? '', }, String(pr.iid), + undefined, pr.title, pr.web_url, fromGitLabMergeRequestState(pr.state), diff --git a/src/webviews/settings/settingsWebview.ts b/src/webviews/settings/settingsWebview.ts index cc81537..0b1d004 100644 --- a/src/webviews/settings/settingsWebview.ts +++ b/src/webviews/settings/settingsWebview.ts @@ -200,6 +200,7 @@ export class SettingsWebviewProvider implements WebviewProvider { url: 'https://github.com/eamodio', }, '1', + undefined, 'Supercharged', 'https://github.com/gitkraken/vscode-gitlens/pulls/1', 'merged',