diff --git a/lib/workers/repository/__fixtures__/master-issue_with_2_PR_closed_ignored.txt b/lib/workers/repository/__fixtures__/master-issue_with_2_PR_closed_ignored.txt index fcf12bce59e5941947da502f145864435c849850..fffe0e2d907a91ba7fec766d9a2015da69d63f44 100644 --- a/lib/workers/repository/__fixtures__/master-issue_with_2_PR_closed_ignored.txt +++ b/lib/workers/repository/__fixtures__/master-issue_with_2_PR_closed_ignored.txt @@ -11,4 +11,3 @@ These are blocked by an existing closed PR and will not be recreated unless you None detected - diff --git a/lib/workers/repository/__fixtures__/master-issue_with_2_PR_edited.txt b/lib/workers/repository/__fixtures__/master-issue_with_2_PR_edited.txt index c1dd60e3ffac289192c1f27c9547507ac0faa21e..cd67feae860b758fcc7c2ad19e08321abe6eb767 100644 --- a/lib/workers/repository/__fixtures__/master-issue_with_2_PR_edited.txt +++ b/lib/workers/repository/__fixtures__/master-issue_with_2_PR_edited.txt @@ -11,4 +11,3 @@ These updates have been manually edited so Renovate will no longer make changes. None detected - diff --git a/lib/workers/repository/__fixtures__/master-issue_with_3_PR_in_approval.txt b/lib/workers/repository/__fixtures__/master-issue_with_3_PR_in_approval.txt index 3c6275a9c6434ccc60bf6fea6427778791d3abaa..a5cf0fb1f3bb3968918ccf493011ddaa3783dae0 100644 --- a/lib/workers/repository/__fixtures__/master-issue_with_3_PR_in_approval.txt +++ b/lib/workers/repository/__fixtures__/master-issue_with_3_PR_in_approval.txt @@ -18,4 +18,3 @@ These updates await pending status checks. To force their creation now, click th None detected - diff --git a/lib/workers/repository/__fixtures__/master-issue_with_3_PR_in_progress.txt b/lib/workers/repository/__fixtures__/master-issue_with_3_PR_in_progress.txt index e403823a1ece65834101ae441497b6bbfd7e0e32..54d0c07cfd7f53d7aaebb459f78f46fe18a05f82 100644 --- a/lib/workers/repository/__fixtures__/master-issue_with_3_PR_in_progress.txt +++ b/lib/workers/repository/__fixtures__/master-issue_with_3_PR_in_progress.txt @@ -13,4 +13,3 @@ These updates have all been created already. Click a checkbox below to force a r None detected - diff --git a/lib/workers/repository/__fixtures__/master-issue_with_8_PR.txt b/lib/workers/repository/__fixtures__/master-issue_with_8_PR.txt index c34516c0d3acc282c021a0be5e132f6e24998293..297cb29a672cd7910083b7ca7e8f0e8b4e3cf126 100644 --- a/lib/workers/repository/__fixtures__/master-issue_with_8_PR.txt +++ b/lib/workers/repository/__fixtures__/master-issue_with_8_PR.txt @@ -38,4 +38,3 @@ These updates await pending status checks before automerging. Click on a checkbo None detected - diff --git a/lib/workers/repository/__snapshots__/dependency-dashboard.spec.ts.snap b/lib/workers/repository/__snapshots__/dependency-dashboard.spec.ts.snap index cfd52ab4d7b300afb1dff53d0dc33ba7a9555bf2..0b9db9fe45078f8c4fa6802f48f2511be6475102 100644 --- a/lib/workers/repository/__snapshots__/dependency-dashboard.spec.ts.snap +++ b/lib/workers/repository/__snapshots__/dependency-dashboard.spec.ts.snap @@ -7,21 +7,25 @@ This repository currently has no open or pending branches. ## Detected dependencies -<details><summary>Branch main -</summary> +<details><summary>Branch main</summary> +<blockquote> +<details><summary>dockerfile</summary> +<blockquote> -<ul><details><summary>dockerfile</summary> - -<ul><details><summary>Dockerfile</summary> +<details><summary>Dockerfile</summary> - \`ubuntu 20.04\` -</details></ul> -</details></ul> -<ul><details><summary>npm</summary> +</details> + +</blockquote> +</details> + +<details><summary>npm</summary> +<blockquote> -<ul><details><summary>package.json</summary> +<details><summary>package.json</summary> - \`cookie-parser ^1.4.5\` - \`express ~4.17.1\` @@ -32,33 +36,45 @@ This repository currently has no open or pending branches. - \`dotenv 10.0.0\` - \`nodemon 2.0.14\` -</details></ul> -</details></ul> -<ul><details><summary>poetry</summary> +</details> + +</blockquote> +</details> + +<details><summary>poetry</summary> +<blockquote> -<ul><details><summary>pyproject.toml</summary> +<details><summary>pyproject.toml</summary> - \`six <=1.3.0\` -</details></ul> -</details></ul> </details> -<details><summary>Branch dev -</summary> +</blockquote> +</details> +</blockquote> +</details> -<ul><details><summary>dockerfile</summary> +<details><summary>Branch dev</summary> +<blockquote> -<ul><details><summary>Dockerfile</summary> +<details><summary>dockerfile</summary> +<blockquote> + +<details><summary>Dockerfile</summary> - \`ubuntu 20.04\` -</details></ul> -</details></ul> -<ul><details><summary>npm</summary> +</details> -<ul><details><summary>package.json</summary> +</blockquote> +</details> + +<details><summary>npm</summary> +<blockquote> + +<details><summary>package.json</summary> - \`cookie-parser ^1.4.5\` - \`express ~4.17.1\` @@ -69,16 +85,24 @@ This repository currently has no open or pending branches. - \`dotenv 10.0.0\` - \`nodemon 2.0.14\` -</details></ul> -</details></ul> -<ul><details><summary>poetry</summary> +</details> + +</blockquote> +</details> + +<details><summary>poetry</summary> +<blockquote> -<ul><details><summary>pyproject.toml</summary> +<details><summary>pyproject.toml</summary> - \`six <=1.3.0\` -</details></ul> -</details></ul> +</details> + +</blockquote> +</details> + +</blockquote> </details> " @@ -91,29 +115,33 @@ This repository currently has no open or pending branches. ## Detected dependencies -<details><summary>Branch main -</summary> +<details><summary>Branch main</summary> +<blockquote> None detected - +</blockquote> </details> -<details><summary>Branch dev -</summary> +<details><summary>Branch dev</summary> +<blockquote> +<details><summary>dockerfile</summary> +<blockquote> -<ul><details><summary>dockerfile</summary> - -<ul><details><summary>Dockerfile</summary> +<details><summary>Dockerfile</summary> - \`ubuntu 20.04\` -</details></ul> -</details></ul> -<ul><details><summary>npm</summary> +</details> + +</blockquote> +</details> -<ul><details><summary>package.json</summary> +<details><summary>npm</summary> +<blockquote> + +<details><summary>package.json</summary> - \`cookie-parser ^1.4.5\` - \`express ~4.17.1\` @@ -124,16 +152,24 @@ None detected - \`dotenv 10.0.0\` - \`nodemon 2.0.14\` -</details></ul> -</details></ul> -<ul><details><summary>poetry</summary> +</details> -<ul><details><summary>pyproject.toml</summary> +</blockquote> +</details> + +<details><summary>poetry</summary> +<blockquote> + +<details><summary>pyproject.toml</summary> - \`six <=1.3.0\` -</details></ul> -</details></ul> +</details> + +</blockquote> +</details> + +</blockquote> </details> " @@ -146,29 +182,33 @@ This repository currently has no open or pending branches. ## Detected dependencies -<details><summary>Branch main -</summary> +<details><summary>Branch main</summary> +<blockquote> None detected - +</blockquote> </details> -<details><summary>Branch dev -</summary> - +<details><summary>Branch dev</summary> +<blockquote> -<ul><details><summary>dockerfile</summary> +<details><summary>dockerfile</summary> +<blockquote> -<ul><details><summary>Dockerfile</summary> +<details><summary>Dockerfile</summary> - \`ubuntu 20.04\` -</details></ul> -</details></ul> -<ul><details><summary>npm</summary> +</details> + +</blockquote> +</details> + +<details><summary>npm</summary> +<blockquote> -<ul><details><summary>package.json</summary> +<details><summary>package.json</summary> - \`cookie-parser ^1.4.5\` - \`express ~4.17.1\` @@ -179,16 +219,24 @@ None detected - \`dotenv 10.0.0\` - \`nodemon 2.0.14\` -</details></ul> -</details></ul> -<ul><details><summary>poetry</summary> +</details> + +</blockquote> +</details> -<ul><details><summary>pyproject.toml</summary> +<details><summary>poetry</summary> +<blockquote> + +<details><summary>pyproject.toml</summary> - \`six <=1.3.0\` -</details></ul> -</details></ul> +</details> + +</blockquote> +</details> + +</blockquote> </details> " @@ -202,15 +250,21 @@ This repository currently has no open or pending branches. ## Detected dependencies <details><summary>dockerfile</summary> +<blockquote> -<ul><details><summary>Dockerfile</summary> +<details><summary>Dockerfile</summary> - \`ubuntu 20.04\` -</details></ul> -</details><details><summary>npm</summary> +</details> -<ul><details><summary>package.json</summary> +</blockquote> +</details> + +<details><summary>npm</summary> +<blockquote> + +<details><summary>package.json</summary> - \`cookie-parser ^1.4.5\` - \`express ~4.17.1\` @@ -221,15 +275,24 @@ This repository currently has no open or pending branches. - \`dotenv 10.0.0\` - \`nodemon 2.0.14\` -</details></ul> -</details><details><summary>poetry</summary> +</details> -<ul><details><summary>pyproject.toml</summary> +</blockquote> +</details> + +<details><summary>poetry</summary> +<blockquote> + +<details><summary>pyproject.toml</summary> - \`six <=1.3.0\` -</details></ul> -</details>" +</details> + +</blockquote> +</details> + +" `; exports[`workers/repository/dependency-dashboard ensureDependencyDashboard() checks detected dependencies section single base branch repo show default message in issues body when packageFiles is empty 1`] = ` @@ -241,7 +304,6 @@ This repository currently has no open or pending branches. None detected - " `; @@ -254,7 +316,6 @@ This repository currently has no open or pending branches. None detected - " `; @@ -281,7 +342,6 @@ These updates await pending status checks. To force their creation now, click th None detected - " `; @@ -294,7 +354,6 @@ This repository currently has no open or pending branches. None detected - --- And this is a footer " @@ -309,7 +368,6 @@ This repository currently has no open or pending branches. None detected - --- And this is a footer for repository:test " @@ -335,6 +393,5 @@ These updates are awaiting their schedule. Click on a checkbox to get an update None detected - " `; diff --git a/lib/workers/repository/dependency-dashboard.ts b/lib/workers/repository/dependency-dashboard.ts index 634b91eb98ab05c726c79d187bc4497a7275bf01..3c2fbcef165013e1e611ba9fc28d410c9fd9c86d 100644 --- a/lib/workers/repository/dependency-dashboard.ts +++ b/lib/workers/repository/dependency-dashboard.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import is from '@sindresorhus/is'; import { nameFromLevel } from 'bunyan'; import { GlobalConfig } from '../../config/global'; @@ -21,7 +22,7 @@ function parseDashboardIssue(issueBody: string): DependencyDashboard { if (checked?.length) { const re = regEx(checkMatch); checked.forEach((check) => { - const [, type, branchName] = re.exec(check); + const [, type, branchName] = re.exec(check)!; dependencyDashboardChecks[branchName] = type; }); } @@ -48,7 +49,7 @@ export async function readDashboardBody(config: RenovateConfig): Promise<void> { const issue = await platform.findIssue(config.dependencyDashboardTitle); if (issue) { config.dependencyDashboardIssue = issue.number; - Object.assign(config, parseDashboardIssue(issue.body)); + Object.assign(config, parseDashboardIssue(issue.body!)); } } } @@ -125,7 +126,7 @@ export async function ensureDependencyDashboard( ); } else { logger.debug('Closing Dependency Dashboard'); - await platform.ensureIssueClosing(config.dependencyDashboardTitle); + await platform.ensureIssueClosing(config.dependencyDashboardTitle!); } return; } @@ -144,7 +145,7 @@ export async function ensureDependencyDashboard( ); } else { logger.debug('Closing Dependency Dashboard'); - await platform.ensureIssueClosing(config.dependencyDashboardTitle); + await platform.ensureIssueClosing(config.dependencyDashboardTitle!); } return; } @@ -266,7 +267,7 @@ export async function ensureDependencyDashboard( ]; let inProgress = branches.filter( (branch) => - !otherRes.includes(branch.result) && + !otherRes.includes(branch.result!) && branch.prBlockedBy !== 'BranchAutomerge' ); const otherBranches = inProgress.filter( @@ -333,9 +334,9 @@ export async function ensureDependencyDashboard( ); if (updatedIssue) { const { dependencyDashboardChecks } = parseDashboardIssue( - updatedIssue.body + updatedIssue.body! ); - for (const branchName of Object.keys(config.dependencyDashboardChecks)) { + for (const branchName of Object.keys(config.dependencyDashboardChecks!)) { delete dependencyDashboardChecks[branchName]; } for (const branchName of Object.keys(dependencyDashboardChecks)) { @@ -355,7 +356,7 @@ export async function ensureDependencyDashboard( ); } else { await platform.ensureIssue({ - title: config.dependencyDashboardTitle, + title: config.dependencyDashboardTitle!, reuseTitle, body: issueBody, labels: config.dependencyDashboardLabels, diff --git a/lib/workers/repository/package-files.ts b/lib/workers/repository/package-files.ts index e16abdbcc41a90eb09e4de93838e4c09f741a064..c86553a830fe8ca9020b7420cfaeacdea5fc8336 100644 --- a/lib/workers/repository/package-files.ts +++ b/lib/workers/repository/package-files.ts @@ -31,34 +31,33 @@ export class PackageFiles { let deps = ''; for (const [branch, packageFiles] of this.data) { - deps += pad ? `<details><summary>Branch ${branch}\n</summary>\n\n` : ''; + deps += pad + ? `<details><summary>Branch ${branch}</summary>\n<blockquote>\n\n` + : ''; if (packageFiles === null) { deps += none; - deps += pad ? '\n</details>\n\n' : '\n'; + deps += pad ? '</blockquote>\n</details>\n\n' : ''; continue; } const managers = Object.keys(packageFiles); if (managers.length === 0) { deps += none; - deps += pad ? '\n</details>\n\n' : '\n'; + deps += pad ? '</blockquote>\n</details>\n\n' : ''; continue; } - for (const manager of managers) { - deps += `${ - pad ? '\n<ul>' : '' - }<details><summary>${manager}</summary>\n\n`; + deps += `<details><summary>${manager}</summary>\n<blockquote>\n\n`; for (const packageFile of packageFiles[manager]) { - deps += `<ul><details><summary>${packageFile.packageFile}</summary>\n\n`; + deps += `<details><summary>${packageFile.packageFile}</summary>\n\n`; for (const dep of packageFile.deps) { deps += ` - \`${dep.depName} ${dep.currentValue}\`\n`; } - deps += '\n</details></ul>'; + deps += '\n</details>\n\n'; } - deps += `\n</details>${pad ? '</ul>' : ''}`; + deps += `</blockquote>\n</details>\n\n`; } - deps += pad ? '\n</details>\n\n' : ''; + deps += pad ? '</blockquote>\n</details>\n\n' : ''; } return title + deps; diff --git a/tsconfig.strict.json b/tsconfig.strict.json index 22c7ecca3af373b30b496d10d3257ff1c6702aef..3e42df22a682c5c414ecc823f37a0ffe7e6c1321 100644 --- a/tsconfig.strict.json +++ b/tsconfig.strict.json @@ -32,7 +32,6 @@ "lib/workers/global/initialize.ts", "lib/workers/repository/cache.ts", "lib/workers/repository/changelog/index.ts", - "lib/workers/repository/dependency-dashboard.ts", "lib/workers/repository/error-config.ts", "lib/workers/repository/error.ts", "lib/workers/repository/extract/file-match.ts",