Skip to content

Commit

Permalink
Merge branch 'main' into bugsnag-fix-error
Browse files Browse the repository at this point in the history
  • Loading branch information
fhp authored Sep 11, 2023
2 parents 155652a + 184dcf9 commit 5b4f418
Show file tree
Hide file tree
Showing 15 changed files with 105 additions and 22 deletions.
5 changes: 0 additions & 5 deletions .changeset/shy-ghosts-sleep.md

This file was deleted.

7 changes: 7 additions & 0 deletions packages/backend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# backend

## 2.0.22

### Patch Changes

- Updated dependencies [56c40ed5]
- @roadiehq/backstage-plugin-argo-cd-backend@2.11.2

## 2.0.21

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backend",
"version": "2.0.21",
"version": "2.0.22",
"main": "dist/index.cjs.js",
"types": "src/index.ts",
"private": true,
Expand Down Expand Up @@ -36,7 +36,7 @@
"@backstage/plugin-techdocs-backend": "^1.6.7",
"@gitbeaker/node": "^29.2.0",
"@octokit/rest": "^19.0.3",
"@roadiehq/backstage-plugin-argo-cd-backend": "2.11.1",
"@roadiehq/backstage-plugin-argo-cd-backend": "2.11.2",
"@roadiehq/catalog-backend-module-aws": "^1.3.14",
"@roadiehq/catalog-backend-module-okta": "^0.8.6",
"@roadiehq/backstage-plugin-aws-backend": "^1.1.13",
Expand Down
6 changes: 6 additions & 0 deletions plugins/backend/backstage-plugin-argo-cd-backend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @roadiehq/backstage-plugin-argo-cd-backend

## 2.11.2

### Patch Changes

- 56c40ed5: fix bug that throws error when some argo instances are unavailable

## 2.11.1

### Patch Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@roadiehq/backstage-plugin-argo-cd-backend",
"version": "2.11.1",
"version": "2.11.2",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
Expand Down
6 changes: 6 additions & 0 deletions plugins/frontend/backstage-plugin-argo-cd/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @roadiehq/backstage-plugin-argo-cd

## 2.3.3

### Patch Changes

- 1cb56767: fix: return item when no history

## 2.3.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion plugins/frontend/backstage-plugin-argo-cd/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@roadiehq/backstage-plugin-argo-cd",
"version": "2.3.2",
"version": "2.3.3",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,14 @@ export const useAppDetails = ({
};
const getRevisionHistroyPromises = items.items.map(
async (item: any) => {
let newItem;
if (item?.status.history && item?.status.history.length > 0) {
newItem = getRevisionHistroyDetails(
return getRevisionHistroyDetails(
item,
item.metadata.name,
item.metadata.instance.name,
);
}
return newItem;
return item;
},
);
return Promise.all(getRevisionHistroyPromises).then(result =>
Expand All @@ -155,11 +154,10 @@ export const useAppDetails = ({
};
const getRevisionHistroyPromises = apps.items.map(
async (item: any) => {
let newItem;
if (item?.status.history && item?.status.history.length > 0) {
newItem = getRevisionHistroyDetails(item, item.metadata.name);
return getRevisionHistroyDetails(item, item.metadata.name);
}
return newItem;
return item;
},
);
return Promise.all(getRevisionHistroyPromises).then(output =>
Expand Down
26 changes: 25 additions & 1 deletion plugins/frontend/backstage-plugin-argo-cd/src/mocks/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,18 @@ export const getResponseStubAppListForInstanceTwo = () => {

export const multipleApps = () => {
const item = JSON.parse(JSON.stringify(getResponseStubScanning));

const item1 = JSON.parse(JSON.stringify(item));
item1.metadata.name = 'guestbook-prod';

const item2 = JSON.parse(JSON.stringify(item));
item2.metadata.name = 'guestbook-staging';
return [item1, item2];

const item3 = JSON.parse(JSON.stringify(item));
item3.metadata.name = 'guestbook-nohistory';
item3.status.history = [];

return [item1, item2, item3];
};

export const getResponseStubAppListWithMultipleApps = {
Expand Down Expand Up @@ -420,6 +427,23 @@ export class ArgoCDApiMock implements ArgoCDApi {
},
},
},
{
metadata: {
name: 'guestbook-nohistory',
},
status: {
sync: {
status: 'OutOfSync',
},
health: {
status: 'Healthy',
},
operationState: {
startedAt: '2020-11-18T16:47:03Z',
finishedAt: '2020-11-18T16:47:04Z',
},
},
},
],
};
}
Expand Down
36 changes: 34 additions & 2 deletions plugins/frontend/backstage-plugin-argo-cd/src/plugin.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,19 @@ describe('argo-cd', () => {
),
),
);
worker.use(
rest.get(
'https://testbackend.com/api/argocd/argoInstance/argoInstance1/applications/name/guestbook-nohistory/revisions/6bed858de32a0e876ec49dad1a2e3c5840d3fb07/metadata',
(_, res, ctx) =>
res(
ctx.json({
author: 'testuser <testuser@test.com>',
date: '2023-03-20T18:44:10Z',
message: 'Update README.md',
}),
),
),
);
worker.use(
rest.get(
'https://testbackend.com/api/argocd/argoInstance/argoInstance2/applications/selector/name%3dguestbook',
Expand Down Expand Up @@ -908,9 +921,12 @@ describe('argo-cd', () => {
expect(
await rendered.findByText('guestbook-staging'),
).toBeInTheDocument();
expect(
await rendered.findByText('guestbook-nohistory'),
).toBeInTheDocument();

const apps = await rendered.findAllByText('argoInstance1');
expect(apps).toHaveLength(2);
expect(apps).toHaveLength(3);
expect(await rendered.findByText('argoInstance2')).toBeInTheDocument();
});
it('should display fetched data from an instance when scanning multiple instances', async () => {
Expand Down Expand Up @@ -965,6 +981,19 @@ describe('argo-cd', () => {
),
),
);
worker.use(
rest.get(
'https://testbackend.com/api/argocd/argoInstance/argoInstance1/applications/name/guestbook-nohistory/revisions/6bed858de32a0e876ec49dad1a2e3c5840d3fb07/metadata',
(_, res, ctx) =>
res(
ctx.json({
author: 'testuser <testuser@test.com>',
date: '2023-03-20T18:44:10Z',
message: 'Update README.md',
}),
),
),
);
worker.use(
rest.get(
'https://testbackend.com/api/argocd/argoInstance/argoInstance2/applications/selector/name%3dguestbook',
Expand All @@ -982,9 +1011,12 @@ describe('argo-cd', () => {
expect(
await rendered.findByText('guestbook-staging'),
).toBeInTheDocument();
expect(
await rendered.findByText('guestbook-nohistory'),
).toBeInTheDocument();

const apps = await rendered.findAllByText('argoInstance1');
expect(apps).toHaveLength(2);
expect(apps).toHaveLength(3);
expect(rendered.queryByText('argoInstance2')).toBeNull();
});
it('should display an empty table when receiving no data from multiple instances', async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @roadiehq/backstage-plugin-github-insights

## 2.3.19

### Patch Changes

- 86721387: The `MarkdownContent` component currently removes only single line comments if `preserveHtmlComments` is not set.
This change accounts for single line and multiline HTML comments

## 2.3.18

### Patch Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@roadiehq/backstage-plugin-github-insights",
"version": "2.3.18",
"version": "2.3.19",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const GithubFileContent = (props: MarkdownContentProps) => {

let content = value.content;
if (!preserveHtmlComments) {
content = content.replace(/<!--.*?-->/g, '');
content = content.replace(/<!--(.|\n)*?-->/g, '');
}

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @roadiehq/scaffolder-backend-argocd

## 1.1.15

### Patch Changes

- af8fc26a: fix: return item when no history on argo app
- Updated dependencies [56c40ed5]
- @roadiehq/backstage-plugin-argo-cd-backend@2.11.2

## 1.1.14

### Patch Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@roadiehq/scaffolder-backend-argocd",
"version": "1.1.14",
"version": "1.1.15",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
Expand Down Expand Up @@ -34,7 +34,7 @@
"@backstage/backend-common": "^0.19.4",
"@backstage/config": "^1.0.8",
"@backstage/plugin-scaffolder-backend": "^1.16.4",
"@roadiehq/backstage-plugin-argo-cd-backend": "^2.11.1",
"@roadiehq/backstage-plugin-argo-cd-backend": "^2.11.2",
"winston": "^3.2.1"
},
"devDependencies": {
Expand Down

0 comments on commit 5b4f418

Please sign in to comment.