Skip to content

Commit

Permalink
Finalize renaming to Develocity (#109)
Browse files Browse the repository at this point in the history
* Finalize renaming to Develocity

* Fix assertion in test
  • Loading branch information
welandaz authored Feb 9, 2024
1 parent 66cd04d commit d2025f0
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ image::build-scan-links.png[Build Scan Links,{thumbnail}]

== Installation

The plugin is available via https://marketplace.atlassian.com/apps/1230500/gradle-enterprise-plugin-for-bamboo[Atlassian Marketplace].
The plugin is available via https://marketplace.atlassian.com/apps/1230500/develocity-plugin-for-bamboo[Atlassian Marketplace].
It is also possible to install the plugin manually as mentioned in https://confluence.atlassian.com/bamboo/installing-a-plugin-289277265.html[Uploading your own plugin] section. The released JARs can be found in the Releases.

Once the plugin is installed, the Bamboo Administration page will have a new section available under the “Managed Apps” group named Develocity integration.
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>com.gradle.enterprise</groupId>
<artifactId>gradle-enterprise-bamboo-plugin</artifactId>
<groupId>com.gradle.develocity</groupId>
<artifactId>develocity-bamboo-plugin</artifactId>
<version>2.0.0-SNAPSHOT</version>
<packaging>atlassian-plugin</packaging>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public String input() {
server = config.getServer();
allowUntrustedServer = config.isAllowUntrustedServer();
sharedCredentialName = config.getSharedCredentialName();
develocityPluginVersion = config.getGePluginVersion();
develocityPluginVersion = config.getDevelocityPluginVersion();
ccudPluginVersion = config.getCcudPluginVersion();
pluginRepository = config.getPluginRepository();
injectMavenExtension = config.isInjectMavenExtension();
Expand Down Expand Up @@ -113,7 +113,7 @@ public String save() {
.setAllowUntrustedServer(allowUntrustedServer)
.setSharedCredentialName(sharedCredentialName)
.setPluginRepository(pluginRepository)
.setGePluginVersion(develocityPluginVersion)
.setDevelocityPluginVersion(develocityPluginVersion)
.setCcudPluginVersion(ccudPluginVersion)
.setInjectMavenExtension(injectMavenExtension)
.setInjectCcudExtension(injectCcudExtension));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
public class ConfigurationMigrator {

private static final Logger LOGGER = LoggerFactory.getLogger(ConfigurationMigrator.class);
private static final String DEVELOCITY_BAMBOO_PLUGIN_KEY = "com.gradle.enterprise.gradle-enterprise-bamboo-plugin";
private static final String DEVELOCITY_BAMBOO_PLUGIN_KEY = "com.gradle.develocity.develocity-bamboo-plugin";
private final BandanaManager bandanaManager;

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static GradleConfiguration of(PersistentConfiguration configuration) {
configuration.getServer(),
configuration.isAllowUntrustedServer(),
configuration.getSharedCredentialName(),
configuration.getGePluginVersion(),
configuration.getDevelocityPluginVersion(),
configuration.getCcudPluginVersion(),
configuration.getPluginRepository());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class PersistentConfiguration {
private String sharedCredentialName;

@Nullable
private String gePluginVersion;
private String develocityPluginVersion;
@Nullable
private String ccudPluginVersion;
@Nullable
Expand Down Expand Up @@ -54,12 +54,12 @@ public PersistentConfiguration setSharedCredentialName(@Nullable String sharedCr
}

@Nullable
public String getGePluginVersion() {
return gePluginVersion;
public String getDevelocityPluginVersion() {
return develocityPluginVersion;
}

public PersistentConfiguration setGePluginVersion(String gePluginVersion) {
this.gePluginVersion = StringUtils.trimToNull(gePluginVersion);
public PersistentConfiguration setDevelocityPluginVersion(String develocityPluginVersion) {
this.develocityPluginVersion = StringUtils.trimToNull(develocityPluginVersion);
return this;
}

Expand Down Expand Up @@ -107,7 +107,7 @@ public String toString() {
.append("server", server)
.append("allowUntrustedServer", allowUntrustedServer)
.append("sharedCredentialName", sharedCredentialName)
.append("gePluginVersion", gePluginVersion)
.append("develocityPluginVersion", develocityPluginVersion)
.append("ccudPluginVersion", ccudPluginVersion)
.append("pluginRepository", pluginRepository)
.append("injectMavenExtension", injectMavenExtension)
Expand All @@ -124,14 +124,14 @@ public boolean equals(Object o) {
injectMavenExtension == that.injectMavenExtension &&
injectCcudExtension == that.injectCcudExtension && Objects.equals(server, that.server) &&
Objects.equals(sharedCredentialName, that.sharedCredentialName) &&
Objects.equals(gePluginVersion, that.gePluginVersion) &&
Objects.equals(develocityPluginVersion, that.develocityPluginVersion) &&
Objects.equals(ccudPluginVersion, that.ccudPluginVersion) &&
Objects.equals(pluginRepository, that.pluginRepository);
}

@Override
public int hashCode() {
return Objects.hash(server, allowUntrustedServer, sharedCredentialName, gePluginVersion, ccudPluginVersion,
return Objects.hash(server, allowUntrustedServer, sharedCredentialName, develocityPluginVersion, ccudPluginVersion,
pluginRepository, injectMavenExtension, injectCcudExtension);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
@Component
public class PersistentConfigurationManager {

static final String CONFIG_V0_KEY = "com.gradle.bamboo.plugins.ge.config";
static final String CONFIG_V1_KEY = "com.gradle.bamboo.plugins.ge.config.v1";
static final String CONFIG_V0_KEY = "com.gradle.bamboo.plugins.develocity.config";
static final String CONFIG_V1_KEY = "com.gradle.bamboo.plugins.develocity.config.v1";
static final String CURRENT_CONFIG_KEY = CONFIG_V1_KEY;

private final BandanaManager bandanaManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void doesNothingIfNoSupportedTasks() {
String credentialsName = RandomStringUtils.randomAlphanumeric(10);
when(bandanaManager.getValue(any(BandanaContext.class), anyString()))
.thenReturn("{\"server\":\"https://scans.gradle.com\",\"sharedCredentialName\":\"" + credentialsName + "\", " +
"\"gePluginVersion\": \"3.12\"}");
"\"develocityPluginVersion\": \"3.12\"}");

when(credentialsAccessor.getCredentialsByName(credentialsName))
.thenReturn(credentialsData);
Expand Down Expand Up @@ -183,7 +183,7 @@ void addsAccessKeyToContext(String pluginKey) {
String credentialsName = RandomStringUtils.randomAlphanumeric(10);
when(bandanaManager.getValue(any(BandanaContext.class), anyString()))
.thenReturn("{\"server\":\"https://scans.gradle.com\",\"sharedCredentialName\":\"" + credentialsName + "\", " +
"\"gePluginVersion\": \"3.12\"}");
"\"develocityPluginVersion\": \"3.12\"}");

when(credentialsAccessor.getCredentialsByName(credentialsName))
.thenReturn(credentialsData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ class ConfigurationMigratorTest {

@Test
void runsMigrateConfigV0ToV1() {
setupPluginEnabledEventMock("com.gradle.enterprise.gradle-enterprise-bamboo-plugin");
when(bandanaManager.getValue(any(BandanaContext.class), eq("com.gradle.bamboo.plugins.ge.config")))
setupPluginEnabledEventMock("com.gradle.develocity.develocity-bamboo-plugin");
when(bandanaManager.getValue(any(BandanaContext.class), eq("com.gradle.bamboo.plugins.develocity.config")))
.thenReturn(new PersistentConfiguration().setServer("https://mycomp"));

new ConfigurationMigrator(bandanaManager).onPluginEnabled(pluginEnabledEvent);

verify(bandanaManager, times(1)).setValue(any(BandanaContext.class), eq("com.gradle.bamboo.plugins.ge.config.v1"),
eq("{\"server\":\"https://mycomp\",\"allowUntrustedServer\":false,\"sharedCredentialName\":null,\"gePluginVersion\":null,\"ccudPluginVersion\":null,\"pluginRepository\":null,\"injectMavenExtension\":false,\"injectCcudExtension\":false}"));
verify(bandanaManager, times(1)).removeValue(any(BandanaContext.class), eq("com.gradle.bamboo.plugins.ge.config"));
verify(bandanaManager, times(1)).setValue(any(BandanaContext.class), eq("com.gradle.bamboo.plugins.develocity.config.v1"),
eq("{\"server\":\"https://mycomp\",\"allowUntrustedServer\":false,\"sharedCredentialName\":null,\"develocityPluginVersion\":null,\"ccudPluginVersion\":null,\"pluginRepository\":null,\"injectMavenExtension\":false,\"injectCcudExtension\":false}"));
verify(bandanaManager, times(1)).removeValue(any(BandanaContext.class), eq("com.gradle.bamboo.plugins.develocity.config"));
}

@ParameterizedTest
Expand All @@ -53,8 +53,8 @@ void doesNotRunMigrateConfigV0ToV1(Object config, String eventKey) {

static Stream<Arguments> configAndEventProvider() {
return Stream.of(
arguments(null, "com.gradle.enterprise.gradle-enterprise-bamboo-plugin"),
arguments("not a Persistent Configuration object", "com.gradle.enterprise.gradle-enterprise-bamboo-plugin"),
arguments(null, "com.gradle.develocity.develocity-bamboo-plugin"),
arguments("not a Persistent Configuration object", "com.gradle.develocity.develocity-bamboo-plugin"),
arguments(new PersistentConfiguration(), "some.other.plugin")
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class JsonConfigurationConverterTest {

private static final PersistentConfiguration config = new PersistentConfiguration()
.setServer("https://mycompany.com")
.setGePluginVersion("3.11")
.setDevelocityPluginVersion("3.11")
.setPluginRepository("https://plugins.mycompany.com")
.setSharedCredentialName("develocity-creds")
.setAllowUntrustedServer(true)
Expand All @@ -23,7 +23,7 @@ class JsonConfigurationConverterTest {
.setInjectMavenExtension(true);

private static final String json = "{\"server\":\"https://mycompany.com\",\"allowUntrustedServer\":true," +
"\"sharedCredentialName\":\"develocity-creds\",\"gePluginVersion\":\"3.11\",\"ccudPluginVersion\":\"1.11\"," +
"\"sharedCredentialName\":\"develocity-creds\",\"develocityPluginVersion\":\"3.11\",\"ccudPluginVersion\":\"1.11\"," +
"\"pluginRepository\":\"https://plugins.mycompany.com\",\"injectMavenExtension\":true," +
"\"injectCcudExtension\":true}";

Expand Down

0 comments on commit d2025f0

Please sign in to comment.