From 26bf69cfe741c5800fb6c634563150275448f22d Mon Sep 17 00:00:00 2001 From: chris48s <chris48s@users.noreply.github.com> Date: Wed, 1 Mar 2023 20:24:41 +0000 Subject: [PATCH] misc minor fixes to [githubsize node pypi] (#8946) * fix some params incorrectly marked as optional all of these are really required * make '@' part of the param (not route) for scoped packages * minor HTML tweaks to sonar help --------- Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> --- services/github/github-size.service.js | 2 +- services/node/node-base.js | 12 ++++++------ services/pypi/pypi-base.js | 2 +- services/pypi/pypi-framework-versions.service.js | 2 +- services/sonar/sonar-fortify-rating.service.js | 3 +-- services/sonar/sonar-helpers.js | 5 ++--- services/sonar/sonar-tests.service.js | 3 +-- 7 files changed, 13 insertions(+), 16 deletions(-) diff --git a/services/github/github-size.service.js b/services/github/github-size.service.js index 3dfa6692b1..de2e2bc0a2 100644 --- a/services/github/github-size.service.js +++ b/services/github/github-size.service.js @@ -21,7 +21,7 @@ export default class GithubSize extends GithubAuthV3Service { static route = { base: 'github/size', - pattern: ':user/:repo/:path*', + pattern: ':user/:repo/:path+', queryParamSchema, } diff --git a/services/node/node-base.js b/services/node/node-base.js index 61f049595e..04b0b6375c 100644 --- a/services/node/node-base.js +++ b/services/node/node-base.js @@ -27,8 +27,8 @@ export default class NodeVersionBase extends NPMBase { }, { title: `${prefix} (scoped)`, - pattern: '@:scope/:packageName', - namedParams: { scope: 'stdlib', packageName: 'stdlib' }, + pattern: ':scope/:packageName', + namedParams: { scope: '@stdlib', packageName: 'stdlib' }, staticPreview: this.renderStaticPreview({ nodeVersionRange: '>= 6.0.0', }), @@ -48,8 +48,8 @@ export default class NodeVersionBase extends NPMBase { }, { title: `${prefix} (scoped with tag)`, - pattern: '@:scope/:packageName/:tag', - namedParams: { scope: 'stdlib', packageName: 'stdlib', tag: 'latest' }, + pattern: ':scope/:packageName/:tag', + namedParams: { scope: '@stdlib', packageName: 'stdlib', tag: 'latest' }, staticPreview: this.renderStaticPreview({ nodeVersionRange: '>= 6.0.0', tag: 'latest', @@ -59,8 +59,8 @@ export default class NodeVersionBase extends NPMBase { }, { title: `${prefix} (scoped with tag, custom registry)`, - pattern: '@:scope/:packageName/:tag', - namedParams: { scope: 'stdlib', packageName: 'stdlib', tag: 'latest' }, + pattern: ':scope/:packageName/:tag', + namedParams: { scope: '@stdlib', packageName: 'stdlib', tag: 'latest' }, queryParams: { registry_uri: 'https://registry.npmjs.com' }, staticPreview: this.renderStaticPreview({ nodeVersionRange: '>= 6.0.0', diff --git a/services/pypi/pypi-base.js b/services/pypi/pypi-base.js index 4a3b27a7d1..012af06f49 100644 --- a/services/pypi/pypi-base.js +++ b/services/pypi/pypi-base.js @@ -22,7 +22,7 @@ export default class PypiBase extends BaseJsonService { static buildRoute(base) { return { base, - pattern: ':egg*', + pattern: ':egg+', } } diff --git a/services/pypi/pypi-framework-versions.service.js b/services/pypi/pypi-framework-versions.service.js index 1da6edb1e8..1072fed32f 100644 --- a/services/pypi/pypi-framework-versions.service.js +++ b/services/pypi/pypi-framework-versions.service.js @@ -50,7 +50,7 @@ export default class PypiFrameworkVersion extends PypiBase { base: 'pypi/frameworkversions', pattern: `:frameworkName(${Object.keys(frameworkNameMap).join( '|' - )})/:packageName*`, + )})/:packageName+`, } static examples = [ diff --git a/services/sonar/sonar-fortify-rating.service.js b/services/sonar/sonar-fortify-rating.service.js index 96ca325b60..bc2e220ee8 100644 --- a/services/sonar/sonar-fortify-rating.service.js +++ b/services/sonar/sonar-fortify-rating.service.js @@ -31,8 +31,7 @@ export default class SonarFortifyRating extends SonarBase { }, staticPreview: this.render({ rating: 4 }), keywords, - documentation: ` - <p> + documentation: `<p> Note that the Fortify Security Rating badge will only work on Sonar instances that have the <a href='https://marketplace.microfocus.com/fortify/content/fortify-sonarqube-plugin'>Fortify SonarQube Plugin</a> installed. The badge is not available for projects analyzed on SonarCloud.io </p> diff --git a/services/sonar/sonar-helpers.js b/services/sonar/sonar-helpers.js index c5e49b2728..f27da1125d 100644 --- a/services/sonar/sonar-helpers.js +++ b/services/sonar/sonar-helpers.js @@ -47,15 +47,14 @@ const queryParamWithFormatSchema = Joi.object({ }).required() const keywords = ['sonarcloud', 'sonarqube'] -const documentation = ` - <p> +const documentation = `<p> The Sonar badges will work with both SonarCloud.io and self-hosted SonarQube instances. Just enter the correct protocol and path for your target Sonar deployment. </p> <p> If you are targeting a legacy SonarQube instance that is version 5.3 or earlier, then be sure to include the version query parameter with the value of your SonarQube version. - </p + </p> ` export { diff --git a/services/sonar/sonar-tests.service.js b/services/sonar/sonar-tests.service.js index 7408a2e337..90b5adbc1a 100644 --- a/services/sonar/sonar-tests.service.js +++ b/services/sonar/sonar-tests.service.js @@ -43,8 +43,7 @@ class SonarTestsSummary extends SonarBase { isCompact: false, }), keywords, - documentation: ` - ${documentation} + documentation: `${documentation} ${testResultsDocumentation} `, }, -- GitLab