Skip to content

Commit

Permalink
Improved error resilience and clarity in handling Jira search operati…
Browse files Browse the repository at this point in the history
…ons by introducing structured TypeScript type definitions and enhancing the searchJira function to return both search results and HTTP status codes

Signed-off-by: enaysaa [email protected]

Introduced TypeScript type definitions SearchJiraResponse and JiraQueryResults to represent Jira search responses and pagination details.
Updated the searchJira function to return search results as a SearchJiraResponse, incorporating the new types.
Enhanced error handling in the searchJira function by handling HTTP response errors and logging them appropriately.
The JiraQueryResults type outlines the structure of a paginated Jira search response, facilitating better data handling.
These changes streamline the Jira Dashboard plugin's codebase, improving error resilience and clarity in handling search operations.
  • Loading branch information
SaachiNayyer committed Oct 30, 2024
1 parent 62d9bf0 commit 73be538
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugins/jira-dashboard-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
"@backstage/plugin-auth-backend": "^0.23.0",
"@backstage/plugin-auth-backend-module-guest-provider": "^0.2.0",
"@types/express": "*",
"@backstage/plugin-auth-backend": "^0.23.0",
"@backstage/plugin-auth-backend-module-guest-provider": "^0.2.0",
"@types/express": "*",
"@types/supertest": "^2.0.12",
"msw": "^1.0.0",
"supertest": "^6.2.4"
Expand Down
1 change: 1 addition & 0 deletions plugins/jira-dashboard-backend/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { ConfigInstance } from './config';
import { jqlQueryBuilder } from './queries';
import { ResponseError } from '@backstage/errors';
import type { JiraProject } from './lib';
import { ResponseError } from '@backstage/errors';

export const getProjectInfo = async (
project: JiraProject,
Expand Down
2 changes: 2 additions & 0 deletions plugins/jira-dashboard-backend/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export const jiraDashboardPlugin = createBackendPlugin({
userInfo: coreServices.userInfo,
},
async init({
auth,
httpRouter,
auth,
httpRouter,
logger,
Expand Down

0 comments on commit 73be538

Please sign in to comment.