Skip to content

Commit

Permalink
fix version compatibility (via #243)
Browse files Browse the repository at this point in the history
  • Loading branch information
vbragin authored Jan 31, 2022
1 parent 85a9408 commit 2153156
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 12 deletions.
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
labels:
- "type:dependencies"

- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "daily"
labels:
- "type:dependencies"
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@
target/*
.test
classes

amps-standalone-bamboo-7.2.7
amps-standalone-bamboo-8.0.6
amps-standalone-bamboo-8.1.1

.DS_Store
9 changes: 5 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-bamboo</artifactId>
<version>1.11-SNAPSHOT</version>
<version>1.13-SNAPSHOT</version>
<name>Allure for Bamboo</name>
<description>Allure reports right in deployment plans in Bamboo</description>
<packaging>atlassian-plugin</packaging>
Expand Down Expand Up @@ -132,9 +132,10 @@
<version>1.9.4</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.12.0</version>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
</dependencies>
<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package io.qameta.allure.bamboo;

import com.atlassian.bamboo.plan.Plan;
import com.atlassian.bamboo.plan.cache.ImmutablePlan;
import com.atlassian.bamboo.plan.configuration.MiscellaneousPlanConfigurationPlugin;
import com.atlassian.bamboo.utils.error.ErrorCollection;
import com.atlassian.bamboo.v2.build.BaseConfigurablePlugin;
import com.atlassian.bamboo.v2.build.configuration.MiscellaneousBuildConfigurationPlugin;
Expand All @@ -19,22 +21,27 @@

@SuppressWarnings("unchecked")
public class AllureBuildConfigurator extends BaseConfigurablePlugin
implements MiscellaneousBuildConfigurationPlugin {
implements MiscellaneousPlanConfigurationPlugin {

private static final Logger LOGGER = LoggerFactory.getLogger(AllureBuildConfigurator.class);

private BambooExecutablesManager executablesManager;

private AllureSettingsManager settingsManager;

@Override
public boolean isApplicableTo(@NotNull final ImmutablePlan plan) {
return isChain(plan);
}

@Override
public boolean isApplicableTo(@NotNull final Plan plan) {
return isChain(plan);
}

@NotNull
@Override
public ErrorCollection validate(@NotNull BuildConfiguration buildConfiguration) {
public ErrorCollection validate(@NotNull final BuildConfiguration buildConfiguration) {
final ErrorCollection collection = super.validate(buildConfiguration);
if (buildConfiguration.getBoolean(ALLURE_CONFIG_ENABLED)) {
if (isEmpty(buildConfiguration.getString(ALLURE_CONFIG_EXECUTABLE))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

public class AllureExecutableProvider {
private static final Logger LOGGER = LoggerFactory.getLogger(AllureExecutableProvider.class);
static final String DEFAULT_VERSION = "2.7.0";
static final String DEFAULT_PATH = "/tmp/allure/2.7.0";
static final String DEFAULT_VERSION = "2.17.2";
static final String DEFAULT_PATH = "/tmp/allure/2.17.2";
private static final Pattern EXEC_NAME_PATTERN = compile("[^\\d]*(\\d[0-9\\.]{2,}[a-zA-Z0-9\\-]*)$");
private static final String BINARY_SUBDIR = "binary";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.qameta.allure.bamboo.info;

import com.fasterxml.jackson.databind.ObjectMapper;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -27,8 +27,9 @@ public Path invoke(File file) {
}
Path testRun = outputDirectory.resolve(getFileName());
try (Writer writer = Files.newBufferedWriter(testRun, StandardCharsets.UTF_8)) {
final ObjectMapper mapper = new ObjectMapper();
mapper.writeValue(writer, getData());
JSONObject.fromObject(getData())
.write(writer)
.flush();
} catch (IOException e) {
LOGGER.error("Failed to add executor info into the file " + file.getAbsolutePath(), e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void setUp() {

@Test
public void itShouldDownloadAndExtractAllureRelease() {
downloader.downloadAndExtractAllureTo(homeDir, "2.14.0");
downloader.downloadAndExtractAllureTo(homeDir, "2.17.2");
assertTrue(Paths.get(homeDir, "bin", "allure").toFile().exists());
}

Expand Down

0 comments on commit 2153156

Please sign in to comment.