File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed
src/plus/integrations/providers Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -409,7 +409,13 @@ abstract class GitLabIntegrationBase<
409409 }
410410
411411 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+ } ;
413419 }
414420}
415421
Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ suite('Test GitLab PR URL parsing to identity: getPullRequestIdentityFromMaybeUr
1010 : {
1111 ownerAndRepo : ownerAndRepo ,
1212 prNumber : prNumber ,
13- provider : 'gitlab' ,
1413 } ,
1514 `Parse: ${ message } (${ JSON . stringify ( query ) } )` ,
1615 ) ;
Original file line number Diff line number Diff line change 22// That's why this file has been created that can collect more simple functions which
33// don't require Container and can be tested.
44
5- import { HostingIntegrationId } from '../../../../constants.integrations' ;
65import type { PullRequestUrlIdentity } from '../../../../git/utils/pullRequest.utils' ;
76
87export function isMaybeGitLabPullRequestUrl ( url : string ) : boolean {
@@ -11,7 +10,7 @@ export function isMaybeGitLabPullRequestUrl(url: string): boolean {
1110
1211export function getGitLabPullRequestIdentityFromMaybeUrl (
1312 search : string ,
14- ) : ( PullRequestUrlIdentity & { provider : HostingIntegrationId . GitLab } ) | undefined {
13+ ) : Omit < PullRequestUrlIdentity , ' provider' > | undefined {
1514 let ownerAndRepo : string | undefined = undefined ;
1615 let prNumber : string | undefined = undefined ;
1716
@@ -28,7 +27,5 @@ export function getGitLabPullRequestIdentityFromMaybeUrl(
2827 }
2928 }
3029
31- return prNumber != null
32- ? { ownerAndRepo : ownerAndRepo , prNumber : prNumber , provider : HostingIntegrationId . GitLab }
33- : undefined ;
30+ return prNumber != null ? { ownerAndRepo : ownerAndRepo , prNumber : prNumber } : undefined ;
3431}
You can’t perform that action at this time.
0 commit comments