Skip to content

Commit

Permalink
Merge branch 'main' into pluginImprovements
Browse files Browse the repository at this point in the history
  • Loading branch information
SaachiNayyer authored Mar 21, 2024
2 parents 7384a0d + cc32eb9 commit 8bd73d7
Show file tree
Hide file tree
Showing 15 changed files with 107 additions and 12 deletions.
5 changes: 0 additions & 5 deletions .changeset/gold-geese-perform.md

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
id: changesets
uses: changesets/action@v1
with:
publish: yarn github-release
publish: yarn publish:github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,8 @@ e2e-test-report/
local_examples/

# No distribution files
**/package.tgz
**/package.tgz

# no npm _release-folders
**/_release

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@
"fix": "backstage-cli repo fix",
"lint": "backstage-cli repo lint --since origin/main",
"lint:all": "backstage-cli repo lint",
"pack": "yarn workspaces foreach -A -v pack",
"prettier:check": "prettier --check .",
"prettier:fix": "prettier --write .",
"release": "changeset version && yarn prettier --write '{packages,plugins}/*/package.json' && yarn install --no-immutable",
"github-release": "yarn tsc && yarn build:all && yarn workspaces foreach -A -v pack && changeset publish",
"publish:prepare": "yarn workspaces foreach -A pack && yarn workspaces foreach -A exec \"rm -rf _release && mkdir _release && tar zxvf package.tgz --directory _release && rm package.tgz\"",
"publish:github": "yarn tsc && yarn build:all && yarn publish:prepare && changeset publish",
"new": "backstage-cli new --scope internal"
},
"workspaces": {
Expand Down
7 changes: 7 additions & 0 deletions packages/app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# app

## 0.4.9

### Patch Changes

- Updated dependencies [c108b55]
- @axis-backstage/plugin-jira-dashboard@0.7.3

## 0.4.8

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "app",
"version": "0.4.8",
"version": "0.4.9",
"private": true,
"bundled": true,
"backstage": {
Expand Down
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.6

### Patch Changes

- Updated dependencies [5bb3330]
- @axis-backstage/plugin-jira-dashboard-backend@0.7.2
- [email protected]

## 0.3.5

### 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.5",
"version": "0.3.6",
"main": "dist/index.cjs.js",
"types": "src/index.ts",
"private": true,
Expand Down
8 changes: 8 additions & 0 deletions plugins/jira-dashboard-backend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @axis-backstage/plugin-jira-dashboard-backend

## 0.7.2

### Patch Changes

- 5bb3330: Added and exported a function `searchJira` that searches for Jira issues using
JQL. This can be used outside this plugin to search for issues. For more information about the available options see the API documentation at
[issue search](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-search/#api-rest-api-2-search-post).

## 0.7.1

### Patch Changes
Expand Down
19 changes: 19 additions & 0 deletions plugins/jira-dashboard-backend/api-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Config } from '@backstage/config';
import { DiscoveryApi } from '@backstage/plugin-permission-common';
import express from 'express';
import { IdentityApi } from '@backstage/plugin-auth-node';
import { Issue } from '@axis-backstage/plugin-jira-dashboard-common';
import { Logger } from 'winston';
import { TokenManager } from '@backstage/backend-common';

Expand All @@ -26,4 +27,22 @@ export interface RouterOptions {
logger: Logger;
tokenManager: TokenManager;
}

// @public
export const searchJira: (
config: Config,
jqlQuery: string,
options: SearchOptions,
) => Promise<Issue[]>;

// @public
export type SearchOptions = {
expand?: string[];
fields?: string[];
fieldsByKey?: boolean;
properties?: string[];
startAt?: number;
maxResults?: number;
validateQuery?: string;
};
```
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": "0.7.1",
"version": "0.7.2",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
Expand Down
44 changes: 44 additions & 0 deletions plugins/jira-dashboard-backend/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,50 @@ export const getIssuesByFilter = async (
return response.issues;
};

/**
* Options available for the Jira JQL query.
*
* @public
*/
export type SearchOptions = {
expand?: string[];
fields?: string[];
fieldsByKey?: boolean;
properties?: string[];
startAt?: number;
maxResults?: number;
validateQuery?: string;
};

/**
* Search for Jira issues using JQL.
*
* For more information about the available options see the API
* documentation at:
* https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-search/#api-rest-api-2-search-post
*
* @param config - A Backstage config
* @param jqlQuery - A string containing the jql query.
* @param options - Query options that will be passed on to the POST request.
*
* @public
*/
export const searchJira = async (
config: Config,
jqlQuery: string,
options: SearchOptions,
): Promise<Issue[]> => {
const response = await fetch(`${resolveJiraBaseUrl(config)}search`, {
method: 'POST',
body: JSON.stringify({ jql: jqlQuery, ...options }),
headers: {
Authorization: resolveJiraToken(config),
Accept: 'application/json',
},
}).then(resp => resp.json());
return response.issues;
};

export const getIssuesByComponent = async (
projectKey: string,
componentKey: string,
Expand Down
2 changes: 2 additions & 0 deletions plugins/jira-dashboard-backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@

export * from './service/router';
export { jiraDashboardPlugin as default } from './plugin';
export { searchJira } from './api';
export type { SearchOptions } from './api';
6 changes: 6 additions & 0 deletions plugins/jira-dashboard/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @axis-backstage/plugin-jira-dashboard

## 0.7.3

### Patch Changes

- c108b55: Refactor: Update default project lead name from 'key' to 'displayName' for clarity and consistency.

## 0.7.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion plugins/jira-dashboard/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axis-backstage/plugin-jira-dashboard",
"version": "0.7.2",
"version": "0.7.3",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
Expand Down

0 comments on commit 8bd73d7

Please sign in to comment.