in src/main/java/com/cisco/gerrit/plugins/slack/config/ProjectConfig.java [65:159]
public ProjectConfig(PluginConfigFactory configFactory, String project) {
enabled = false;
Project.NameKey projectNameKey;
projectNameKey = Project.NameKey.parse(project);
try {
enabled =
configFactory
.getFromProjectConfigWithInheritance(projectNameKey, CONFIG_NAME)
.getBoolean("enabled", false);
webhookUrl =
configFactory
.getFromProjectConfigWithInheritance(projectNameKey, CONFIG_NAME)
.getString("webhookurl", "");
channel =
configFactory
.getFromProjectConfigWithInheritance(projectNameKey, CONFIG_NAME)
.getString("channel", "general");
username =
configFactory
.getFromProjectConfigWithInheritance(projectNameKey, CONFIG_NAME)
.getString("username", "gerrit");
ignore =
configFactory
.getFromProjectConfigWithInheritance(projectNameKey, CONFIG_NAME)
.getString("ignore", "");
ignoreUnchangedPatchSet =
configFactory
.getFromProjectConfigWithInheritance(projectNameKey, CONFIG_NAME)
.getBoolean("ignore-unchanged-patch-set", true);
ignoreWorkInProgressPatchSet =
configFactory
.getFromProjectConfigWithInheritance(projectNameKey, CONFIG_NAME)
.getBoolean("ignore-wip-patch-set", true);
ignorePrivatePatchSet =
configFactory
.getFromProjectConfigWithInheritance(projectNameKey, CONFIG_NAME)
.getBoolean("ignore-private-patch-set", true);
ignoreCommentAuthor =
configFactory
.getFromProjectConfigWithInheritance(projectNameKey, CONFIG_NAME)
.getString("ignore-comment-author", "");
publishOnPatchSetCreated =
configFactory
.getFromProjectConfigWithInheritance(projectNameKey, CONFIG_NAME)
.getBoolean("publish-on-patch-set-created", true);
publishOnChangeMerged =
configFactory
.getFromProjectConfigWithInheritance(projectNameKey, CONFIG_NAME)
.getBoolean("publish-on-change-merged", true);
publishOnCommentAdded =
configFactory
.getFromProjectConfigWithInheritance(projectNameKey, CONFIG_NAME)
.getBoolean("publish-on-comment-added", true);
publishOnReviewerAdded =
configFactory
.getFromProjectConfigWithInheritance(projectNameKey, CONFIG_NAME)
.getBoolean("publish-on-reviewer-added", true);
publishOnWipReady =
configFactory
.getFromProjectConfigWithInheritance(projectNameKey, CONFIG_NAME)
.getBoolean("publish-on-wip-ready", publishOnPatchSetCreated);
publishOnPrivateToPublic =
configFactory
.getFromProjectConfigWithInheritance(projectNameKey, CONFIG_NAME)
.getBoolean("publish-on-private-to-public", publishOnPatchSetCreated);
proxyHost = configFactory.getFromGerritConfig(CONFIG_NAME).getString("proxy-host", null);
proxyPort = configFactory.getFromGerritConfig(CONFIG_NAME).getInt("proxy-port", 8080);
proxyUsername =
configFactory.getFromGerritConfig(CONFIG_NAME).getString("proxy-username", null);
proxyPassword =
configFactory.getFromGerritConfig(CONFIG_NAME).getString("proxy-password", null);
} catch (NoSuchProjectException e) {
LOGGER.warn("The specified project could not be found: " + project);
}
}