File tree 2 files changed +18
-1
lines changed
plus/integrations/providers/azure
2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import type { Source } from '../../constants.telemetry';
4
4
import type { Container } from '../../container' ;
5
5
import { HostingIntegration } from '../../plus/integrations/integration' ;
6
6
import { remoteProviderIdToIntegrationId } from '../../plus/integrations/integrationService' ;
7
- import { parseAzureHttpsUrl } from '../../plus/integrations/providers/azure/models' ;
7
+ import { isVsts , parseAzureHttpsUrl } from '../../plus/integrations/providers/azure/models' ;
8
8
import type { Brand , Unbrand } from '../../system/brand' ;
9
9
import type { CreatePullRequestRemoteResource } from '../models/remoteResource' ;
10
10
import type { Repository } from '../models/repository' ;
@@ -122,6 +122,20 @@ export class AzureDevOpsRemote extends RemoteProvider {
122
122
return 'Azure DevOps' ;
123
123
}
124
124
125
+ override get owner ( ) : string | undefined {
126
+ if ( isVsts ( this . domain ) ) {
127
+ return this . domain . split ( '.' ) [ 0 ] ;
128
+ }
129
+ return super . owner ;
130
+ }
131
+
132
+ override get repoName ( ) : string | undefined {
133
+ if ( isVsts ( this . domain ) ) {
134
+ return this . path ;
135
+ }
136
+ return super . repoName ;
137
+ }
138
+
125
139
override get providerDesc ( ) :
126
140
| {
127
141
id : GkProviderId ;
Original file line number Diff line number Diff line change @@ -332,6 +332,9 @@ export function getAzureOwner(url: URL): string {
332
332
const isVSTS = vstsHostnameRegex . test ( url . hostname ) ;
333
333
return isVSTS ? getVSTSOwner ( url ) : getAzureDevOpsOwner ( url ) ;
334
334
}
335
+ export function isVsts ( domain : string ) : boolean {
336
+ return vstsHostnameRegex . test ( domain ) ;
337
+ }
335
338
336
339
export function getAzureRepo ( pr : AzurePullRequest ) : string {
337
340
return `${ pr . repository . project . name } /_git/${ pr . repository . name } ` ;
You can’t perform that action at this time.
0 commit comments