Skip to content

Commit

Permalink
Merge branch 'main' into improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
SaachiNayyer authored May 15, 2024
2 parents ea04f74 + 9fdc920 commit 38e9980
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 16 deletions.
10 changes: 0 additions & 10 deletions .changeset/stupid-ties-push.md

This file was deleted.

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

## 0.3.12

### Patch Changes

- Updated dependencies [11822da]
- Updated dependencies [5fd2a31]
- @axis-backstage/plugin-jira-dashboard-backend@2.1.0

## 0.3.11

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backend",
"version": "0.3.11",
"version": "0.3.12",
"main": "dist/index.cjs.js",
"types": "src/index.ts",
"private": true,
Expand Down
15 changes: 15 additions & 0 deletions plugins/jira-dashboard-backend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# @axis-backstage/plugin-jira-dashboard-backend

## 2.1.0

### Minor Changes

- 5fd2a31: Querying for components that contain spaces should now return the expected results. Component
names is now wrapped in single quotations.

Added the `jqlQueryBuilder` function that will create a JQL query based on the arguments. This is
exported from the backend plugin to be used outside the context of the plugin together with the
`searchJira` function.

### Patch Changes

- 11822da: Enhance error message when querying for projects

## 2.0.0

### Major Changes
Expand Down
2 changes: 1 addition & 1 deletion plugins/jira-dashboard-backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axis-backstage/plugin-jira-dashboard-backend",
"version": "2.0.0",
"version": "2.1.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
Expand Down
4 changes: 3 additions & 1 deletion plugins/jira-dashboard-backend/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export const getProjectInfo = async (
},
);
if (response.status !== 200) {
throw Error(`${response.status}`);
throw Error(
`Request failed with status code ${response.status}: ${response.statusText}`,
);
}
return response.json();
};
Expand Down
6 changes: 4 additions & 2 deletions plugins/jira-dashboard-backend/src/service/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ export async function createRouter(
config,
cache,
);
} catch (err) {
logger.error(`Could not find Jira project ${projectKey[0]}`);
} catch (err: any) {
logger.error(
`Could not find Jira project ${projectKey[0]}: ${err.message}`,
);
response.status(404).json({
error: `No Jira project found with key ${projectKey[0]}`,
});
Expand Down
4 changes: 3 additions & 1 deletion plugins/jira-dashboard-backend/src/service/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export const getProjectResponse = async (
cache.set(projectKey, projectResponse);
} catch (err: any) {
if (err.message !== 200) {
throw Error(`${err.status}`);
throw Error(
`Failed to get project info for project key ${projectKey} with error: ${err.message}`,
);
}
}
return projectResponse;
Expand Down

0 comments on commit 38e9980

Please sign in to comment.