File tree 3 files changed +9
-7
lines changed
src/plus/integrations/providers
3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -409,7 +409,13 @@ abstract class GitLabIntegrationBase<
409
409
}
410
410
411
411
protected override getProviderPullRequestIdentityFromMaybeUrl ( search : string ) : PullRequestUrlIdentity | undefined {
412
- return getGitLabPullRequestIdentityFromMaybeUrl ( search ) ;
412
+ const identity = getGitLabPullRequestIdentityFromMaybeUrl ( search ) ;
413
+ if ( identity == null ) return undefined ;
414
+
415
+ return {
416
+ ...identity ,
417
+ provider : this . id ,
418
+ } ;
413
419
}
414
420
}
415
421
Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ suite('Test GitLab PR URL parsing to identity: getPullRequestIdentityFromMaybeUr
10
10
: {
11
11
ownerAndRepo : ownerAndRepo ,
12
12
prNumber : prNumber ,
13
- provider : 'gitlab' ,
14
13
} ,
15
14
`Parse: ${ message } (${ JSON . stringify ( query ) } )` ,
16
15
) ;
Original file line number Diff line number Diff line change 2
2
// That's why this file has been created that can collect more simple functions which
3
3
// don't require Container and can be tested.
4
4
5
- import { HostingIntegrationId } from '../../../../constants.integrations' ;
6
5
import type { PullRequestUrlIdentity } from '../../../../git/utils/pullRequest.utils' ;
7
6
8
7
export function isMaybeGitLabPullRequestUrl ( url : string ) : boolean {
@@ -11,7 +10,7 @@ export function isMaybeGitLabPullRequestUrl(url: string): boolean {
11
10
12
11
export function getGitLabPullRequestIdentityFromMaybeUrl (
13
12
search : string ,
14
- ) : ( PullRequestUrlIdentity & { provider : HostingIntegrationId . GitLab } ) | undefined {
13
+ ) : Omit < PullRequestUrlIdentity , ' provider' > | undefined {
15
14
let ownerAndRepo : string | undefined = undefined ;
16
15
let prNumber : string | undefined = undefined ;
17
16
@@ -28,7 +27,5 @@ export function getGitLabPullRequestIdentityFromMaybeUrl(
28
27
}
29
28
}
30
29
31
- return prNumber != null
32
- ? { ownerAndRepo : ownerAndRepo , prNumber : prNumber , provider : HostingIntegrationId . GitLab }
33
- : undefined ;
30
+ return prNumber != null ? { ownerAndRepo : ownerAndRepo , prNumber : prNumber } : undefined ;
34
31
}
You can’t perform that action at this time.
0 commit comments