@backstage-community/plugin-azure-devops 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/alpha.d.ts +54 -33
- package/dist/index.d.ts +11 -1
- package/dist/index.esm.js +3 -3
- package/dist/utils/getAnnotationValuesFromEntity.esm.js.map +1 -1
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @backstage-community/plugin-azure-devops
|
|
2
2
|
|
|
3
|
+
## 0.13.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 75f72bb: Backstage version bump to v1.37.0
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [75f72bb]
|
|
12
|
+
- @backstage-community/plugin-azure-devops-common@0.9.0
|
|
13
|
+
|
|
14
|
+
## 0.12.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- 1e8ea62: Export function `getAnnotationValuesFromEntity`
|
|
19
|
+
|
|
3
20
|
## 0.11.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
package/dist/alpha.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as _backstage_catalog_model_index from '@backstage/catalog-model/index';
|
|
2
|
+
import * as _backstage_plugin_catalog_react_alpha from '@backstage/plugin-catalog-react/alpha';
|
|
2
3
|
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
3
|
-
import * as
|
|
4
|
+
import * as _backstage_core_plugin_api__ from '@backstage/core-plugin-api/*';
|
|
4
5
|
import React__default from 'react';
|
|
5
6
|
|
|
6
7
|
/** @alpha */
|
|
@@ -10,43 +11,51 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{}, {}, {
|
|
|
10
11
|
name: undefined;
|
|
11
12
|
config: {};
|
|
12
13
|
configInput: {};
|
|
13
|
-
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<
|
|
14
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_core_plugin_api__.AnyApiFactory, "core.api.factory", {}>;
|
|
14
15
|
inputs: {};
|
|
15
16
|
params: {
|
|
16
|
-
factory:
|
|
17
|
+
factory: _backstage_core_plugin_api__.AnyApiFactory;
|
|
17
18
|
};
|
|
18
19
|
}>;
|
|
19
|
-
"
|
|
20
|
-
kind: "
|
|
21
|
-
name:
|
|
20
|
+
"entity-card:azure-devops/readme": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
21
|
+
kind: "entity-card";
|
|
22
|
+
name: "readme";
|
|
22
23
|
config: {
|
|
23
|
-
|
|
24
|
+
filter: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
25
|
+
type: "content" | "summary" | "info" | undefined;
|
|
24
26
|
};
|
|
25
27
|
configInput: {
|
|
26
|
-
|
|
28
|
+
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
29
|
+
type?: "content" | "summary" | "info" | undefined;
|
|
27
30
|
};
|
|
28
|
-
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<React__default.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<
|
|
31
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<React__default.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model_index.Entity) => boolean, "catalog.entity-filter-function", {
|
|
32
|
+
optional: true;
|
|
33
|
+
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
34
|
+
optional: true;
|
|
35
|
+
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_plugin_catalog_react_alpha.EntityCardType, "catalog.entity-card-type", {
|
|
29
36
|
optional: true;
|
|
30
37
|
}>;
|
|
31
38
|
inputs: {};
|
|
32
39
|
params: {
|
|
33
|
-
defaultPath: string;
|
|
34
40
|
loader: () => Promise<JSX.Element>;
|
|
35
|
-
|
|
41
|
+
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity: _backstage_catalog_model_index.Entity) => boolean) | undefined;
|
|
42
|
+
type?: _backstage_plugin_catalog_react_alpha.EntityCardType | undefined;
|
|
36
43
|
};
|
|
37
44
|
}>;
|
|
38
|
-
"entity-content:azure-devops/
|
|
45
|
+
"entity-content:azure-devops/git-tags": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
39
46
|
kind: "entity-content";
|
|
40
|
-
name: "
|
|
47
|
+
name: "git-tags";
|
|
41
48
|
config: {
|
|
42
49
|
path: string | undefined;
|
|
43
50
|
title: string | undefined;
|
|
44
|
-
filter:
|
|
51
|
+
filter: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
52
|
+
group: string | false | undefined;
|
|
45
53
|
};
|
|
46
54
|
configInput: {
|
|
47
|
-
filter?:
|
|
55
|
+
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
48
56
|
title?: string | undefined;
|
|
49
57
|
path?: string | undefined;
|
|
58
|
+
group?: string | false | undefined;
|
|
50
59
|
};
|
|
51
60
|
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<React__default.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
|
|
52
61
|
optional: true;
|
|
@@ -54,28 +63,33 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{}, {}, {
|
|
|
54
63
|
optional: true;
|
|
55
64
|
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
56
65
|
optional: true;
|
|
66
|
+
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-content-group", {
|
|
67
|
+
optional: true;
|
|
57
68
|
}>;
|
|
58
69
|
inputs: {};
|
|
59
70
|
params: {
|
|
60
71
|
loader: () => Promise<JSX.Element>;
|
|
61
72
|
defaultPath: string;
|
|
62
73
|
defaultTitle: string;
|
|
74
|
+
defaultGroup?: (string & {}) | "development" | "deployment" | "documentation" | "observability" | undefined;
|
|
63
75
|
routeRef?: _backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
|
|
64
|
-
filter?:
|
|
76
|
+
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity: _backstage_catalog_model_index.Entity) => boolean) | undefined;
|
|
65
77
|
};
|
|
66
78
|
}>;
|
|
67
|
-
"entity-content:azure-devops/
|
|
79
|
+
"entity-content:azure-devops/pipelines": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
68
80
|
kind: "entity-content";
|
|
69
|
-
name: "
|
|
81
|
+
name: "pipelines";
|
|
70
82
|
config: {
|
|
71
83
|
path: string | undefined;
|
|
72
84
|
title: string | undefined;
|
|
73
|
-
filter:
|
|
85
|
+
filter: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
86
|
+
group: string | false | undefined;
|
|
74
87
|
};
|
|
75
88
|
configInput: {
|
|
76
|
-
filter?:
|
|
89
|
+
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
77
90
|
title?: string | undefined;
|
|
78
91
|
path?: string | undefined;
|
|
92
|
+
group?: string | false | undefined;
|
|
79
93
|
};
|
|
80
94
|
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<React__default.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
|
|
81
95
|
optional: true;
|
|
@@ -83,14 +97,17 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{}, {}, {
|
|
|
83
97
|
optional: true;
|
|
84
98
|
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
85
99
|
optional: true;
|
|
100
|
+
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-content-group", {
|
|
101
|
+
optional: true;
|
|
86
102
|
}>;
|
|
87
103
|
inputs: {};
|
|
88
104
|
params: {
|
|
89
105
|
loader: () => Promise<JSX.Element>;
|
|
90
106
|
defaultPath: string;
|
|
91
107
|
defaultTitle: string;
|
|
108
|
+
defaultGroup?: (string & {}) | "development" | "deployment" | "documentation" | "observability" | undefined;
|
|
92
109
|
routeRef?: _backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
|
|
93
|
-
filter?:
|
|
110
|
+
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity: _backstage_catalog_model_index.Entity) => boolean) | undefined;
|
|
94
111
|
};
|
|
95
112
|
}>;
|
|
96
113
|
"entity-content:azure-devops/pull-requests": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
@@ -99,12 +116,14 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{}, {}, {
|
|
|
99
116
|
config: {
|
|
100
117
|
path: string | undefined;
|
|
101
118
|
title: string | undefined;
|
|
102
|
-
filter:
|
|
119
|
+
filter: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
120
|
+
group: string | false | undefined;
|
|
103
121
|
};
|
|
104
122
|
configInput: {
|
|
105
|
-
filter?:
|
|
123
|
+
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
106
124
|
title?: string | undefined;
|
|
107
125
|
path?: string | undefined;
|
|
126
|
+
group?: string | false | undefined;
|
|
108
127
|
};
|
|
109
128
|
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<React__default.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
|
|
110
129
|
optional: true;
|
|
@@ -112,34 +131,36 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{}, {}, {
|
|
|
112
131
|
optional: true;
|
|
113
132
|
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
114
133
|
optional: true;
|
|
134
|
+
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-content-group", {
|
|
135
|
+
optional: true;
|
|
115
136
|
}>;
|
|
116
137
|
inputs: {};
|
|
117
138
|
params: {
|
|
118
139
|
loader: () => Promise<JSX.Element>;
|
|
119
140
|
defaultPath: string;
|
|
120
141
|
defaultTitle: string;
|
|
142
|
+
defaultGroup?: (string & {}) | "development" | "deployment" | "documentation" | "observability" | undefined;
|
|
121
143
|
routeRef?: _backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
|
|
122
|
-
filter?:
|
|
144
|
+
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity: _backstage_catalog_model_index.Entity) => boolean) | undefined;
|
|
123
145
|
};
|
|
124
146
|
}>;
|
|
125
|
-
"
|
|
126
|
-
kind: "
|
|
127
|
-
name:
|
|
147
|
+
"page:azure-devops": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
148
|
+
kind: "page";
|
|
149
|
+
name: undefined;
|
|
128
150
|
config: {
|
|
129
|
-
|
|
151
|
+
path: string | undefined;
|
|
130
152
|
};
|
|
131
153
|
configInput: {
|
|
132
|
-
|
|
154
|
+
path?: string | undefined;
|
|
133
155
|
};
|
|
134
|
-
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<React__default.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<
|
|
135
|
-
optional: true;
|
|
136
|
-
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
156
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<React__default.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
|
|
137
157
|
optional: true;
|
|
138
158
|
}>;
|
|
139
159
|
inputs: {};
|
|
140
160
|
params: {
|
|
161
|
+
defaultPath: string;
|
|
141
162
|
loader: () => Promise<JSX.Element>;
|
|
142
|
-
|
|
163
|
+
routeRef?: _backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
|
|
143
164
|
};
|
|
144
165
|
}>;
|
|
145
166
|
}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -183,4 +183,14 @@ declare class AzureDevOpsClient implements AzureDevOpsApi {
|
|
|
183
183
|
private get;
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
|
|
186
|
+
/** @public **/
|
|
187
|
+
declare function getAnnotationValuesFromEntity(entity: Entity): {
|
|
188
|
+
project: string;
|
|
189
|
+
repo?: string;
|
|
190
|
+
definition?: string;
|
|
191
|
+
host?: string;
|
|
192
|
+
org?: string;
|
|
193
|
+
readmePath?: string;
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
export { type AllFilter, type AssignedToTeamFilter, type AssignedToTeamsFilter, type AssignedToUserFilter, type AzureDevOpsApi, AzureDevOpsClient, AzurePullRequestsIcon, AzurePullRequestsPage, type BaseFilter, type CreatedByTeamFilter, type CreatedByTeamsFilter, type CreatedByUserFilter, EntityAzureGitTagsContent, EntityAzurePipelinesContent, EntityAzurePullRequestsContent, EntityAzureReadmeCard, type Filter, FilterType, type PullRequestColumnConfig, type PullRequestFilter, azureDevOpsApiRef, azureDevOpsPlugin, getAnnotationValuesFromEntity, isAzureDevOpsAvailable, isAzurePipelinesAvailable };
|
package/dist/index.esm.js
CHANGED
|
@@ -2,9 +2,9 @@ export { AzurePullRequestsPage, EntityAzureGitTagsContent, EntityAzurePipelinesC
|
|
|
2
2
|
export { AzurePullRequestsIcon } from './components/AzurePullRequestsIcon/AzurePullRequestsIcon.esm.js';
|
|
3
3
|
export { azureDevOpsApiRef } from './api/AzureDevOpsApi.esm.js';
|
|
4
4
|
export { AzureDevOpsClient } from './api/AzureDevOpsClient.esm.js';
|
|
5
|
-
import './components/PullRequestsPage/PullRequestsPage.esm.js';
|
|
6
|
-
export { FilterType } from './components/PullRequestsPage/lib/filters/types.esm.js';
|
|
7
5
|
import 'luxon';
|
|
8
6
|
import 'humanize-duration';
|
|
9
|
-
|
|
7
|
+
export { getAnnotationValuesFromEntity } from './utils/getAnnotationValuesFromEntity.esm.js';
|
|
8
|
+
import './components/PullRequestsPage/PullRequestsPage.esm.js';
|
|
9
|
+
export { FilterType } from './components/PullRequestsPage/lib/filters/types.esm.js';
|
|
10
10
|
//# sourceMappingURL=index.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAnnotationValuesFromEntity.esm.js","sources":["../../src/utils/getAnnotationValuesFromEntity.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport {\n AZURE_DEVOPS_PROJECT_ANNOTATION,\n AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION,\n AZURE_DEVOPS_README_ANNOTATION,\n AZURE_DEVOPS_REPO_ANNOTATION,\n AZURE_DEVOPS_HOST_ORG_ANNOTATION,\n} from '@backstage-community/plugin-azure-devops-common';\n\nexport function getAnnotationValuesFromEntity(entity: Entity): {\n project: string;\n repo?: string;\n definition?: string;\n host?: string;\n org?: string;\n readmePath?: string;\n} {\n const hostOrg = getHostOrg(entity.metadata.annotations);\n const projectRepo = getProjectRepo(entity.metadata.annotations);\n const project =\n entity.metadata.annotations?.[AZURE_DEVOPS_PROJECT_ANNOTATION];\n const definition =\n entity.metadata.annotations?.[AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION];\n const readmePath =\n entity.metadata.annotations?.[AZURE_DEVOPS_README_ANNOTATION];\n\n if (definition) {\n if (project) {\n return {\n project,\n definition,\n readmePath: readmePath,\n ...hostOrg,\n };\n }\n if (projectRepo.project) {\n return {\n project: projectRepo.project,\n repo: projectRepo.repo,\n definition,\n readmePath: readmePath,\n ...hostOrg,\n };\n }\n throw new Error(\n `Value for annotation \"${AZURE_DEVOPS_PROJECT_ANNOTATION}\" was not found`,\n );\n } else {\n if (projectRepo.project) {\n return {\n project: projectRepo.project,\n repo: projectRepo.repo,\n readmePath: readmePath,\n ...hostOrg,\n };\n }\n\n if (project) {\n throw new Error(\n `Value for annotation \"${AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION}\" was not found`,\n );\n }\n }\n\n throw new Error('Expected \"dev.azure.com\" annotations were not found');\n}\n\nfunction getProjectRepo(annotations?: Record<string, string>): {\n project?: string;\n repo?: string;\n} {\n const annotation = annotations?.[AZURE_DEVOPS_REPO_ANNOTATION];\n if (!annotation) {\n return { project: undefined, repo: undefined };\n }\n\n if (annotation.split('/').length === 2) {\n const [project, repo] = annotation.split('/');\n if (project && repo) {\n return { project, repo };\n }\n }\n\n throw new Error(\n `Invalid value for annotation \"${AZURE_DEVOPS_REPO_ANNOTATION}\"; expected format is: <project-name>/<repo-name>, found: \"${annotation}\"`,\n );\n}\n\nfunction getHostOrg(annotations?: Record<string, string>): {\n host?: string;\n org?: string;\n} {\n const annotation = annotations?.[AZURE_DEVOPS_HOST_ORG_ANNOTATION];\n if (!annotation) {\n return { host: undefined, org: undefined };\n }\n\n const segments = annotation.split('/');\n if (segments.length === 2) {\n const [host, org] = segments;\n if (host && org) {\n return { host, org };\n }\n } else if (segments.length === 3) {\n const [host, subpath, org] = segments;\n return { host: `${host}/${subpath}`, org };\n }\n\n throw new Error(\n `Invalid value for annotation \"${AZURE_DEVOPS_HOST_ORG_ANNOTATION}\"; expected format is: <host-name>/<organization-name>, found: \"${annotation}\"`,\n );\n}\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"getAnnotationValuesFromEntity.esm.js","sources":["../../src/utils/getAnnotationValuesFromEntity.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport {\n AZURE_DEVOPS_PROJECT_ANNOTATION,\n AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION,\n AZURE_DEVOPS_README_ANNOTATION,\n AZURE_DEVOPS_REPO_ANNOTATION,\n AZURE_DEVOPS_HOST_ORG_ANNOTATION,\n} from '@backstage-community/plugin-azure-devops-common';\n\n/** @public **/\nexport function getAnnotationValuesFromEntity(entity: Entity): {\n project: string;\n repo?: string;\n definition?: string;\n host?: string;\n org?: string;\n readmePath?: string;\n} {\n const hostOrg = getHostOrg(entity.metadata.annotations);\n const projectRepo = getProjectRepo(entity.metadata.annotations);\n const project =\n entity.metadata.annotations?.[AZURE_DEVOPS_PROJECT_ANNOTATION];\n const definition =\n entity.metadata.annotations?.[AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION];\n const readmePath =\n entity.metadata.annotations?.[AZURE_DEVOPS_README_ANNOTATION];\n\n if (definition) {\n if (project) {\n return {\n project,\n definition,\n readmePath: readmePath,\n ...hostOrg,\n };\n }\n if (projectRepo.project) {\n return {\n project: projectRepo.project,\n repo: projectRepo.repo,\n definition,\n readmePath: readmePath,\n ...hostOrg,\n };\n }\n throw new Error(\n `Value for annotation \"${AZURE_DEVOPS_PROJECT_ANNOTATION}\" was not found`,\n );\n } else {\n if (projectRepo.project) {\n return {\n project: projectRepo.project,\n repo: projectRepo.repo,\n readmePath: readmePath,\n ...hostOrg,\n };\n }\n\n if (project) {\n throw new Error(\n `Value for annotation \"${AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION}\" was not found`,\n );\n }\n }\n\n throw new Error('Expected \"dev.azure.com\" annotations were not found');\n}\n\nfunction getProjectRepo(annotations?: Record<string, string>): {\n project?: string;\n repo?: string;\n} {\n const annotation = annotations?.[AZURE_DEVOPS_REPO_ANNOTATION];\n if (!annotation) {\n return { project: undefined, repo: undefined };\n }\n\n if (annotation.split('/').length === 2) {\n const [project, repo] = annotation.split('/');\n if (project && repo) {\n return { project, repo };\n }\n }\n\n throw new Error(\n `Invalid value for annotation \"${AZURE_DEVOPS_REPO_ANNOTATION}\"; expected format is: <project-name>/<repo-name>, found: \"${annotation}\"`,\n );\n}\n\nfunction getHostOrg(annotations?: Record<string, string>): {\n host?: string;\n org?: string;\n} {\n const annotation = annotations?.[AZURE_DEVOPS_HOST_ORG_ANNOTATION];\n if (!annotation) {\n return { host: undefined, org: undefined };\n }\n\n const segments = annotation.split('/');\n if (segments.length === 2) {\n const [host, org] = segments;\n if (host && org) {\n return { host, org };\n }\n } else if (segments.length === 3) {\n const [host, subpath, org] = segments;\n return { host: `${host}/${subpath}`, org };\n }\n\n throw new Error(\n `Invalid value for annotation \"${AZURE_DEVOPS_HOST_ORG_ANNOTATION}\"; expected format is: <host-name>/<organization-name>, found: \"${annotation}\"`,\n );\n}\n"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage-community/plugin-azure-devops",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "frontend-plugin",
|
|
6
6
|
"pluginId": "azure-devops",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"types": "./dist/index.d.ts",
|
|
43
43
|
"typesVersions": {
|
|
44
44
|
"*": {
|
|
45
|
-
"
|
|
45
|
+
"*": [
|
|
46
46
|
"dist/index.d.ts"
|
|
47
47
|
],
|
|
48
48
|
"alpha": [
|
|
@@ -63,15 +63,15 @@
|
|
|
63
63
|
"test": "backstage-cli package test"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@backstage-community/plugin-azure-devops-common": "^0.
|
|
66
|
+
"@backstage-community/plugin-azure-devops-common": "^0.9.0",
|
|
67
67
|
"@backstage/catalog-model": "^1.7.3",
|
|
68
|
-
"@backstage/core-compat-api": "^0.
|
|
69
|
-
"@backstage/core-components": "^0.
|
|
70
|
-
"@backstage/core-plugin-api": "^1.10.
|
|
68
|
+
"@backstage/core-compat-api": "^0.4.0",
|
|
69
|
+
"@backstage/core-components": "^0.17.0",
|
|
70
|
+
"@backstage/core-plugin-api": "^1.10.5",
|
|
71
71
|
"@backstage/errors": "^1.2.7",
|
|
72
|
-
"@backstage/frontend-plugin-api": "^0.
|
|
73
|
-
"@backstage/plugin-catalog-react": "^1.
|
|
74
|
-
"@backstage/plugin-permission-react": "^0.4.
|
|
72
|
+
"@backstage/frontend-plugin-api": "^0.10.0",
|
|
73
|
+
"@backstage/plugin-catalog-react": "^1.16.0",
|
|
74
|
+
"@backstage/plugin-permission-react": "^0.4.32",
|
|
75
75
|
"@material-ui/core": "^4.12.2",
|
|
76
76
|
"@material-ui/icons": "^4.9.1",
|
|
77
77
|
"@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
@@ -80,9 +80,9 @@
|
|
|
80
80
|
"react-use": "^17.2.4"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@backstage/cli": "^0.
|
|
84
|
-
"@backstage/dev-utils": "^1.1.
|
|
85
|
-
"@backstage/test-utils": "^1.7.
|
|
83
|
+
"@backstage/cli": "^0.31.0",
|
|
84
|
+
"@backstage/dev-utils": "^1.1.8",
|
|
85
|
+
"@backstage/test-utils": "^1.7.6",
|
|
86
86
|
"@testing-library/dom": "^10.0.0",
|
|
87
87
|
"@testing-library/jest-dom": "^6.0.0",
|
|
88
88
|
"@testing-library/react": "^15.0.0",
|