Skip to content
Permalink
Browse files

[FIXED JENKINS-27316] Remove excessive stack traces in log

Using an environment variable in an Mercurial Repo parameter filled the error log with excessive stack traces, in spite of the parameter being valid for passing on to child jobs.
  • Loading branch information...
Steve McClellan Steve McClellan
Steve McClellan authored and Steve McClellan committed Jul 27, 2015
1 parent 88c2c0c commit dc23cfe5628492acddd6823534b309efa2ea1b24
@@ -54,13 +54,19 @@ public String getUrlName() {
return "mercurial";
}

static private boolean isUnexpandedEnvVar(String str) {
return str.startsWith("$");
}

static boolean looselyMatches(URI notifyUri, String repository) {
boolean result = false;
try {
URI repositoryUri = new URI(repository);
result = Objects.equal(notifyUri.getHost(), repositoryUri.getHost())
&& Objects.equal(notifyUri.getPath(), repositoryUri.getPath())
&& Objects.equal(notifyUri.getQuery(), repositoryUri.getQuery());
if (!isUnexpandedEnvVar(repository)) {
URI repositoryUri = new URI(repository);
result = Objects.equal(notifyUri.getHost(), repositoryUri.getHost())
&& Objects.equal(notifyUri.getPath(), repositoryUri.getPath())
&& Objects.equal(notifyUri.getQuery(), repositoryUri.getQuery());
}
} catch ( URISyntaxException ex ) {
LOGGER.log(Level.SEVERE, "could not parse repository uri " + repository, ex);
}
@@ -72,6 +72,9 @@
assertTrue( MercurialStatus.looselyMatches(new URI("http://somehost/path"), "ssh://somehost/path") );
assertTrue( MercurialStatus.looselyMatches(new URI("https://somehost/path"), "http://somehost/path") );
assertTrue( MercurialStatus.looselyMatches(new URI("ssh://somehost/path"), "https://somehost/path") );

assertFalse( MercurialStatus.looselyMatches(new URI("http://scm.foocompany.com/hg/foocomponent/"), "${REPO_URL}") );
assertFalse( MercurialStatus.looselyMatches(new URI("http://scm.foocompany.com/hg/foocomponent/"), "$REPO_URL") );
}

}

0 comments on commit dc23cfe

Please sign in to comment.
You can’t perform that action at this time.