Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lemon-pears-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@alauda/doom": patch
---

fix: throw on jira request errors
8 changes: 4 additions & 4 deletions packages/doom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"dependencies": {
"@alauda/doom-export": "^0.1.0",
"@cspell/eslint-plugin": "^8.19.4 || ^9.2.0",
"@eslint-react/eslint-plugin": "^1.52.7",
"@eslint-react/eslint-plugin": "^1.52.9",
"@inquirer/prompts": "^7.8.4",
"@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0",
"@playwright/browser-chromium": "^1.55.0",
Expand All @@ -55,7 +55,7 @@
"@rspress/plugin-llms": "2.0.0-beta.29",
"@rspress/plugin-sitemap": "2.0.0-beta.29",
"@rspress/shared": "2.0.0-beta.29",
"@shikijs/transformers": "^3.12.0",
"@shikijs/transformers": "^3.12.1",
"@total-typescript/ts-reset": "^0.6.1",
"ab64": "^0.1.6",
"chokidar": "^4.0.3",
Expand Down Expand Up @@ -93,10 +93,10 @@
"remark-lint-no-chinese-punctuation-in-number": "^0.1.2",
"remark-lint-no-duplicate-headings-in-section": "^4.0.1",
"remark-lint-no-hidden-table-cell": "^1.0.1",
"remark-mdx": "^3.1.0",
"remark-mdx": "^3.1.1",
"remark-message-control": "^8.0.0",
"remark-stringify": "^11.0.0",
"shiki": "^3.12.0",
"shiki": "^3.12.1",
"simple-git": "^3.28.0",
"string-width": "^7.2.0",
"swagger2openapi": "^7.0.8",
Expand Down
11 changes: 8 additions & 3 deletions packages/doom/src/plugins/replace/resolve-release.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { logger } from '@rspress/core'
import { isProduction } from '@rspress/shared'
import { render } from 'ejs'
import type {
List,
Expand All @@ -11,7 +12,6 @@ import { ResponseError, xfetch } from 'x-fetch'
import { cyan, red } from 'yoctocolors'

import type { JiraIssue, JiraLanguage } from './types.js'
import { isCI } from './utils.js'

const releaseCache = new Map<
string,
Expand Down Expand Up @@ -106,7 +106,7 @@ const resolveRelease_ = async (
}
warned = true
const message = `\`${cyan('JIRA_USERNAME')}\` and \`${cyan('JIRA_PASSWORD')}\` environments must be set for fetching Jira issues`
if (isCI) {
if (isProduction()) {
throw new Error(message)
}
logger.warn(message)
Expand All @@ -124,7 +124,9 @@ const resolveRelease_ = async (

const jql = await render(template, data, { async: true })

logger.info(`Fetching release notes for query \`${cyan(releaseQuery)}\``)
logger.info(
`Fetching release notes for query \`${cyan(releaseQuery)}\`, JQL: \`${cyan(jql)}\``,
)

let issues: JiraIssue[]

Expand All @@ -140,6 +142,9 @@ const resolveRelease_ = async (
`Failed to fetch release notes for query \`${red(releaseQuery)}\` with status \`${error.response.status}\` and ${error.data ? `data ${JSON.stringify(error.data, null, 2)}` : `message \`${error.message}\``}`,
)
}
if (isProduction()) {
throw err
}
return
}

Expand Down
Loading
Loading