PR Feedback
Signed-off-by: R-Beck-2020 <78100403+R-Beck-2020@users.noreply.github.com>
This commit is contained in:
@@ -61,6 +61,25 @@ spec:
|
||||
# ...
|
||||
```
|
||||
|
||||
#### Mono repos
|
||||
|
||||
If you have multiple entities within a single repo, you will need to specify which pipelines belong to each entity.
|
||||
|
||||
```yaml
|
||||
dev.azure.com/project-repo: <my-project>/<my-repo>
|
||||
dev.azure.com/build-definition: <build-definition-name>
|
||||
```
|
||||
|
||||
#### Pipeline in different project to repo
|
||||
|
||||
If your pipeline is in a different project to the source code, you will need to specify this in the project annotation.
|
||||
|
||||
```yaml
|
||||
dev.azure.com/project-repo: <project1>/<my-repo>
|
||||
dev.azure.com/build-definition: <build-definition-name>
|
||||
dev.azure.com/project: <project2>
|
||||
```
|
||||
|
||||
#### Azure Pipelines Only
|
||||
|
||||
If you are only using Azure Pipelines along with a different SCM tool then you can use the following two annotations to see Builds:
|
||||
|
||||
@@ -99,7 +99,7 @@ describe('useBuildRuns', () => {
|
||||
renderHook(() => useBuildRuns(entity), {
|
||||
wrapper: Wrapper,
|
||||
}),
|
||||
).toThrow('"dev.azure.com" annotations are missing');
|
||||
).toThrow('Expected "dev.azure.com" annotations were not found');
|
||||
});
|
||||
|
||||
it('should return throw when annotation invalid', async () => {
|
||||
|
||||
@@ -103,7 +103,7 @@ describe('useGitTags', () => {
|
||||
renderHook(() => useGitTags(entity), {
|
||||
wrapper: Wrapper,
|
||||
}),
|
||||
).toThrow('"dev.azure.com" annotations are missing');
|
||||
).toThrow('Expected "dev.azure.com" annotations were not found');
|
||||
});
|
||||
|
||||
it('should return throw when annotation invalid', async () => {
|
||||
|
||||
@@ -102,7 +102,7 @@ describe('usePullRequests', () => {
|
||||
renderHook(() => usePullRequests(entity), {
|
||||
wrapper: Wrapper,
|
||||
}),
|
||||
).toThrow('"dev.azure.com" annotations are missing');
|
||||
).toThrow('Expected "dev.azure.com" annotations were not found');
|
||||
});
|
||||
|
||||
it('should return throw when annotation invalid', async () => {
|
||||
|
||||
@@ -81,7 +81,7 @@ describe('useReadme', () => {
|
||||
renderHook(() => useReadme(entity), {
|
||||
wrapper: Wrapper,
|
||||
}),
|
||||
).toThrow('"dev.azure.com" annotations are missing');
|
||||
).toThrow('Expected "dev.azure.com" annotations were not found');
|
||||
});
|
||||
|
||||
it('should return throw when annotation invalid', async () => {
|
||||
|
||||
@@ -69,6 +69,18 @@ describe('azure-devops', () => {
|
||||
expect(isAzurePipelinesAvailable(entity)).toBe(true);
|
||||
});
|
||||
|
||||
it('should be false when no annotations are present', () => {
|
||||
const entity: Entity = {
|
||||
apiVersion: 'backstage.io/v1alpha1',
|
||||
kind: 'Component',
|
||||
metadata: {
|
||||
namespace: 'default',
|
||||
name: 'sample',
|
||||
},
|
||||
};
|
||||
expect(isAzurePipelinesAvailable(entity)).toBe(false);
|
||||
});
|
||||
|
||||
it('should be false when only project annotation is present', () => {
|
||||
const entity: Entity = {
|
||||
apiVersion: 'backstage.io/v1alpha1',
|
||||
|
||||
@@ -71,7 +71,7 @@ export function getAnnotationValuesFromEntity(entity: Entity): {
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error('"dev.azure.com" annotations are missing');
|
||||
throw new Error('Expected "dev.azure.com" annotations were not found');
|
||||
}
|
||||
|
||||
function getProjectRepo(annotations?: Record<string, string>): {
|
||||
|
||||
Reference in New Issue
Block a user