Skip to content

Commit

Permalink
Removed workaround (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
ckunki authored Mar 21, 2023
1 parent 37449b5 commit 3b61816
Show file tree
Hide file tree
Showing 11 changed files with 231 additions and 250 deletions.
1 change: 0 additions & 1 deletion .project-keeper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,5 @@ excludes:
- regex: "W-PK-CORE-151: Pom file .* contains no reference to project-keeper-maven-plugin."
- "E-PK-CORE-17: Missing required file: '.github/workflows/project-keeper-verify.yml'"
- "E-PK-CORE-17: Missing required file: '.github/workflows/project-keeper.sh'"
- regex: "E-PK-CORE-53: The dependencies.md file has outdated content.*"
linkReplacements:
- https://eclipse-ee4j.github.io/jsonb-api|https://projects.eclipse.org/projects/ee4j.jsonp
338 changes: 170 additions & 168 deletions dependencies.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions doc/changes/changelog.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 55 additions & 0 deletions doc/changes/changes_2.9.6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Project Keeper 2.9.6, released 2023-03-22

Code name: Remove Dependencies Workaround

## Summary

This release removes the workaround for inconsistencies in file `dependencies.md` introduced with release 2.9.5 as the developers preferred to install on the local machines the same maven version as on GitHub which should make the workaround obsolete.

## Features

* #442: Removed workaround for inconsistencies in file `dependencies.md`

## Dependency Updates

### Project Keeper Core

#### Compile Dependency Updates

* Updated `com.exasol:project-keeper-shared-model-classes:2.9.5` to `2.9.6`

#### Runtime Dependency Updates

* Updated `com.exasol:project-keeper-java-project-crawler:2.9.5` to `2.9.6`

#### Test Dependency Updates

* Updated `com.exasol:project-keeper-shared-test-setup:2.9.5` to `2.9.6`

### Project Keeper Command Line Interface

#### Compile Dependency Updates

* Updated `com.exasol:project-keeper-core:2.9.5` to `2.9.6`

#### Test Dependency Updates

* Updated `com.exasol:project-keeper-shared-test-setup:2.9.5` to `2.9.6`

### Project Keeper Maven Plugin

#### Compile Dependency Updates

* Updated `com.exasol:project-keeper-core:2.9.5` to `2.9.6`

### Project Keeper Java Project Crawler

#### Compile Dependency Updates

* Updated `com.exasol:project-keeper-shared-model-classes:2.9.5` to `2.9.6`

### Project Keeper Shared Test Setup

#### Compile Dependency Updates

* Updated `com.exasol:project-keeper-shared-model-classes:2.9.5` to `2.9.6`
2 changes: 1 addition & 1 deletion parent-pom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</repository>
</distributionManagement>
<properties>
<revision>2.9.5</revision>
<revision>2.9.6</revision>
<maven.version>3.9.0</maven.version>
<junit.version>5.9.2</junit.version>
<xmlunit.version>2.9.1</xmlunit.version>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import com.exasol.projectkeeper.shared.dependencies.*;
import com.exasol.projectkeeper.validators.dependencies.ProjectWithDependencies;
import com.exasol.projectkeeper.validators.workarounds.Workaround;

import net.steppschuh.markdowngenerator.table.Table;

Expand Down Expand Up @@ -92,8 +91,7 @@ private String renderDependencyName(final ProjectDependency dependency,
}

private String renderLicense(final License license, final MarkdownReferenceBuilder markdownReferenceBuilder) {
final String name = Workaround.ALTERNATING_DEPENDENCIES.apply(license.getName());
return renderLink(name, license.getUrl(), markdownReferenceBuilder);
return renderLink(license.getName(), license.getUrl(), markdownReferenceBuilder);
}

private String renderLink(final String name, final String url,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import java.util.LinkedHashMap;
import java.util.Map;

import com.exasol.projectkeeper.validators.workarounds.Workaround;

class MarkdownReferenceBuilder {
private final Map<String, Integer> references = new LinkedHashMap<>();
private int referenceCounter = 0;
Expand Down Expand Up @@ -37,10 +35,7 @@ public String getReferenceForUrl(final String url) {
public String getReferences() {
final var sb = new StringBuilder();
for (final Map.Entry<String, Integer> ref : this.references.entrySet()) {
sb.append(String.format("[%s]: %s%s", //
ref.getValue(), //
Workaround.ALTERNATING_DEPENDENCIES.apply(ref.getKey()), //
System.lineSeparator()));
sb.append(String.format("[%s]: %s%s", ref.getValue(), ref.getKey(), System.lineSeparator()));
}
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
package com.exasol.projectkeeper.validators.workarounds;

import com.exasol.projectkeeper.validators.dependencies.renderer.AlternatingDependenciesWorkaraound;

/**
* This class serves as a marker to easily find all places affected by a particular workaround.
*/
public interface Workaround {

/** Workaround for contents of file dependencies.md reported with issue #436 **/
public static Workaround ALTERNATING_DEPENDENCIES = new AlternatingDependenciesWorkaraound();

/**
* @param input string to modify
* @return string as modified by the workaround
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,22 @@

import static com.exasol.projectkeeper.shared.dependencies.BaseDependency.Type.COMPILE;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

import com.exasol.projectkeeper.shared.dependencies.License;
import com.exasol.projectkeeper.shared.dependencies.ProjectDependency;
import com.exasol.projectkeeper.validators.dependencies.ProjectWithDependencies;

class DependencyPageRendererTest {

@ParameterizedTest
@ValueSource(strings = { "The Apache Software License", "Apache License" })
void testApachaLicense(final String licenseName) {
final List<ProjectWithDependencies> projects = singleProjectWith( //
buildDependency("maven-clean-plugin", List.of(buildLicense(licenseName))));
assertThat(new DependencyPageRenderer().render(projects),
containsString(AlternatingDependenciesWorkaraound.LICENSE.to));
assertThat(new DependencyPageRenderer().render(projects),
not(containsString(AlternatingDependenciesWorkaraound.LICENSE.from)));
}

@Test
void twoDependenciesSameLicense() {
final List<License> licenses = List.of(buildLicense("L1"), buildLicense("L2"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import static org.hamcrest.Matchers.not;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

class MarkdownReferenceBuilderTest {
@Test
Expand All @@ -16,15 +14,6 @@ void testReferenceDeclarations() {
assertThat(referenceBuilder.getReferences(), equalTo("[0]: https://exasol.com" + System.lineSeparator()));
}

@ParameterizedTest
@ValueSource(strings = { "http://maven.apache.org", "https://maven.apache.org" })
void testReferencesToMAvenApacheOrg(final String url) {
final MarkdownReferenceBuilder referenceBuilder = new MarkdownReferenceBuilder();
referenceBuilder.getReferenceForUrl(url);
assertThat(referenceBuilder.getReferences(),
equalTo("[0]: " + AlternatingDependenciesWorkaraound.URL.to + System.lineSeparator()));
}

@Test
void testGetSameReferenceForSameUrl() {
final MarkdownReferenceBuilder referenceBuilder = new MarkdownReferenceBuilder();
Expand Down

0 comments on commit 3b61816

Please sign in to comment.