Explorar el Código

Closes #501 - Adds support for Azure DevOps

main
Eric Amodio hace 6 años
padre
commit
1d36b809ca
Se han modificado 8 ficheros con 76 adiciones y 75 borrados
  1. +2
    -2
      src/git/remotes/azure-devops.ts
  2. +1
    -1
      src/git/remotes/bitbucket-server.ts
  3. +1
    -1
      src/git/remotes/bitbucket.ts
  4. +1
    -1
      src/git/remotes/custom.ts
  5. +16
    -15
      src/git/remotes/factory.ts
  6. +1
    -1
      src/git/remotes/github.ts
  7. +1
    -1
      src/git/remotes/gitlab.ts

src/git/remotes/visualStudio.ts → src/git/remotes/azure-devops.ts Ver fichero

@ -5,7 +5,7 @@ import { RemoteProvider } from './provider';
const issueEnricherRegEx = /(^|\s)(#([0-9]+))\b/gi;
const stripGitRegex = /\/_git\/?/i;
export class VisualStudioService extends RemoteProvider {
export class AzureDevOpsRemote extends RemoteProvider {
constructor(domain: string, path: string, protocol?: string, name?: string) {
super(domain, path, protocol, name);
}
@ -15,7 +15,7 @@ export class VisualStudioService extends RemoteProvider {
}
get name() {
return 'Visual Studio Team Services';
return 'Azure DevOps';
}
enrichMessage(message: string): string {

+ 1
- 1
src/git/remotes/bitbucket-server.ts Ver fichero

@ -5,7 +5,7 @@ import { RemoteProvider } from './provider';
const issueEnricherRegEx = /(^|\s)(issue #([0-9]+))\b/gi;
const prEnricherRegEx = /(^|\s)(pull request #([0-9]+))\b/gi;
export class BitbucketServerService extends RemoteProvider {
export class BitbucketServerRemote extends RemoteProvider {
constructor(domain: string, path: string, protocol?: string, name?: string, custom: boolean = false) {
super(domain, path, protocol, name, custom);
}

+ 1
- 1
src/git/remotes/bitbucket.ts Ver fichero

@ -5,7 +5,7 @@ import { RemoteProvider } from './provider';
const issueEnricherRegEx = /(^|\s)(issue #([0-9]+))\b/gi;
const prEnricherRegEx = /(^|\s)(pull request #([0-9]+))\b/gi;
export class BitbucketService extends RemoteProvider {
export class BitbucketRemote extends RemoteProvider {
constructor(domain: string, path: string, protocol?: string, name?: string, custom: boolean = false) {
super(domain, path, protocol, name, custom);
}

+ 1
- 1
src/git/remotes/custom.ts Ver fichero

@ -4,7 +4,7 @@ import { RemotesUrlsConfig } from '../../configuration';
import { Strings } from '../../system';
import { RemoteProvider } from './provider';
export class CustomService extends RemoteProvider {
export class CustomRemote extends RemoteProvider {
private readonly urls: RemotesUrlsConfig;
constructor(domain: string, path: string, urls: RemotesUrlsConfig, protocol?: string, name?: string) {

+ 16
- 15
src/git/remotes/factory.ts Ver fichero

@ -1,21 +1,22 @@
'use strict';
import { CustomRemoteType, RemotesConfig } from '../../configuration';
import { Logger } from '../../logger';
import { BitbucketService } from './bitbucket';
import { BitbucketServerService } from './bitbucket-server';
import { CustomService } from './custom';
import { GitHubService } from './github';
import { GitLabService } from './gitlab';
import { AzureDevOpsRemote } from './azure-devops';
import { BitbucketRemote } from './bitbucket';
import { BitbucketServerRemote } from './bitbucket-server';
import { CustomRemote } from './custom';
import { GitHubRemote } from './github';
import { GitLabRemote } from './gitlab';
import { RemoteProvider } from './provider';
import { VisualStudioService } from './visualStudio';
export { RemoteProvider };
const defaultProviderMap = new Map<string, (domain: string, path: string) => RemoteProvider>([
['bitbucket.org', (domain: string, path: string) => new BitbucketService(domain, path)],
['github.com', (domain: string, path: string) => new GitHubService(domain, path)],
['gitlab.com', (domain: string, path: string) => new GitLabService(domain, path)],
['visualstudio.com', (domain: string, path: string) => new VisualStudioService(domain, path)]
['bitbucket.org', (domain: string, path: string) => new BitbucketRemote(domain, path)],
['github.com', (domain: string, path: string) => new GitHubRemote(domain, path)],
['gitlab.com', (domain: string, path: string) => new GitLabRemote(domain, path)],
['visualstudio.com', (domain: string, path: string) => new AzureDevOpsRemote(domain, path)],
['dev.azure.com', (domain: string, path: string) => new AzureDevOpsRemote(domain, path)]
]);
export type RemoteProviderMap = Map<string, (domain: string, path: string) => RemoteProvider>;
@ -60,17 +61,17 @@ export class RemoteProviderFactory {
switch (cfg.type) {
case CustomRemoteType.Bitbucket:
return (domain: string, path: string) =>
new BitbucketService(domain, path, cfg.protocol, cfg.name, true);
new BitbucketRemote(domain, path, cfg.protocol, cfg.name, true);
case CustomRemoteType.BitbucketServer:
return (domain: string, path: string) =>
new BitbucketServerService(domain, path, cfg.protocol, cfg.name, true);
new BitbucketServerRemote(domain, path, cfg.protocol, cfg.name, true);
case CustomRemoteType.Custom:
return (domain: string, path: string) =>
new CustomService(domain, path, cfg.urls!, cfg.protocol, cfg.name);
new CustomRemote(domain, path, cfg.urls!, cfg.protocol, cfg.name);
case CustomRemoteType.GitHub:
return (domain: string, path: string) => new GitHubService(domain, path, cfg.protocol, cfg.name, true);
return (domain: string, path: string) => new GitHubRemote(domain, path, cfg.protocol, cfg.name, true);
case CustomRemoteType.GitLab:
return (domain: string, path: string) => new GitLabService(domain, path, cfg.protocol, cfg.name, true);
return (domain: string, path: string) => new GitLabRemote(domain, path, cfg.protocol, cfg.name, true);
}
return undefined;
}

+ 1
- 1
src/git/remotes/github.ts Ver fichero

@ -5,7 +5,7 @@ import { RemoteProvider } from './provider';
const issueEnricherRegEx = /(^|\s)((?:#|gh-)([0-9]+))\b/gi;
const issueEnricher3rdParyRegEx = /\b((\w+-?\w+(?!-)\/\w+-?\w+(?!-))#([0-9]+))\b/g;
export class GitHubService extends RemoteProvider {
export class GitHubRemote extends RemoteProvider {
constructor(domain: string, path: string, protocol?: string, name?: string, custom: boolean = false) {
super(domain, path, protocol, name, custom);
}

+ 1
- 1
src/git/remotes/gitlab.ts Ver fichero

@ -4,7 +4,7 @@ import { RemoteProvider } from './provider';
const issueEnricherRegEx = /(^|\s)(#([0-9]+))\b/gi;
export class GitLabService extends RemoteProvider {
export class GitLabRemote extends RemoteProvider {
constructor(domain: string, path: string, protocol?: string, name?: string, custom: boolean = false) {
super(domain, path, protocol, name, custom);
}

Cargando…
Cancelar
Guardar