From 9d61362e787fd23b84620c2cbdda6dc2274b46e3 Mon Sep 17 00:00:00 2001 From: Jeffry Hesse <5544326+DarthHater@users.noreply.github.com> Date: Fri, 12 Feb 2021 09:05:53 -0900 Subject: [PATCH 1/2] Splittttt --- ext-src/packages/pypi/PyPiUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext-src/packages/pypi/PyPiUtils.ts b/ext-src/packages/pypi/PyPiUtils.ts index 092ff3e6..ba7f92af 100644 --- a/ext-src/packages/pypi/PyPiUtils.ts +++ b/ext-src/packages/pypi/PyPiUtils.ts @@ -45,7 +45,7 @@ export class PyPiUtils { console.debug("Found comment, skipping"); } else { // remove any conditionals after semicolon, split result to get package and version - const dependencyParts: string[] = dep.split(";")[0].trim().split("=="); + const dependencyParts: string[] = dep.split(";")[0].trim().split(/==|~=/); if (!dependencyParts || dependencyParts.length != 2) { // Short circuit, we couldn't split, move on to next one return; From 7da6e64b63ae1aa5e604d6d18e7892937dcaa0af Mon Sep 17 00:00:00 2001 From: Artemie Jurgenson <37317224+ButterB0wl@users.noreply.github.com> Date: Fri, 12 Feb 2021 13:19:03 -0500 Subject: [PATCH 2/2] Iq trailing slash part 2 electric boogalo (#184) * fix: handled case where trailing slash is in the IQ endpoint setting leading to an invalid report url * put it up top in the constructor * changed string casting in iq component model constructor and joined report url using the URL object --- ext-src/models/IqComponentModel.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ext-src/models/IqComponentModel.ts b/ext-src/models/IqComponentModel.ts index bd92b23f..dde11bfb 100644 --- a/ext-src/models/IqComponentModel.ts +++ b/ext-src/models/IqComponentModel.ts @@ -49,13 +49,13 @@ export class IqComponentModel implements ComponentModel { constructor( options: ComponentModelOptions ) { - this.applicationPublicId = options.configuration.get(NEXUS_IQ_PUBLIC_APPLICATION_ID) + ""; - // remove trailing slash if it exists - this.url = String(options.configuration.get(NEXUS_IQ_SERVER_URL)).replace(/\/$/, ""); - const username = options.configuration.get(NEXUS_IQ_USERNAME) + ""; + this.applicationPublicId = options.configuration.get(NEXUS_IQ_PUBLIC_APPLICATION_ID) as string; + this.url = options.configuration.get(NEXUS_IQ_SERVER_URL) as string; + const username = options.configuration.get(NEXUS_IQ_USERNAME) as string; + // this one is converted rather than cast as string const maximumEvaluationPollAttempts = parseInt( - options.configuration.get(NEXUS_IQ_MAX_EVAL_POLL_ATTEMPTS) + "", 10); - const password = options.configuration.get(NEXUS_IQ_USER_PASSWORD) + ""; + String(options.configuration.get(NEXUS_IQ_MAX_EVAL_POLL_ATTEMPTS)), 10); + const password = options.configuration.get(NEXUS_IQ_USER_PASSWORD) as string; const strictSSL = options.configuration.get(NEXUS_IQ_STRICT_SSL) as boolean; this.requestService = new IqRequestService(this.url, username, password, maximumEvaluationPollAttempts, strictSSL, options.logger); @@ -181,7 +181,7 @@ export class IqComponentModel implements ComponentModel { resolve(); }).then(() => { if (!this.reportUrl.startsWith(this.url)) { - this.reportUrl = `${this.url}/${this.reportUrl}`; + this.reportUrl = new URL(this.reportUrl, this.url).href } window.showInformationMessage(`Nexus IQ Server Results in, build with confidence!\n Report available at: ${this.reportUrl}`);