Browse Source

adds nodeId to issues and PRs

main
Keith Daulton 1 year ago
parent
commit
ad4ccb5444
7 changed files with 22 additions and 0 deletions
  1. +4
    -0
      src/git/models/issue.ts
  2. +2
    -0
      src/git/models/pullRequest.ts
  3. +5
    -0
      src/plus/github/github.ts
  4. +6
    -0
      src/plus/github/models.ts
  5. +3
    -0
      src/plus/gitlab/gitlab.ts
  6. +1
    -0
      src/plus/gitlab/models.ts
  7. +1
    -0
      src/webviews/settings/settingsWebview.ts

+ 4
- 0
src/git/models/issue.ts View File

@ -9,6 +9,7 @@ export interface IssueOrPullRequest {
readonly type: IssueOrPullRequestType; readonly type: IssueOrPullRequestType;
readonly provider: RemoteProviderReference; readonly provider: RemoteProviderReference;
readonly id: string; readonly id: string;
readonly nodeId: string | undefined;
readonly title: string; readonly title: string;
readonly url: string; readonly url: string;
readonly date: Date; readonly date: Date;
@ -58,6 +59,7 @@ export function serializeIssueOrPullRequest(value: IssueOrPullRequest): IssueOrP
icon: value.provider.icon, icon: value.provider.icon,
}, },
id: value.id, id: value.id,
nodeId: value.nodeId,
title: value.title, title: value.title,
url: value.url, url: value.url,
date: value.date, date: value.date,
@ -183,6 +185,7 @@ export function serializeIssue(value: IssueShape): IssueShape {
icon: value.provider.icon, icon: value.provider.icon,
}, },
id: value.id, id: value.id,
nodeId: value.nodeId,
title: value.title, title: value.title,
url: value.url, url: value.url,
date: value.date, date: value.date,
@ -223,6 +226,7 @@ export class Issue implements IssueShape {
constructor( constructor(
public readonly provider: RemoteProviderReference, public readonly provider: RemoteProviderReference,
public readonly id: string, public readonly id: string,
public readonly nodeId: string | undefined,
public readonly title: string, public readonly title: string,
public readonly url: string, public readonly url: string,
public readonly date: Date, public readonly date: Date,

+ 2
- 0
src/git/models/pullRequest.ts View File

@ -73,6 +73,7 @@ export function serializePullRequest(value: PullRequest): PullRequestShape {
icon: value.provider.icon, icon: value.provider.icon,
}, },
id: value.id, id: value.id,
nodeId: value.nodeId,
title: value.title, title: value.title,
url: value.url, url: value.url,
date: value.date, date: value.date,
@ -133,6 +134,7 @@ export class PullRequest implements PullRequestShape {
readonly url: string; readonly url: string;
}, },
public readonly id: string, public readonly id: string,
public readonly nodeId: string | undefined,
public readonly title: string, public readonly title: string,
public readonly url: string, public readonly url: string,
public readonly state: PullRequestState, public readonly state: PullRequestState,

+ 5
- 0
src/plus/github/github.ts View File

@ -103,6 +103,7 @@ headRepository {
url url
} }
permalink permalink
id
number number
title title
state state
@ -155,6 +156,7 @@ const issueNodeProperties = `
comments { comments {
totalCount totalCount
} }
id
number number
title title
url url
@ -488,6 +490,7 @@ export class GitHubApi implements Disposable {
createdAt createdAt
closed closed
closedAt closedAt
id
title title
url url
state state
@ -496,6 +499,7 @@ export class GitHubApi implements Disposable {
createdAt createdAt
closed closed
closedAt closedAt
id
title title
url url
state state
@ -524,6 +528,7 @@ export class GitHubApi implements Disposable {
provider: provider, provider: provider,
type: issue.type, type: issue.type,
id: String(number), id: String(number),
nodeId: issue.id,
date: new Date(issue.createdAt), date: new Date(issue.createdAt),
title: issue.title, title: issue.title,
closed: issue.closed, closed: issue.closed,

+ 6
- 0
src/plus/github/models.ts View File

@ -45,6 +45,8 @@ export interface GitHubCommitRef {
export type GitHubContributor = Endpoints['GET /repos/{owner}/{repo}/contributors']['response']['data'][0]; export type GitHubContributor = Endpoints['GET /repos/{owner}/{repo}/contributors']['response']['data'][0];
export interface GitHubIssueOrPullRequest { export interface GitHubIssueOrPullRequest {
id: string;
nodeId: string;
type: IssueOrPullRequestType; type: IssueOrPullRequestType;
number: number; number: number;
createdAt: string; createdAt: string;
@ -76,6 +78,7 @@ export interface GitHubPullRequest {
}; };
permalink: string; permalink: string;
number: number; number: number;
id: string;
title: string; title: string;
state: GitHubPullRequestState; state: GitHubPullRequestState;
updatedAt: string; updatedAt: string;
@ -172,6 +175,7 @@ export function fromGitHubPullRequest(pr: GitHubPullRequest, provider: RichRemot
url: pr.author.url, url: pr.author.url,
}, },
String(pr.number), String(pr.number),
pr.id,
pr.title, pr.title,
pr.permalink, pr.permalink,
fromGitHubPullRequestState(pr.state), fromGitHubPullRequestState(pr.state),
@ -253,6 +257,7 @@ export function fromGitHubPullRequestDetailed(
url: pr.author.url, url: pr.author.url,
}, },
String(pr.number), String(pr.number),
pr.id,
pr.title, pr.title,
pr.permalink, pr.permalink,
fromGitHubPullRequestState(pr.state), fromGitHubPullRequestState(pr.state),
@ -309,6 +314,7 @@ export function fromGitHubIssueDetailed(value: GitHubIssueDetailed, provider: Ri
icon: provider.icon, icon: provider.icon,
}, },
String(value.number), String(value.number),
value.id,
value.title, value.title,
value.url, value.url,
new Date(value.createdAt), new Date(value.createdAt),

+ 3
- 0
src/plus/gitlab/gitlab.ts View File

@ -320,6 +320,7 @@ export class GitLabApi implements Disposable {
provider: provider, provider: provider,
type: 'issue', type: 'issue',
id: issue.iid, id: issue.iid,
nodeId: undefined,
date: new Date(issue.createdAt), date: new Date(issue.createdAt),
title: issue.title, title: issue.title,
closed: issue.state === 'closed', closed: issue.state === 'closed',
@ -335,6 +336,7 @@ export class GitLabApi implements Disposable {
provider: provider, provider: provider,
type: 'pullrequest', type: 'pullrequest',
id: mergeRequest.iid, id: mergeRequest.iid,
nodeId: undefined,
date: new Date(mergeRequest.createdAt), date: new Date(mergeRequest.createdAt),
title: mergeRequest.title, title: mergeRequest.title,
closed: mergeRequest.state === 'closed', closed: mergeRequest.state === 'closed',
@ -487,6 +489,7 @@ export class GitLabApi implements Disposable {
url: pr.author?.webUrl ?? '', url: pr.author?.webUrl ?? '',
}, },
String(pr.iid), String(pr.iid),
undefined,
pr.title, pr.title,
pr.webUrl, pr.webUrl,
fromGitLabMergeRequestState(pr.state), fromGitLabMergeRequestState(pr.state),

+ 1
- 0
src/plus/gitlab/models.ts View File

@ -98,6 +98,7 @@ export function fromGitLabMergeRequestREST(pr: GitLabMergeRequestREST, provider:
url: pr.author?.web_url ?? '', url: pr.author?.web_url ?? '',
}, },
String(pr.iid), String(pr.iid),
undefined,
pr.title, pr.title,
pr.web_url, pr.web_url,
fromGitLabMergeRequestState(pr.state), fromGitLabMergeRequestState(pr.state),

+ 1
- 0
src/webviews/settings/settingsWebview.ts View File

@ -200,6 +200,7 @@ export class SettingsWebviewProvider implements WebviewProvider {
url: 'https://github.com/eamodio', url: 'https://github.com/eamodio',
}, },
'1', '1',
undefined,
'Supercharged', 'Supercharged',
'https://github.com/gitkraken/vscode-gitlens/pulls/1', 'https://github.com/gitkraken/vscode-gitlens/pulls/1',
'merged', 'merged',

Loading…
Cancel
Save