From 87bc1bbdb881931c334524a4c1694fee667c9c51 Mon Sep 17 00:00:00 2001 From: Gustaf Lundh Date: Thu, 21 Mar 2024 15:27:50 +0100 Subject: [PATCH 1/3] Fix ci-release flow (#98) `changeset publish` calls `npm publish`, which in turns accepts a _release folder as the package to publish. Generate the actual release files using `yarn pack` to ensure the package.json in the npm packages are correct. --- .github/workflows/release.yml | 2 +- .gitignore | 6 +++++- package.json | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ecf6e85f..f00bb47f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/.gitignore b/.gitignore index 589caf47..2d91bedf 100644 --- a/.gitignore +++ b/.gitignore @@ -60,4 +60,8 @@ e2e-test-report/ local_examples/ # No distribution files -**/package.tgz \ No newline at end of file +**/package.tgz + +# no npm _release-folders +**/_release + diff --git a/package.json b/package.json index a64afa49..c7caca69 100644 --- a/package.json +++ b/package.json @@ -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": { From 5bb333096ef66ef2e8002eaf9f41e86f02472c0b Mon Sep 17 00:00:00 2001 From: anicke Date: Thu, 21 Mar 2024 15:34:48 +0100 Subject: [PATCH 2/3] Added function to search for issues using jql (#97) Co-authored-by: Niklas Aronsson --- .changeset/beige-guests-clean.md | 7 ++++ plugins/jira-dashboard-backend/api-report.md | 19 +++++++++ plugins/jira-dashboard-backend/src/api.ts | 44 ++++++++++++++++++++ plugins/jira-dashboard-backend/src/index.ts | 2 + 4 files changed, 72 insertions(+) create mode 100644 .changeset/beige-guests-clean.md diff --git a/.changeset/beige-guests-clean.md b/.changeset/beige-guests-clean.md new file mode 100644 index 00000000..3c174851 --- /dev/null +++ b/.changeset/beige-guests-clean.md @@ -0,0 +1,7 @@ +--- +'@axis-backstage/plugin-jira-dashboard-backend': patch +--- + +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). diff --git a/plugins/jira-dashboard-backend/api-report.md b/plugins/jira-dashboard-backend/api-report.md index 2b5f7440..ec1aa4ec 100644 --- a/plugins/jira-dashboard-backend/api-report.md +++ b/plugins/jira-dashboard-backend/api-report.md @@ -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'; @@ -26,4 +27,22 @@ export interface RouterOptions { logger: Logger; tokenManager: TokenManager; } + +// @public +export const searchJira: ( + config: Config, + jqlQuery: string, + options: SearchOptions, +) => Promise; + +// @public +export type SearchOptions = { + expand?: string[]; + fields?: string[]; + fieldsByKey?: boolean; + properties?: string[]; + startAt?: number; + maxResults?: number; + validateQuery?: string; +}; ``` diff --git a/plugins/jira-dashboard-backend/src/api.ts b/plugins/jira-dashboard-backend/src/api.ts index bc12e763..f46a0f55 100644 --- a/plugins/jira-dashboard-backend/src/api.ts +++ b/plugins/jira-dashboard-backend/src/api.ts @@ -65,6 +65,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 => { + 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, diff --git a/plugins/jira-dashboard-backend/src/index.ts b/plugins/jira-dashboard-backend/src/index.ts index 2cc30147..289e9421 100644 --- a/plugins/jira-dashboard-backend/src/index.ts +++ b/plugins/jira-dashboard-backend/src/index.ts @@ -6,3 +6,5 @@ export * from './service/router'; export { jiraDashboardPlugin as default } from './plugin'; +export { searchJira } from './api'; +export type { SearchOptions } from './api'; From cc32eb925bac4c544aa398d29e0edced640c3264 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 21 Mar 2024 16:05:06 +0100 Subject: [PATCH 3/3] Version Packages (#102) Co-authored-by: github-actions[bot] --- .changeset/beige-guests-clean.md | 7 ------- .changeset/gold-geese-perform.md | 5 ----- packages/app/CHANGELOG.md | 7 +++++++ packages/app/package.json | 2 +- packages/backend/CHANGELOG.md | 8 ++++++++ packages/backend/package.json | 2 +- plugins/jira-dashboard-backend/CHANGELOG.md | 8 ++++++++ plugins/jira-dashboard-backend/package.json | 2 +- plugins/jira-dashboard/CHANGELOG.md | 6 ++++++ plugins/jira-dashboard/package.json | 2 +- 10 files changed, 33 insertions(+), 16 deletions(-) delete mode 100644 .changeset/beige-guests-clean.md delete mode 100644 .changeset/gold-geese-perform.md diff --git a/.changeset/beige-guests-clean.md b/.changeset/beige-guests-clean.md deleted file mode 100644 index 3c174851..00000000 --- a/.changeset/beige-guests-clean.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@axis-backstage/plugin-jira-dashboard-backend': patch ---- - -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). diff --git a/.changeset/gold-geese-perform.md b/.changeset/gold-geese-perform.md deleted file mode 100644 index 0712fd3b..00000000 --- a/.changeset/gold-geese-perform.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@axis-backstage/plugin-jira-dashboard': patch ---- - -Refactor: Update default project lead name from 'key' to 'displayName' for clarity and consistency. diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 19df43aa..c07ad710 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -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 diff --git a/packages/app/package.json b/packages/app/package.json index 711fec0f..332cad9d 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "app", - "version": "0.4.8", + "version": "0.4.9", "private": true, "bundled": true, "backstage": { diff --git a/packages/backend/CHANGELOG.md b/packages/backend/CHANGELOG.md index 42b52d55..71150bbd 100644 --- a/packages/backend/CHANGELOG.md +++ b/packages/backend/CHANGELOG.md @@ -1,5 +1,13 @@ # backend +## 0.3.6 + +### Patch Changes + +- Updated dependencies [5bb3330] + - @axis-backstage/plugin-jira-dashboard-backend@0.7.2 + - app@0.4.9 + ## 0.3.5 ### Patch Changes diff --git a/packages/backend/package.json b/packages/backend/package.json index d0362586..2cdd1a33 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -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, diff --git a/plugins/jira-dashboard-backend/CHANGELOG.md b/plugins/jira-dashboard-backend/CHANGELOG.md index 50839d87..d856977b 100644 --- a/plugins/jira-dashboard-backend/CHANGELOG.md +++ b/plugins/jira-dashboard-backend/CHANGELOG.md @@ -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 diff --git a/plugins/jira-dashboard-backend/package.json b/plugins/jira-dashboard-backend/package.json index 5a5c2a70..0e8e8fdf 100644 --- a/plugins/jira-dashboard-backend/package.json +++ b/plugins/jira-dashboard-backend/package.json @@ -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", diff --git a/plugins/jira-dashboard/CHANGELOG.md b/plugins/jira-dashboard/CHANGELOG.md index ba93d012..611d9722 100644 --- a/plugins/jira-dashboard/CHANGELOG.md +++ b/plugins/jira-dashboard/CHANGELOG.md @@ -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 diff --git a/plugins/jira-dashboard/package.json b/plugins/jira-dashboard/package.json index 4ef2bc39..3fa0e1ce 100644 --- a/plugins/jira-dashboard/package.json +++ b/plugins/jira-dashboard/package.json @@ -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",