-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable injection when custom extensions are detected #398
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a bit convoluted now, but in order to simplify it, we need to rewrite the way injection is done in general.
Good work otherwise 👍
public FormValidation doCheckCcudExtensionCustomCoordinates(@QueryParameter String value) { | ||
String coord = Util.fixEmptyAndTrim(value); | ||
return coord == null || MavenCoordinates.isValid(coord) ? FormValidation.ok() : FormValidation.error(Messages.InjectionConfig_InvalidMavenExtensionCustomCoordinates()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we can extract the logic of both of these methods into a private method and reuse it
|
||
static boolean isUnix(Computer computer) { | ||
return computer == null || Boolean.TRUE.equals(computer.isUnix()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also make this class final and add private constructor
public final class SystemProperty { | ||
|
||
private final Key key; | ||
private final String value; | ||
private static final Pattern SysPropPattern = Pattern.compile("-D(.*)=(.*)"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd pull it to the top of the class and adjsut the name to SYS_PROP_PATTERN to stick to the convention
Follow up of #393
This PR adds 2 new fields to the Develocity Maven injection:
Those are used in case built projects have defined custom Develocity derived extensions:
.mvn/extensions
of the currently built project..mvn/extensions
of the currently built project.It's a bit complex in terms of implementation since we need to parse the existing
MAVEN_OPTS
looking for the maven ext classpath system property, and filter it accordingly.We might want to revisit this since it looks like the
ScmListener
we use is called in many cases, even when no Scm is configured...Testing done
Unit tests and a few integration tests. Some cases cannot easily be setup as integration tests since they would require "real" custom Develocity extensions.
I also tested manually the 2 cases:
Submitter checklist