code
stringlengths
23
201k
docstring
stringlengths
17
96.2k
func_name
stringlengths
0
235
language
stringclasses
1 value
repo
stringlengths
8
72
path
stringlengths
11
317
url
stringlengths
57
377
license
stringclasses
7 values
public boolean isSuccessful() { return errors.isEmpty(); }
Checks if result of the validation is successful based on the size of error container @return if error container is empty returns true, else returns false
isSuccessful
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/validation/ValidationResult.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/validation/ValidationResult.java
Apache-2.0
public List<ValidationError> getErrors() { return new ArrayList<>(errors); }
Gets list of errors for container @return list of errors for container
getErrors
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/validation/ValidationResult.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/validation/ValidationResult.java
Apache-2.0
public List<String> getMessages() { List<String> errorMessages = new ArrayList<>(); for (ValidationError error : errors) { errorMessages.add(error.getMessage()); } return errorMessages; }
Collects error message string as list from all the errors in the container @return error message as list of string
getMessages
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/validation/ValidationResult.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/response/validation/ValidationResult.java
Apache-2.0
public TaskConfigProperty addProperty(String propertyName) { TaskConfigProperty property = new TaskConfigProperty(propertyName); add(property); return property; }
Adds a property to the configuration of this task. @param propertyName Name of the property (or key) in the configuration. @return an instance of {@link TaskConfigProperty}
addProperty
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/task/TaskConfig.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/task/TaskConfig.java
Apache-2.0
public String getValue(String propertyName) { Property property = super.get(propertyName); if (property == null) { return null; } return property.getValue(); }
Retrieves the value of a property. @param propertyName Name of the property (or key) in the configuration. @return the value of the specified property, or null if not found.
getValue
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/task/TaskConfig.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/task/TaskConfig.java
Apache-2.0
@Override public List<? extends Property> list() { List<TaskConfigProperty> list = new ArrayList<>(); for (Property property : super.list()) { list.add((TaskConfigProperty) property); } Collections.sort(list); return list; }
Retrieves the value of a property. @param propertyName Name of the property (or key) in the configuration. @return the value of the specified property, or null if not found.
list
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/task/TaskConfig.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/task/TaskConfig.java
Apache-2.0
private void updateDefaults() { with(REQUIRED, false); with(SECURE, false); with(DISPLAY_NAME, getKey()); with(DISPLAY_ORDER, 0); }
Specialization of {@link Property} class, for task configuration.
updateDefaults
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/task/TaskConfigProperty.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/task/TaskConfigProperty.java
Apache-2.0
@Override public int compareTo(TaskConfigProperty o) { return this.getOption(DISPLAY_ORDER) - o.getOption(DISPLAY_ORDER); }
Specialization of {@link Property} class, for task configuration.
compareTo
java
gocd/gocd
plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/task/TaskConfigProperty.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api-internal/src/main/java/com/thoughtworks/go/plugin/api/task/TaskConfigProperty.java
Apache-2.0
public Map<String, T> getExamples() { Map<String, T> examples = new HashMap<>(); this.addGoodExamples(examples); this.addBadExamples(examples); return examples; }
Gets collection of example instances. Key is name of example to identify it during tests.
getExamples
java
gocd/gocd
plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
Apache-2.0
public Map<String, T> getGoodExamples() { Map<String, T> examples = new HashMap<>(); this.addGoodExamples(examples); return examples; }
Gets collection of good example instances. Key is name of example to identify it during tests.
getGoodExamples
java
gocd/gocd
plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
Apache-2.0
public Map<String, T> getBadExamples() { Map<String, T> examples = new HashMap<>(); this.addBadExamples(examples); return examples; }
Gets collection of bad example instances. Key is name of example to identify it during tests.
getBadExamples
java
gocd/gocd
plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
Apache-2.0
@Test public void shouldHaveEqualsImplementedForTests() { //just try equality of each example with other for (Map.Entry<String, T> right : getExamples().entrySet()) { for (Map.Entry<String, T> left : getExamples().entrySet()) { if (left.getValue() == right.getValue()) { ...
Gets collection of bad example instances. Key is name of example to identify it during tests.
shouldHaveEqualsImplementedForTests
java
gocd/gocd
plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
Apache-2.0
@Test public void shouldSerializeToJson() { Map<String, T> examples = getExamples(); for (Map.Entry<String, T> example : examples.entrySet()) { String exampleName = example.getKey(); T value = example.getValue(); String json = gson.toJson(value); if (p...
Gets collection of bad example instances. Key is name of example to identify it during tests.
shouldSerializeToJson
java
gocd/gocd
plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
Apache-2.0
@Test public void shouldReturnLocation() { Map<String, T> examples = getExamples(); for (Map.Entry<String, T> example : examples.entrySet()) { String exampleName = example.getKey(); T value = example.getValue(); String location = value.getLocation("TEST_PARENT"); ...
Gets collection of bad example instances. Key is name of example to identify it during tests.
shouldReturnLocation
java
gocd/gocd
plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
Apache-2.0
@Test public void shouldIgnoreWhenJsonHasUnknownElements() { Map<String, T> examples = getExamples(); for (Map.Entry<String, T> example : examples.entrySet()) { T value = example.getValue(); JsonObject jsonObject = (JsonObject) gson.toJsonTree(value); jsonObject.a...
Gets collection of bad example instances. Key is name of example to identify it during tests.
shouldIgnoreWhenJsonHasUnknownElements
java
gocd/gocd
plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
Apache-2.0
@Test public void shouldSerializeToJsonAndDeserialize() { Map<String, T> examples = getExamples(); for (Map.Entry<String, T> example : examples.entrySet()) { T value = example.getValue(); String json = gson.toJson(value); @SuppressWarnings("unchecked") T deserial...
Gets collection of bad example instances. Key is name of example to identify it during tests.
shouldSerializeToJsonAndDeserialize
java
gocd/gocd
plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
Apache-2.0
@Test public void shouldGetErrorsWhenDeserializedFromEmptyBlock() { String json = "{}"; Class<? extends CRBase> typeOfT = null; for (T example : getGoodExamples().values()) { typeOfT = example.getClass(); break; } @SuppressWarnings("unchecked") T des...
Gets collection of bad example instances. Key is name of example to identify it during tests.
shouldGetErrorsWhenDeserializedFromEmptyBlock
java
gocd/gocd
plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
Apache-2.0
@Test public void shouldThrowWhenJsonFormatIsInvalid() { Map<String, T> examples = getExamples(); for (Map.Entry<String, T> example : examples.entrySet()) { T value = example.getValue(); String json = gson.toJson(value); json += "some extra non-json content"; ...
Gets collection of bad example instances. Key is name of example to identify it during tests.
shouldThrowWhenJsonFormatIsInvalid
java
gocd/gocd
plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
Apache-2.0
@Test public void shouldErrorWhenBadExample() { Map<String, T> examples = getBadExamples(); for (Map.Entry<String, T> example : examples.entrySet()) { ErrorCollection errorCollection = new ErrorCollection(); example.getValue().getErrors(errorCollection, "ErrorWhenBadExampleTe...
Gets collection of bad example instances. Key is name of example to identify it during tests.
shouldErrorWhenBadExample
java
gocd/gocd
plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
Apache-2.0
@Test public void shouldNotErrorWhenGoodExample() { Map<String, T> examples = getGoodExamples(); for (Map.Entry<String, T> example : examples.entrySet()) { ErrorCollection errorCollection = new ErrorCollection(); example.getValue().getErrors(errorCollection, "NotErrorWhenGood...
Gets collection of bad example instances. Key is name of example to identify it during tests.
shouldNotErrorWhenGoodExample
java
gocd/gocd
plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-config-repo/src/test/java/com/thoughtworks/go/plugin/configrepo/contract/AbstractCRTest.java
Apache-2.0
public List<String> extensionNames() { return stream().map(PluginInfo::getExtensionName).collect(toList()); }
Since a single plugin can have multiple extensions, this combines multiple plugin info objects into one, representing a full plugin.
extensionNames
java
gocd/gocd
plugin-infra/go-plugin-domain/src/main/java/com/thoughtworks/go/plugin/domain/common/CombinedPluginInfo.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-domain/src/main/java/com/thoughtworks/go/plugin/domain/common/CombinedPluginInfo.java
Apache-2.0
public PluginDescriptor getDescriptor() { Iterator<PluginInfo> iterator = this.iterator(); if (!iterator.hasNext()) { throw new RuntimeException("Cannot get descriptor. Could not find any plugin information."); } return iterator.next().getDescriptor(); }
Since a single plugin can have multiple extensions, this combines multiple plugin info objects into one, representing a full plugin.
getDescriptor
java
gocd/gocd
plugin-infra/go-plugin-domain/src/main/java/com/thoughtworks/go/plugin/domain/common/CombinedPluginInfo.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-domain/src/main/java/com/thoughtworks/go/plugin/domain/common/CombinedPluginInfo.java
Apache-2.0
public List<PluginInfo> getExtensionInfos() { return new ArrayList<>(this); }
Since a single plugin can have multiple extensions, this combines multiple plugin info objects into one, representing a full plugin.
getExtensionInfos
java
gocd/gocd
plugin-infra/go-plugin-domain/src/main/java/com/thoughtworks/go/plugin/domain/common/CombinedPluginInfo.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-domain/src/main/java/com/thoughtworks/go/plugin/domain/common/CombinedPluginInfo.java
Apache-2.0
public PluginInfo extensionFor(String extensionName) { return stream().filter(pluginInfo -> extensionName.equals(pluginInfo.getExtensionName())).findFirst().orElse(null); }
Since a single plugin can have multiple extensions, this combines multiple plugin info objects into one, representing a full plugin.
extensionFor
java
gocd/gocd
plugin-infra/go-plugin-domain/src/main/java/com/thoughtworks/go/plugin/domain/common/CombinedPluginInfo.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-domain/src/main/java/com/thoughtworks/go/plugin/domain/common/CombinedPluginInfo.java
Apache-2.0
public Image getImage() { for (PluginInfo extensionInfo : this) { Image image = extensionInfo.getImage(); if (image != null) { return image; } } return null; }
Since a single plugin can have multiple extensions, this combines multiple plugin info objects into one, representing a full plugin.
getImage
java
gocd/gocd
plugin-infra/go-plugin-domain/src/main/java/com/thoughtworks/go/plugin/domain/common/CombinedPluginInfo.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-domain/src/main/java/com/thoughtworks/go/plugin/domain/common/CombinedPluginInfo.java
Apache-2.0
public PluginPostLoadHook addPluginPostLoadHook(PluginPostLoadHook pluginPostLoadHook) { pluginPostLoadHooks.add(pluginPostLoadHook); return pluginPostLoadHook; }
This knows what needs to be done when a plugin is loaded (and unloaded).
addPluginPostLoadHook
java
gocd/gocd
plugin-infra/go-plugin-infra/src/main/java/com/thoughtworks/go/plugin/infra/PluginLoader.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-infra/src/main/java/com/thoughtworks/go/plugin/infra/PluginLoader.java
Apache-2.0
public void loadPlugin(GoPluginBundleDescriptor descriptor) { try { pluginOSGiFramework.loadPlugin(descriptor); if (descriptor.isInvalid()) { handlePluginInvalidation(descriptor, descriptor.bundleLocation()); return; } doPostBundl...
This knows what needs to be done when a plugin is loaded (and unloaded).
loadPlugin
java
gocd/gocd
plugin-infra/go-plugin-infra/src/main/java/com/thoughtworks/go/plugin/infra/PluginLoader.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-infra/src/main/java/com/thoughtworks/go/plugin/infra/PluginLoader.java
Apache-2.0
public void unloadPlugin(GoPluginBundleDescriptor descriptorOfRemovedPlugin) { Bundle bundle = descriptorOfRemovedPlugin.bundle(); if (bundle == null) { return; } for (GoPluginDescriptor pluginDescriptor : descriptorOfRemovedPlugin.descriptors()) { for (PluginCha...
This knows what needs to be done when a plugin is loaded (and unloaded).
unloadPlugin
java
gocd/gocd
plugin-infra/go-plugin-infra/src/main/java/com/thoughtworks/go/plugin/infra/PluginLoader.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-infra/src/main/java/com/thoughtworks/go/plugin/infra/PluginLoader.java
Apache-2.0
private void doPostBundleInstallActivities(GoPluginBundleDescriptor pluginBundleDescriptor) { for (GoPluginDescriptor pluginDescriptor : pluginBundleDescriptor.descriptors()) { for (PluginPostLoadHook pluginPostLoadHook : pluginPostLoadHooks) { final PluginPostLoadHook.Result result ...
This knows what needs to be done when a plugin is loaded (and unloaded).
doPostBundleInstallActivities
java
gocd/gocd
plugin-infra/go-plugin-infra/src/main/java/com/thoughtworks/go/plugin/infra/PluginLoader.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-infra/src/main/java/com/thoughtworks/go/plugin/infra/PluginLoader.java
Apache-2.0
private void handlePluginInvalidation(GoPluginBundleDescriptor bundleDescriptor, File bundleLocation) { String failureMsg = format("Failed to load plugin: %s. Plugin is invalid. Reasons %s", bundleLocation, bundleDescriptor.getMessages()); LOGGER.error(failureMsg); unloadPlugin(b...
This knows what needs to be done when a plugin is loaded (and unloaded).
handlePluginInvalidation
java
gocd/gocd
plugin-infra/go-plugin-infra/src/main/java/com/thoughtworks/go/plugin/infra/PluginLoader.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-infra/src/main/java/com/thoughtworks/go/plugin/infra/PluginLoader.java
Apache-2.0
public boolean isAFailure() { return isAFailure; }
A hook which runs after plugin load, and before listeners are called. Has the power to stop loading the plugin and marking it invalid.
isAFailure
java
gocd/gocd
plugin-infra/go-plugin-infra/src/main/java/com/thoughtworks/go/plugin/infra/PluginPostLoadHook.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-infra/src/main/java/com/thoughtworks/go/plugin/infra/PluginPostLoadHook.java
Apache-2.0
public String getMessage() { return message; }
A hook which runs after plugin load, and before listeners are called. Has the power to stop loading the plugin and marking it invalid.
getMessage
java
gocd/gocd
plugin-infra/go-plugin-infra/src/main/java/com/thoughtworks/go/plugin/infra/PluginPostLoadHook.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-infra/src/main/java/com/thoughtworks/go/plugin/infra/PluginPostLoadHook.java
Apache-2.0
@Override public Extension marshal(String v) { Extension extension = new Extension(); extension.className = v; return extension; }
Not used, but included for completeness
marshal
java
gocd/gocd
plugin-infra/go-plugin-infra/src/main/java/com/thoughtworks/go/plugin/infra/plugininfo/GoPluginDescriptor.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-infra/src/main/java/com/thoughtworks/go/plugin/infra/plugininfo/GoPluginDescriptor.java
Apache-2.0
@Override public String marshal(String v) { return unmarshal(v); }
Not used, but included for completeness
marshal
java
gocd/gocd
plugin-infra/go-plugin-infra/src/main/java/com/thoughtworks/go/plugin/infra/plugininfo/TrimStringAdapter.java
https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-infra/src/main/java/com/thoughtworks/go/plugin/infra/plugininfo/TrimStringAdapter.java
Apache-2.0
public String getExtension() { return extension; }
Gets extension name @return Extension name
getExtension
java
gocd/gocd
plugin-infra/plugins/error-generating-descriptor-aware-test-plugin/src/com/thoughtworks/go/plugin/api/GoPluginIdentifier.java
https://github.com/gocd/gocd/blob/master/plugin-infra/plugins/error-generating-descriptor-aware-test-plugin/src/com/thoughtworks/go/plugin/api/GoPluginIdentifier.java
Apache-2.0
public List<String> getSupportedExtensionVersions() { return supportedExtensionVersions; }
Gets list of supported extension versions @return List of supported extension versions
getSupportedExtensionVersions
java
gocd/gocd
plugin-infra/plugins/error-generating-descriptor-aware-test-plugin/src/com/thoughtworks/go/plugin/api/GoPluginIdentifier.java
https://github.com/gocd/gocd/blob/master/plugin-infra/plugins/error-generating-descriptor-aware-test-plugin/src/com/thoughtworks/go/plugin/api/GoPluginIdentifier.java
Apache-2.0
public static List<ConfigErrors> validate(CruiseConfig config) { return new ArrayList<>(config.validateAfterPreprocess()); }
Understands when to reload the config file or other config source
validate
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
Apache-2.0
@TestOnly public void throwExceptionIfExists() { if (lastException != null) { throw bomb("Invalid config file", lastException); } }
Understands when to reload the config file or other config source
throwExceptionIfExists
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
Apache-2.0
public void onTimer() { if (maintenanceModeService.isMaintenanceMode()) { LOGGER.debug("[Maintenance Mode] GoCD server is in 'maintenance' mode, skip loading cruise-config.xml"); return; } this.forceReload(); }
Understands when to reload the config file or other config source
onTimer
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
Apache-2.0
public void forceReload() { LOGGER.debug("Config file (on disk) update check is in queue"); synchronized (GoConfigWriteLock.class) { LOGGER.debug("Config file (on disk) update check is in progress"); try { GoConfigHolder configHolder = dataSource.load(); ...
Understands when to reload the config file or other config source
forceReload
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
Apache-2.0
private synchronized void saveConfigError(Exception e) { this.lastException = e; ServerHealthState state = ServerHealthState.error(INVALID_CRUISE_CONFIG_XML, e.getMessage(), HealthStateType.invalidConfig()); serverHealthService.update(state); }
Understands when to reload the config file or other config source
saveConfigError
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
Apache-2.0
public CruiseConfig loadForEditing() { loadConfigIfNull(); return currentConfigForEdit; }
Understands when to reload the config file or other config source
loadForEditing
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
Apache-2.0
public CruiseConfig loadMergedForEditing() { loadConfigIfNull(); if (mergedCurrentConfigForEdit == null) { // when there are no partials, just return standard config for edit return currentConfigForEdit; } return mergedCurrentConfigForEdit; }
Understands when to reload the config file or other config source
loadMergedForEditing
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
Apache-2.0
public CruiseConfig currentConfig() { if (currentConfig == null) { currentConfig = new BasicCruiseConfig(); } return currentConfig; }
Understands when to reload the config file or other config source
currentConfig
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
Apache-2.0
public void loadConfigIfNull() { if (currentConfig == null || currentConfigForEdit == null || configHolder == null || (mergedCurrentConfigForEdit == null && !cachedGoPartials.lastValidPartials().isEmpty())) { forceReload(); } }
Understands when to reload the config file or other config source
loadConfigIfNull
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
Apache-2.0
public synchronized ConfigSaveState writeFullConfigWithLock(FullConfigUpdateCommand updateConfigCommand) { GoFileConfigDataSource.GoConfigSaveResult saveResult = dataSource.writeFullConfigWithLock(updateConfigCommand, this.configHolder); saveValidConfigToCacheAndNotifyConfigChangeListeners(saveResult.ge...
Understands when to reload the config file or other config source
writeFullConfigWithLock
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
Apache-2.0
public synchronized void upgradeConfig() { GoConfigHolder goConfigHolder = goConfigMigrator.migrate(); saveValidConfigToCacheAndNotifyConfigChangeListeners(goConfigHolder); }
Understands when to reload the config file or other config source
upgradeConfig
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
Apache-2.0
public synchronized ConfigSaveState writeWithLock(UpdateConfigCommand updateConfigCommand) { GoFileConfigDataSource.GoConfigSaveResult saveResult = dataSource.writeWithLock(updateConfigCommand, this.configHolder); saveValidConfigToCacheAndNotifyConfigChangeListeners(saveResult.getConfigHolder()); ...
Understands when to reload the config file or other config source
writeWithLock
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
Apache-2.0
public synchronized void writeEntityWithLock(EntityConfigUpdateCommand<?> updateConfigCommand, Username currentUser) { EntityConfigSaveResult<?> entityConfigSaveResult = dataSource.writeEntityWithLock(updateConfigCommand, this.configHolder, currentUser); saveValidConfigToCacheAndNotifyEntityConfigChange...
Understands when to reload the config file or other config source
writeEntityWithLock
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
Apache-2.0
@SuppressWarnings("unchecked") private <T> void saveValidConfigToCacheAndNotifyEntityConfigChangeListeners(EntityConfigSaveResult<T> saveResult) { saveValidConfigToCache(saveResult.getConfigHolder()); LOGGER.info("About to notify {} config listeners", saveResult.getEntityConfig().getClass().getName(...
Understands when to reload the config file or other config source
saveValidConfigToCacheAndNotifyEntityConfigChangeListeners
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
Apache-2.0
private synchronized void saveValidConfigToCache(GoConfigHolder configHolder) { if (configHolder != null) { LOGGER.debug("[Config Save] Saving config to the cache"); this.lastException = null; this.configHolder = configHolder; this.currentConfig = this.configHolde...
Understands when to reload the config file or other config source
saveValidConfigToCache
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
Apache-2.0
private synchronized void saveValidConfigToCacheAndNotifyConfigChangeListeners(GoConfigHolder configHolder) { saveValidConfigToCache(configHolder); if (configHolder != null) { notifyListeners(currentConfig); } }
Understands when to reload the config file or other config source
saveValidConfigToCacheAndNotifyConfigChangeListeners
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
Apache-2.0
public String getFileLocation() { return dataSource.getFileLocation(); }
Understands when to reload the config file or other config source
getFileLocation
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
Apache-2.0
public GoConfigValidity checkConfigFileValid() { Exception ex = lastException; if (ex != null) { return GoConfigValidity.invalid(ex.getMessage()); } return GoConfigValidity.valid(); }
Understands when to reload the config file or other config source
checkConfigFileValid
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
Apache-2.0
public synchronized void registerListener(ConfigChangedListener listener) { this.listeners.add(listener); if (currentConfig != null) { listener.onConfigChange(currentConfig); } }
Understands when to reload the config file or other config source
registerListener
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
Apache-2.0
private synchronized void notifyListeners(CruiseConfig newCruiseConfig) { LOGGER.info("About to notify config listeners"); for (ConfigChangedListener listener : listeners) { try { listener.onConfigChange(newCruiseConfig); } catch (Exception e) { LO...
Understands when to reload the config file or other config source
notifyListeners
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
Apache-2.0
@TestOnly public synchronized void clearListeners() { listeners.clear(); }
Understands when to reload the config file or other config source
clearListeners
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
Apache-2.0
@TestOnly public void reloadListeners() { notifyListeners(currentConfig()); }
Understands when to reload the config file or other config source
reloadListeners
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
Apache-2.0
public GoConfigHolder loadConfigHolder() { return configHolder; }
Understands when to reload the config file or other config source
loadConfigHolder
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/CachedGoConfig.java
Apache-2.0
public PartialConfig toPartialConfig(CRParseResult crPartialConfig, PartialConfigLoadContext context) { SCMs newSCMs = new SCMs(); PartialConfig partialConfig = new PartialConfig(); for (CREnvironment crEnvironment : crPartialConfig.getEnvironments()) { EnvironmentConfig environment ...
Helper to transform config repo classes to config-api classes
toPartialConfig
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
private void validatePartialConfigEnvironments(PartialConfig partialConfig) { HashSet<String> uniqueAgentUuids = new HashSet<>(agentService.getAllRegisteredAgentUUIDs()); partialConfig.getEnvironments().forEach(environmentConfig -> environmentConfig.validateContainsAgentUUIDsFrom(uniqueAgentUuids)); ...
Helper to transform config repo classes to config-api classes
validatePartialConfigEnvironments
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
public Map<String, List<CRPipeline>> groupPipelinesByGroupName(Collection<CRPipeline> pipelines) { Map<String, List<CRPipeline>> map = new HashMap<>(); for (CRPipeline pipe : pipelines) { String key = pipe.getGroup(); map.computeIfAbsent(key, k -> new ArrayList<>()).add(pipe); ...
Helper to transform config repo classes to config-api classes
groupPipelinesByGroupName
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
public BasicPipelineConfigs toBasicPipelineConfigs(Map.Entry<String, List<CRPipeline>> crPipelineGroup, PartialConfigLoadContext context, SCMs newSCMs) { String name = crPipelineGroup.getKey(); BasicPipelineConfigs pipelineConfigs = new BasicPipelineConfigs(); pipelineConfigs.setGroup(name); ...
Helper to transform config repo classes to config-api classes
toBasicPipelineConfigs
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
public BasicEnvironmentConfig toEnvironmentConfig(CREnvironment crEnvironment) { BasicEnvironmentConfig basicEnvironmentConfig = new BasicEnvironmentConfig(new CaseInsensitiveString(crEnvironment.getName())); for (String pipeline : crEnvironment.getPipelines()) { basicEnviron...
Helper to transform config repo classes to config-api classes
toEnvironmentConfig
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
public EnvironmentVariableConfig toEnvironmentVariableConfig(CREnvironmentVariable crEnvironmentVariable) { if (crEnvironmentVariable.hasEncryptedValue()) { // encrypted value is not null or empty string return new EnvironmentVariableConfig(cipher, crEnvironmentVariable.getName(), crEnvi...
Helper to transform config repo classes to config-api classes
toEnvironmentVariableConfig
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
public PluggableTask toPluggableTask(CRPluggableTask pluggableTask) { PluginConfiguration pluginConfiguration = toPluginConfiguration(pluggableTask.getPluginConfiguration()); Configuration configuration = toConfiguration(pluggableTask.getConfiguration()); PluggableTask task = new PluggableTask(p...
Helper to transform config repo classes to config-api classes
toPluggableTask
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
private void setCommonTaskMembers(AbstractTask task, CRTask crTask) { CRTask crTaskOnCancel = crTask.getOnCancel(); if (crTaskOnCancel != null) task.setCancelTask(toAbstractTask(crTaskOnCancel)); task.runIfConfigs = toRunIfConfigs(crTask.getRunIf()); }
Helper to transform config repo classes to config-api classes
setCommonTaskMembers
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
private RunIfConfigs toRunIfConfigs(CRRunIf runIf) { if (runIf == null) return new RunIfConfigs(RunIfConfig.PASSED); return switch (runIf) { case any -> new RunIfConfigs(RunIfConfig.ANY); case passed -> new RunIfConfigs(RunIfConfig.PASSED); case failed ->...
Helper to transform config repo classes to config-api classes
toRunIfConfigs
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
public AbstractTask toAbstractTask(CRTask crTask) { if (crTask == null) throw new ConfigConvertionException("task cannot be null"); if (crTask instanceof CRPluggableTask) { return toPluggableTask((CRPluggableTask) crTask); } else if (crTask instanceof CRBuildTask) { ...
Helper to transform config repo classes to config-api classes
toAbstractTask
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
public FetchPluggableArtifactTask toFetchPluggableArtifactTask(CRFetchPluggableArtifactTask crTask) { Configuration configuration = toConfiguration(crTask.getConfiguration()); FetchPluggableArtifactTask fetchPluggableArtifactTask = new FetchPluggableArtifactTask(new CaseInsensitiveString(crTask.getPipel...
Helper to transform config repo classes to config-api classes
toFetchPluggableArtifactTask
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
public FetchTask toFetchTask(CRFetchArtifactTask crTask) { FetchTask fetchTask = new FetchTask( new CaseInsensitiveString(crTask.getPipeline() == null ? "" : crTask.getPipeline()), new CaseInsensitiveString(crTask.getStage()), new CaseInsensitiveString(crTask.getJ...
Helper to transform config repo classes to config-api classes
toFetchTask
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
public ExecTask toExecTask(CRExecTask crTask) { ExecTask execTask = new ExecTask(crTask.getCommand(), toArgList(crTask.getArguments()), crTask.getWorkingDirectory()); execTask.setTimeout(crTask.getTimeout()); setCommonTaskMembers(execTask, crTask); return execTask; }
Helper to transform config repo classes to config-api classes
toExecTask
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
private Arguments toArgList(List<String> args) { Arguments arguments = new Arguments(); if (args != null) for (String arg : args) { arguments.add(new Argument(arg)); } return arguments; }
Helper to transform config repo classes to config-api classes
toArgList
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
public BuildTask toBuildTask(CRBuildTask crBuildTask) { BuildTask buildTask = switch (crBuildTask.getType()) { case rake -> new RakeTask(); case ant -> new AntTask(); case nant -> { NantTask nantTask = new NantTask(); nantTask.setNantPath(((CRN...
Helper to transform config repo classes to config-api classes
toBuildTask
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
private void setCommonBuildTaskMembers(BuildTask buildTask, CRBuildTask crBuildTask) { buildTask.buildFile = crBuildTask.getBuildFile(); buildTask.target = crBuildTask.getTarget(); buildTask.workingDirectory = crBuildTask.getWorkingDirectory(); }
Helper to transform config repo classes to config-api classes
setCommonBuildTaskMembers
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
private Configuration toConfiguration(Collection<CRConfigurationProperty> properties) { Configuration configuration = new Configuration(); if (properties != null) { for (CRConfigurationProperty p : properties) { if (p.getValue() != null) configuration.addN...
Helper to transform config repo classes to config-api classes
toConfiguration
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
public PluginConfiguration toPluginConfiguration(CRPluginConfiguration pluginConfiguration) { return new PluginConfiguration(pluginConfiguration.getId(), pluginConfiguration.getVersion()); }
Helper to transform config repo classes to config-api classes
toPluginConfiguration
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
public DependencyMaterialConfig toDependencyMaterialConfig(CRDependencyMaterial crDependencyMaterial) { DependencyMaterialConfig dependencyMaterialConfig = new DependencyMaterialConfig( new CaseInsensitiveString(crDependencyMaterial.getPipeline()), new CaseInsensitiveString(crDep...
Helper to transform config repo classes to config-api classes
toDependencyMaterialConfig
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
public MaterialConfig toMaterialConfig(CRMaterial crMaterial, PartialConfigLoadContext context, SCMs newSCMs) { if (crMaterial == null) throw new ConfigConvertionException("material cannot be null"); if (crMaterial instanceof CRDependencyMaterial) return toDependencyMaterialConf...
Helper to transform config repo classes to config-api classes
toMaterialConfig
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
private void setDestination(MaterialConfig repoMaterial, String destination) { if (repoMaterial instanceof ScmMaterialConfig) { ((ScmMaterialConfig) repoMaterial).setFolder(destination); } else if (repoMaterial instanceof PluggableSCMMaterialConfig) { ((PluggableSCMMaterialConfig...
Helper to transform config repo classes to config-api classes
setDestination
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
public PackageMaterialConfig toPackageMaterial(CRPackageMaterial crPackageMaterial) { PackageDefinition packageDefinition = getPackageDefinition(crPackageMaterial.getPackageId()); return new PackageMaterialConfig(toMaterialName(crPackageMaterial.getName()), crPackageMaterial.getPackageId(), packageDefin...
Helper to transform config repo classes to config-api classes
toPackageMaterial
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
private PackageDefinition getPackageDefinition(String packageId) { PackageRepository packageRepositoryHaving = this.cachedGoConfig.currentConfig().getPackageRepositories().findPackageRepositoryHaving(packageId); if (packageRepositoryHaving == null) throw new ConfigConvertionException( ...
Helper to transform config repo classes to config-api classes
getPackageDefinition
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
private PluggableSCMMaterialConfig toPluggableScmMaterialConfig(CRPluggableScmMaterial crPluggableScmMaterial, PartialConfigLoadContext context, SCMs newSCMs) { CRPluginConfiguration pluginConfig = crPluggableScmMaterial.getPluginConfiguration(); SCM scmConfig; if (pluginConfig == null) { ...
Helper to transform config repo classes to config-api classes
toPluggableScmMaterialConfig
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
private SCMs existingServerSCMs() { return this.cachedGoConfig.currentConfig().getSCMs(); }
Helper to transform config repo classes to config-api classes
existingServerSCMs
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
private ScmMaterialConfig toScmMaterialConfig(CRScmMaterial crScmMaterial) { if (crScmMaterial instanceof CRGitMaterial git) { String gitBranch = git.getBranch(); if (StringUtils.isBlank(gitBranch)) gitBranch = GitMaterialConfig.DEFAULT_BRANCH; GitMaterialConf...
Helper to transform config repo classes to config-api classes
toScmMaterialConfig
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
private CaseInsensitiveString toMaterialName(String materialName) { if (StringUtils.isBlank(materialName)) return null; return new CaseInsensitiveString(materialName); }
Helper to transform config repo classes to config-api classes
toMaterialName
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
private void setCommonScmMaterialMembers(ScmMaterialConfig scmMaterialConfig, CRScmMaterial crScmMaterial) { scmMaterialConfig.setFolder(crScmMaterial.getDestination()); scmMaterialConfig.setAutoUpdate(crScmMaterial.isAutoUpdate()); scmMaterialConfig.setFilter(toFilter(crScmMaterial)); s...
Helper to transform config repo classes to config-api classes
setCommonScmMaterialMembers
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
private Filter toFilter(CRScmMaterial crScmMaterial) { List<String> filterList = crScmMaterial.getFilterList(); return toFilter(filterList); }
Helper to transform config repo classes to config-api classes
toFilter
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
private Filter toFilter(List<String> filterList) { Filter filter = new Filter(); if (filterList == null) return filter; for (String pattern : filterList) { filter.add(new IgnoredFiles(pattern)); } return filter; }
Helper to transform config repo classes to config-api classes
toFilter
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
public JobConfig toJobConfig(CRJob crJob) { JobConfig jobConfig = new JobConfig(crJob.getName()); if (crJob.getEnvironmentVariables() != null) for (CREnvironmentVariable crEnvironmentVariable : crJob.getEnvironmentVariables()) { jobConfig.getVariables().add(toEnvironmentVaria...
Helper to transform config repo classes to config-api classes
toJobConfig
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
public ArtifactTypeConfig toArtifactConfig(CRArtifact crArtifact) { switch (crArtifact.getType()) { case build: CRBuiltInArtifact crBuildArtifact = (CRBuiltInArtifact) crArtifact; return new BuildArtifactConfig(crBuildArtifact.getSource(), crBuildArtifact.getDestinati...
Helper to transform config repo classes to config-api classes
toArtifactConfig
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
private Tab toTab(CRTab crTab) { return new Tab(crTab.getName(), crTab.getPath()); }
Helper to transform config repo classes to config-api classes
toTab
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
public StageConfig toStage(CRStage crStage) { Approval approval = toApproval(crStage.getApproval()); StageConfig stageConfig = new StageConfig(new CaseInsensitiveString(crStage.getName()), crStage.isFetchMaterials(), crStage.isCleanWorkingDirectory(), approval, crStage.isNeverCleanupArti...
Helper to transform config repo classes to config-api classes
toStage
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
public Approval toApproval(CRApproval crApproval) { if (crApproval == null) return Approval.automaticApproval(); Approval approval; if (crApproval.getType() == CRApprovalCondition.manual) approval = Approval.manualApproval(); else approval = Approval....
Helper to transform config repo classes to config-api classes
toApproval
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
private JobConfigs toJobConfigs(Collection<CRJob> jobs) { JobConfigs jobConfigs = new JobConfigs(); for (CRJob crJob : jobs) { jobConfigs.add(toJobConfig(crJob)); } return jobConfigs; }
Helper to transform config repo classes to config-api classes
toJobConfigs
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
public PipelineConfig toPipelineConfig(CRPipeline crPipeline, PartialConfigLoadContext context, SCMs newSCMs) { MaterialConfigs materialConfigs = new MaterialConfigs(); for (CRMaterial crMaterial : crPipeline.getMaterials()) { materialConfigs.add(toMaterialConfig(crMaterial, context, newSCMs...
Helper to transform config repo classes to config-api classes
toPipelineConfig
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
private ParamConfig toParamConfig(CRParameter crParameter) { return new ParamConfig(crParameter.getName(), crParameter.getValue()); }
Helper to transform config repo classes to config-api classes
toParamConfig
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
public TimerConfig toTimerConfig(CRTimer crTimer) { String spec = crTimer.getSpec(); if (StringUtils.isBlank(spec)) throw new RuntimeException("timer schedule is not specified"); return new TimerConfig(spec, crTimer.isOnlyOnChanges()); }
Helper to transform config repo classes to config-api classes
toTimerConfig
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
private TrackingTool toTrackingTool(CRTrackingTool crTrackingTool) { return new TrackingTool(crTrackingTool.getLink(), crTrackingTool.getRegex()); }
Helper to transform config repo classes to config-api classes
toTrackingTool
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0
CRPipeline pipelineConfigToCRPipeline(PipelineConfig pipelineConfig, String groupName) { CRPipeline crPipeline = new CRPipeline(); crPipeline.setGroup(groupName); crPipeline.setName(pipelineConfig.name().toString()); for (StageConfig stage : pipelineConfig.getStages()) { crP...
Helper to transform config repo classes to config-api classes
pipelineConfigToCRPipeline
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/config/ConfigConverter.java
Apache-2.0