Skip to content

Commit fba02b7

Browse files
committed
Merge branch 'development' into releases/3.1.8
2 parents 2ada979 + a685379 commit fba02b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2040
-301
lines changed

.github/workflows/ci.yml

+1-13
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,7 @@ jobs:
3232
uses: actions/setup-node@v3
3333
with:
3434
node-version: ${{ matrix.node }}
35-
36-
- name: Get yarn cache directory path
37-
id: yarn-cache-dir-path
38-
run: echo "::set-output name=dir::$(yarn cache dir)"
39-
40-
- uses: actions/cache@v3
41-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
42-
with:
43-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
44-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
45-
restore-keys: |
46-
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
47-
${{ runner.os }}-yarn-
35+
cache: yarn
4836

4937
# This step can be removed as soon as official Windows arm64 builds are published:
5038
# https://github.com/nodejs/build/issues/2450#issuecomment-705853342

app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"productName": "GitHub Desktop",
44
"bundleID": "com.github.GitHubClient",
55
"companyName": "GitHub, Inc.",
6-
"version": "3.1.8",
6+
"version": "3.1.7",
77
"main": "./main.js",
88
"repository": {
99
"type": "git",

app/src/lib/api.ts

+159
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,15 @@ export interface IAPIPullRequestReview {
508508
| 'CHANGES_REQUESTED'
509509
}
510510

511+
/** Represents both issue comments and PR review comments */
512+
export interface IAPIComment {
513+
readonly id: number
514+
readonly body: string
515+
readonly html_url: string
516+
readonly user: IAPIIdentity
517+
readonly created_at: string
518+
}
519+
511520
/** The metadata about a GitHub server. */
512521
export interface IServerMetadata {
513522
/**
@@ -733,6 +742,79 @@ export class API {
733742
}
734743
}
735744

745+
/**
746+
* Fetch an issue comment (i.e. a comment on an issue or pull request).
747+
*
748+
* @param owner The owner of the repository
749+
* @param name The name of the repository
750+
* @param commentId The ID of the comment
751+
*
752+
* @returns The comment if it was found, null if it wasn't, or an error
753+
* occurred.
754+
*/
755+
public async fetchIssueComment(
756+
owner: string,
757+
name: string,
758+
commentId: string
759+
): Promise<IAPIComment | null> {
760+
try {
761+
const response = await this.request(
762+
'GET',
763+
`repos/${owner}/${name}/issues/comments/${commentId}`
764+
)
765+
if (response.status === HttpStatusCode.NotFound) {
766+
log.warn(
767+
`fetchIssueComment: '${owner}/${name}/issues/comments/${commentId}' returned a 404`
768+
)
769+
return null
770+
}
771+
return await parsedResponse<IAPIComment>(response)
772+
} catch (e) {
773+
log.warn(
774+
`fetchIssueComment: an error occurred for '${owner}/${name}/issues/comments/${commentId}'`,
775+
e
776+
)
777+
return null
778+
}
779+
}
780+
781+
/**
782+
* Fetch a pull request review comment (i.e. a comment that was posted as part
783+
* of a review of a pull request).
784+
*
785+
* @param owner The owner of the repository
786+
* @param name The name of the repository
787+
* @param commentId The ID of the comment
788+
*
789+
* @returns The comment if it was found, null if it wasn't, or an error
790+
* occurred.
791+
*/
792+
public async fetchPullRequestReviewComment(
793+
owner: string,
794+
name: string,
795+
commentId: string
796+
): Promise<IAPIComment | null> {
797+
try {
798+
const response = await this.request(
799+
'GET',
800+
`repos/${owner}/${name}/pulls/comments/${commentId}`
801+
)
802+
if (response.status === HttpStatusCode.NotFound) {
803+
log.warn(
804+
`fetchPullRequestReviewComment: '${owner}/${name}/pulls/comments/${commentId}' returned a 404`
805+
)
806+
return null
807+
}
808+
return await parsedResponse<IAPIComment>(response)
809+
} catch (e) {
810+
log.warn(
811+
`fetchPullRequestReviewComment: an error occurred for '${owner}/${name}/pulls/comments/${commentId}'`,
812+
e
813+
)
814+
return null
815+
}
816+
}
817+
736818
/** Fetch a repo by its owner and name. */
737819
public async fetchRepository(
738820
owner: string,
@@ -1047,6 +1129,83 @@ export class API {
10471129
}
10481130
}
10491131

1132+
/** Fetches all reviews from a given pull request. */
1133+
public async fetchPullRequestReviews(
1134+
owner: string,
1135+
name: string,
1136+
prNumber: string
1137+
) {
1138+
try {
1139+
const path = `/repos/${owner}/${name}/pulls/${prNumber}/reviews`
1140+
const response = await this.request('GET', path)
1141+
return await parsedResponse<IAPIPullRequestReview[]>(response)
1142+
} catch (e) {
1143+
log.debug(
1144+
`failed fetching PR reviews for ${owner}/${name}/pulls/${prNumber}`,
1145+
e
1146+
)
1147+
return []
1148+
}
1149+
}
1150+
1151+
/** Fetches all review comments from a given pull request. */
1152+
public async fetchPullRequestReviewComments(
1153+
owner: string,
1154+
name: string,
1155+
prNumber: string,
1156+
reviewId: string
1157+
) {
1158+
try {
1159+
const path = `/repos/${owner}/${name}/pulls/${prNumber}/reviews/${reviewId}/comments`
1160+
const response = await this.request('GET', path)
1161+
return await parsedResponse<IAPIComment[]>(response)
1162+
} catch (e) {
1163+
log.debug(
1164+
`failed fetching PR review comments for ${owner}/${name}/pulls/${prNumber}`,
1165+
e
1166+
)
1167+
return []
1168+
}
1169+
}
1170+
1171+
/** Fetches all review comments from a given pull request. */
1172+
public async fetchPullRequestComments(
1173+
owner: string,
1174+
name: string,
1175+
prNumber: string
1176+
) {
1177+
try {
1178+
const path = `/repos/${owner}/${name}/pulls/${prNumber}/comments`
1179+
const response = await this.request('GET', path)
1180+
return await parsedResponse<IAPIComment[]>(response)
1181+
} catch (e) {
1182+
log.debug(
1183+
`failed fetching PR comments for ${owner}/${name}/pulls/${prNumber}`,
1184+
e
1185+
)
1186+
return []
1187+
}
1188+
}
1189+
1190+
/** Fetches all comments from a given issue. */
1191+
public async fetchIssueComments(
1192+
owner: string,
1193+
name: string,
1194+
issueNumber: string
1195+
) {
1196+
try {
1197+
const path = `/repos/${owner}/${name}/issues/${issueNumber}/comments`
1198+
const response = await this.request('GET', path)
1199+
return await parsedResponse<IAPIComment[]>(response)
1200+
} catch (e) {
1201+
log.debug(
1202+
`failed fetching issue comments for ${owner}/${name}/issues/${issueNumber}`,
1203+
e
1204+
)
1205+
return []
1206+
}
1207+
}
1208+
10501209
/**
10511210
* Get the combined status for the given ref.
10521211
*/

app/src/lib/editors/darwin.ts

+4
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ const editors: IDarwinExternalEditor[] = [
7171
name: 'PyCharm Community Edition',
7272
bundleIdentifiers: ['com.jetbrains.pycharm.ce'],
7373
},
74+
{
75+
name: 'DataSpell',
76+
bundleIdentifiers: ['com.jetbrains.DataSpell'],
77+
},
7478
{
7579
name: 'RubyMine',
7680
bundleIdentifiers: ['com.jetbrains.RubyMine'],

app/src/lib/editors/linux.ts

+79-6
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,38 @@ const editors: ILinuxExternalEditor[] = [
2323
name: 'Neovim',
2424
paths: ['/usr/bin/nvim'],
2525
},
26+
{
27+
name: 'Neovim-Qt',
28+
paths: ['/usr/bin/nvim-qt'],
29+
},
30+
{
31+
name: 'Neovide',
32+
paths: ['/usr/bin/neovide'],
33+
},
34+
{
35+
name: 'gVim',
36+
paths: ['/usr/bin/gvim'],
37+
},
2638
{
2739
name: 'Visual Studio Code',
28-
paths: ['/usr/share/code/bin/code', '/snap/bin/code', '/usr/bin/code'],
40+
paths: [
41+
'/usr/share/code/bin/code',
42+
'/snap/bin/code',
43+
'/usr/bin/code',
44+
'/mnt/c/Program Files/Microsoft VS Code/bin/code',
45+
],
2946
},
3047
{
3148
name: 'Visual Studio Code (Insiders)',
3249
paths: ['/snap/bin/code-insiders', '/usr/bin/code-insiders'],
3350
},
3451
{
3552
name: 'VSCodium',
36-
paths: ['/usr/bin/codium', '/var/lib/flatpak/app/com.vscodium.codium'],
53+
paths: [
54+
'/usr/bin/codium',
55+
'/var/lib/flatpak/app/com.vscodium.codium',
56+
'/usr/share/vscodium-bin/bin/codium',
57+
],
3758
},
3859
{
3960
name: 'Sublime Text',
@@ -63,17 +84,69 @@ const editors: ILinuxExternalEditor[] = [
6384
paths: ['/usr/bin/lite-xl'],
6485
},
6586
{
66-
name: 'Jetbrains PhpStorm',
67-
paths: ['/snap/bin/phpstorm'],
87+
name: 'JetBrains PhpStorm',
88+
paths: [
89+
'/snap/bin/phpstorm',
90+
'.local/share/JetBrains/Toolbox/scripts/phpstorm',
91+
],
92+
},
93+
{
94+
name: 'JetBrains WebStorm',
95+
paths: [
96+
'/snap/bin/webstorm',
97+
'.local/share/JetBrains/Toolbox/scripts/webstorm',
98+
],
99+
},
100+
{
101+
name: 'IntelliJ IDEA',
102+
paths: ['/snap/bin/idea', '.local/share/JetBrains/Toolbox/scripts/idea'],
103+
},
104+
{
105+
name: 'JetBrains PyCharm',
106+
paths: [
107+
'/snap/bin/pycharm',
108+
'.local/share/JetBrains/Toolbox/scripts/pycharm',
109+
],
68110
},
69111
{
70-
name: 'Jetbrains WebStorm',
71-
paths: ['/snap/bin/webstorm'],
112+
name: 'Android Studio',
113+
paths: [
114+
'/snap/bin/studio',
115+
'.local/share/JetBrains/Toolbox/scripts/studio',
116+
],
72117
},
73118
{
74119
name: 'Emacs',
75120
paths: ['/snap/bin/emacs', '/usr/local/bin/emacs', '/usr/bin/emacs'],
76121
},
122+
{
123+
name: 'Kate',
124+
paths: ['/usr/bin/kate'],
125+
},
126+
{
127+
name: 'GEdit',
128+
paths: ['/usr/bin/gedit'],
129+
},
130+
{
131+
name: 'GNOME Text Editor',
132+
paths: ['/usr/bin/gnome-text-editor'],
133+
},
134+
{
135+
name: 'GNOME Builder',
136+
paths: ['/usr/bin/gnome-builder'],
137+
},
138+
{
139+
name: 'Notepadqq',
140+
paths: ['/usr/bin/notepadqq'],
141+
},
142+
{
143+
name: 'Geany',
144+
paths: ['/usr/bin/geany'],
145+
},
146+
{
147+
name: 'Mousepad',
148+
paths: ['/usr/bin/mousepad'],
149+
},
77150
]
78151

79152
async function getAvailablePath(paths: string[]): Promise<string | null> {

app/src/lib/editors/win32.ts

+8
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,14 @@ const editors: WindowsExternalEditor[] = [
471471
displayNamePrefix: 'Fleet ',
472472
publishers: ['JetBrains s.r.o.'],
473473
},
474+
{
475+
name: 'JetBrains DataSpell',
476+
registryKeys: registryKeysForJetBrainsIDE('DataSpell'),
477+
executableShimPaths: executableShimPathsForJetBrainsIDE('dataspell'),
478+
jetBrainsToolboxScriptName: 'dataspell',
479+
displayNamePrefix: 'DataSpell ',
480+
publishers: ['JetBrains s.r.o.'],
481+
},
474482
]
475483

476484
function getKeyOrEmpty(

app/src/lib/feature-flag.ts

+4
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,7 @@ export function enablePreventClosingWhileUpdating(): boolean {
127127
export function enablePushPullFetchDropdown(): boolean {
128128
return enableBetaFeatures()
129129
}
130+
131+
export function enablePullRequestCommentNotifications(): boolean {
132+
return enableDevelopmentFeatures()
133+
}

0 commit comments

Comments
 (0)