Skip to content

Commit

Permalink
Merge pull request #81 from jenkinsci/ValidateCxUrlOrigin_and_Jenkins…
Browse files Browse the repository at this point in the history
…_URL_length

Fix Bug 252489: [Jenkins] - Failed with error CxUrlOrigin more than15…
  • Loading branch information
SubhadraSahoo authored Dec 16, 2021
2 parents 63b6093 + c6dfb08 commit 33f8711
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ dependencies {
exclude group: 'org.apache.logging.log4j', module: 'log4j-core'
}

compile 'com.checkmarx:cx-client-common:2021.4.6',
compile 'com.checkmarx:cx-client-common:2021.4.9',
'com.fasterxml.jackson.core:jackson-core:2.11.3',
'com.fasterxml.jackson.core:jackson-annotations:2.11.3',
'com.fasterxml.jackson.core:jackson-databind:2.11.3',
'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.11.3',
'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.10.5',
'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.10.5',
'org.apache.logging.log4j:log4j-slf4j-impl:2.13.3',
'org.apache.logging.log4j:log4j-api:2.13.3',
'org.apache.logging.log4j:log4j-core:2.13.3'
'org.apache.logging.log4j:log4j-slf4j-impl:2.16.0',
'org.apache.logging.log4j:log4j-api:2.16.0',
'org.apache.logging.log4j:log4j-core:2.16.0'
constraints {
implementation('io.vertx:vertx-web:3.9.7') {
because 'previous versions have a bug impacting this application'
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
description = Provides automatic scan of code by Checkmarx server and shows results summary and trend in Jenkins interface.
group = com.checkmarx.jenkins
version = 2021.4.2
version = 2021.4.3

repositoryVersion=

Expand Down
12 changes: 7 additions & 5 deletions src/main/java/com/checkmarx/jenkins/CxScanBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -1247,9 +1247,12 @@ private String getJenkinURLForTheJob(EnvVars env) {
passedURL = "Jenkins " + hostName + " " + jobName;
// 50 is the maximum number of characters allowed by SAST server
if (passedURL.length() > 50)
passedURL = passedURL.substring(0, 50);
{
passedURL = passedURL.substring(0, 45);
passedURL = passedURL + "...";}
else
passedURL = passedURL;
{
passedURL = passedURL;}
} catch (UnsupportedEncodingException e) {
log.error("Failed to get Jenkins URL of the JOB: " + e.getMessage());
}
Expand All @@ -1261,6 +1264,8 @@ private String getCxOriginUrl(EnvVars env, CxLoggerAdapter log) {
String jenURL = env.get("JENKINS_URL");
String jobName = env.get("JOB_NAME");
String originUrl = jenURL + "job/" + jobName;
if (originUrl.length() > 120){ originUrl = originUrl.substring(0, 115) + "...";}
else{ originUrl = originUrl;}
return originUrl;
}

Expand Down Expand Up @@ -2351,7 +2356,6 @@ public FormValidation doCheckScaSASTProjectID(@QueryParameter String value, @Que
* This method verify correct format for Custom Fields
*
* @param value
* @param scaSASTProjectFullPath
* @return
*/
@POST
Expand All @@ -2370,7 +2374,6 @@ public FormValidation doCheckCustomFields(@QueryParameter String value) {
* This method verify if force scan is checked
*
* @param value
* @param scaSASTProjectFullPath
* @return
*/
@POST
Expand All @@ -2387,7 +2390,6 @@ public FormValidation doCheckForceScan(@QueryParameter boolean value, @QueryPara
* This method verifies if force scan and incremental scan both configured
*
* @param value
* @param scaSASTProjectFullPath
* @return
*/
@POST
Expand Down

0 comments on commit 33f8711

Please sign in to comment.