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 @@ -438,7 +438,13 @@ abstract class GitLabIntegrationBase<
438
438
}
439
439
440
440
protected override getProviderPullRequestIdentityFromMaybeUrl ( search : string ) : PullRequestUrlIdentity | undefined {
441
- return getGitLabPullRequestIdentityFromMaybeUrl ( search ) ;
441
+ const identity = getGitLabPullRequestIdentityFromMaybeUrl ( search ) ;
442
+ if ( identity == null ) return undefined ;
443
+
444
+ return {
445
+ ...identity ,
446
+ provider : this . id ,
447
+ } ;
442
448
}
443
449
}
444
450
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ suite('Test GitLab PR URL parsing to identity: getPullRequestIdentityFromMaybeUr
11
11
: {
12
12
ownerAndRepo : ownerAndRepo ,
13
13
prNumber : prNumber ,
14
- provider : 'gitlab' ,
15
14
} ,
16
15
`Parse: ${ message } (${ JSON . stringify ( query ) } )` ,
17
16
) ;
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