Merge branch 'develop' into feature/favourite_repository

This commit is contained in:
Eduard Heimbuch
2020-03-23 08:16:43 +01:00
13 changed files with 100 additions and 43 deletions

27
Jenkinsfile vendored
View File

@@ -64,15 +64,20 @@ node('docker') {
mvn 'clean install -DskipTests'
}
stage('Unit Test') {
mvn 'test -Pcoverage -Dmaven.test.failure.ignore=true'
junit allowEmptyResults: true, testResults: '**/target/surefire-reports/TEST-*.xml,**/target/jest-reports/TEST-*.xml'
}
stage('Integration Test') {
mvn 'verify -Pit -pl :scm-webapp,:scm-it -Dmaven.test.failure.ignore=true -Dscm.git.core.supportsatomicfilecreation=false'
junit allowEmptyResults: true, testResults: '**/target/failsafe-reports/TEST-*.xml'
}
parallel(
unitTest: {
stage('Unit Test') {
mvn 'test -DskipFrontendBuild -DskipTypecheck -Pcoverage -pl !scm-it -Dmaven.test.failure.ignore=true'
junit allowEmptyResults: true, testResults: '**/target/surefire-reports/TEST-*.xml,**/target/jest-reports/TEST-*.xml'
}
},
integrationTest: {
stage('Integration Test') {
mvn 'verify -Pit -DskipUnitTests -pl :scm-webapp,:scm-it -Dmaven.test.failure.ignore=true'
junit allowEmptyResults: true, testResults: '**/target/failsafe-reports/TEST-*.xml'
}
}
)
stage('SonarQube') {
@@ -203,6 +208,10 @@ String mainBranch
Maven setupMavenBuild() {
Maven mvn = new MavenWrapperInDocker(this, "scmmanager/java-build:11.0.6_10")
// disable logging durring the build
def logConf = "scm-webapp/src/main/resources/logback.ci.xml"
mvn.additionalArgs += " -Dlogback.configurationFile=${logConf}"
mvn.additionalArgs += " -Dscm-it.logbackConfiguration=${logConf}"
if (isMainBranch() || isReleaseBranch()) {
// Release starts javadoc, which takes very long, so do only for certain branches

37
pom.xml
View File

@@ -200,7 +200,7 @@
<dependency>
<groupId>de.otto.edison</groupId>
<artifactId>edison-hal</artifactId>
<version>2.0.1</version>
<version>2.1.0</version>
</dependency>
<dependency>
@@ -323,7 +323,7 @@
<dependency>
<groupId>org.junit-pioneer</groupId>
<artifactId>junit-pioneer</artifactId>
<version>0.3.0</version>
<version>0.5.4</version>
<scope>test</scope>
</dependency>
@@ -358,7 +358,7 @@
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.10.0</version>
<version>3.15.0</version>
<scope>test</scope>
</dependency>
@@ -399,12 +399,6 @@
<version>${jaxb.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${jaxb.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
@@ -422,7 +416,7 @@
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.13</version>
<version>1.14</version>
</dependency>
</dependencies>
@@ -480,6 +474,13 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<configuration>
<!--
skips surefire tests without skipping failsafe tests.
Property value seems to magically default to false
-->
<skipTests>${skipUnitTests}</skipTests>
</configuration>
</plugin>
<plugin>
@@ -838,21 +839,21 @@
<jaxrs.version>2.1.1</jaxrs.version>
<resteasy.version>4.4.2.Final</resteasy.version>
<jersey-client.version>1.19.4</jersey-client.version>
<jackson.version>2.10.0</jackson.version>
<jackson.version>2.10.2</jackson.version>
<guice.version>4.2.2</guice.version>
<jaxb.version>2.3.0</jaxb.version>
<hibernate-validator.version>6.1.0.Final</hibernate-validator.version>
<jaxb.version>2.3.1</jaxb.version>
<hibernate-validator.version>6.1.2.Final</hibernate-validator.version>
<!-- event bus -->
<legman.version>1.6.2</legman.version>
<!-- webserver -->
<jetty.version>9.4.26.v20200117</jetty.version>
<jetty.version>9.4.27.v20200227</jetty.version>
<jetty.maven.version>9.4.22.v20191022</jetty.maven.version>
<!-- security libraries -->
<ssp.version>1.2.0</ssp.version>
<shiro.version>1.4.1</shiro.version>
<shiro.version>1.5.1</shiro.version>
<!-- repository libraries -->
<jgit.version>5.6.1.202002131546-r-scm1</jgit.version>
@@ -871,7 +872,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<netbeans.hint.license>SCM-BSD</netbeans.hint.license>
<jdk.classifier/>
<org.mapstruct.version>1.2.0.Final</org.mapstruct.version>
<org.mapstruct.version>1.3.1.Final</org.mapstruct.version>
<!-- Sonar exclusions -->
<!-- *StoreFactory classes are excluded because extracting the floating store parameter classes in a generic -->
@@ -881,7 +882,9 @@
<sonar.nodejs.executable>./scm-ui/target/frontend/buildfrontend-node/node-v${nodejs.version}-linux-x64/bin/node</sonar.nodejs.executable>
<!-- Possibility to skip only the unit test. Can be useful when running only integration tests.
This can be used from the command line as follows: mvn <goals> -DskipUnitTests -->
<skipUnitTests>${skipTests}</skipUnitTests>
</properties>
</project>

View File

@@ -208,10 +208,12 @@ public final class ScmAnnotationProcessor extends AbstractProcessor {
return doc;
}
@SuppressWarnings("java:S2755") // we need to process https dtd, to avoid breaking intellij compilation on plugins
private DocumentBuilder createDocumentBuilder() throws ParserConfigurationException {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "https");
factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
factory.setAttribute(XMLConstants.FEATURE_SECURE_PROCESSING, true);
return factory.newDocumentBuilder();
}
@@ -338,9 +340,10 @@ public final class ScmAnnotationProcessor extends AbstractProcessor {
}
}
@SuppressWarnings("java:S2755") // we need to process https dtd, to avoid breaking intellij compilation on plugins
private Transformer createTransformer() throws TransformerConfigurationException {
TransformerFactory factory = TransformerFactory.newInstance();
factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "https");
factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, "");
Transformer transformer = factory.newTransformer();

View File

@@ -152,11 +152,6 @@
<artifactId>jaxb-api</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>

View File

@@ -212,6 +212,10 @@
<name>sonia.scm.classloading.lifecycle</name>
<value>simple</value>
</systemProperty>
<systemProperty>
<name>logback.configurationFile</name>
<value>${scm-it.logbackConfiguration}</value>
</systemProperty>
</systemProperties>
<webApp>
<contextPath>/scm</contextPath>
@@ -245,10 +249,10 @@
<properties>
<scm.stage>DEVELOPMENT</scm.stage>
<scm.home>target/scm-it</scm.home>
<scm-it.logbackConfiguration>${project.basedir}/../scm-webapp/src/main/resources/logback.default.xml</scm-it.logbackConfiguration>
</properties>
</profile>
</profiles>
</project>

View File

@@ -224,7 +224,7 @@ public class GitConfigResourceTest {
assertThat(configurationStoreCaptor.getValue())
.isInstanceOfSatisfying(GitRepositoryConfig.class, x -> { })
.extracting("defaultBranch")
.containsExactly("new");
.isEqualTo("new");
}
private MockHttpResponse get() throws URISyntaxException {

View File

@@ -18,8 +18,9 @@
<properties>
<build.script>build</build.script>
<skipTests>false</skipTests>
<skipTypecheck>false</skipTypecheck>
<skipFrontendTests>${skipTests}</skipFrontendTests>
<skipFrontendBuild>false</skipFrontendBuild>
<sonar.language>typescript</sonar.language>
<sonar.sources>ui-extensions/src,ui-components/src,ui-webapp/src</sonar.sources>
<sonar.test.exclusions>**/*.test.js,src/tests/**</sonar.test.exclusions>
@@ -88,6 +89,7 @@
<goal>run</goal>
</goals>
<configuration>
<skip>${skipFrontendBuild}</skip>
<script>${build.script}</script>
</configuration>
</execution>
@@ -99,7 +101,7 @@
</goals>
<configuration>
<script>test</script>
<skip>${skipTests}</skip>
<skip>${skipFrontendTests}</skip>
</configuration>
</execution>
<execution>

View File

@@ -19,6 +19,7 @@ module.exports = function(mode) {
[name]: [path.resolve(__dirname, "webpack-public-path.js"), packageJSON.main || "src/main/js/index.js"]
},
mode,
stats: "minimal",
devtool: "source-map",
target: "web",
node: {

View File

@@ -25,6 +25,7 @@ console.log(`build ${mode} bundles`);
module.exports = [
{
mode,
stats: "minimal",
context: root,
entry: {
webapp: [path.resolve(__dirname, "webpack-public-path.js"), "./ui-webapp/src/index.tsx"]

View File

@@ -161,7 +161,7 @@
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.1.0.Final</version>
<version>6.1.2.Final</version>
</dependency>
<dependency>
@@ -632,7 +632,7 @@
<scm.stage>DEVELOPMENT</scm.stage>
<scm.home>target/scm-it</scm.home>
<environment.profile>default</environment.profile>
<jjwt.version>0.10.5</jjwt.version>
<jjwt.version>0.11.0</jjwt.version>
<selenium.version>2.53.1</selenium.version>
<wagon.version>1.0</wagon.version>
<mustache.version>0.9.6-scm1</mustache.version>

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2010, Sebastian Sdorra
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of SCM-Manager; nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
http://bitbucket.org/sdorra/scm-manager
-->
<configuration>
<root level="OFF" />
</configuration>

View File

@@ -53,8 +53,8 @@ public class ChangesetCollectionToDtoMapperTest {
assertThat(collectionDto.getEmbedded().getItemsBy("branch"))
.hasSize(1)
.first().matches(b -> b.getLinks().getLinkBy("self").isPresent())
.extracting(b -> b.getLinks().getLinkBy("self").get().getHref()).first().isEqualTo("/v2/repositories/space/name/branches/someBranch");
.extracting(b -> b.getLinks().getLinkBy("self").get().getHref()).isEqualTo("/v2/repositories/space/name/branches/someBranch");
assertThat(collectionDto.getEmbedded().getItemsBy("branch"))
.first().extracting("name").first().isEqualTo("someBranch");
.first().extracting("name").isEqualTo("someBranch");
}
}

View File

@@ -55,7 +55,7 @@ class DiffResultToDiffResultDtoMapperTest {
.isPresent()
.get()
.extracting("href")
.contains("/scm/api/v2/repositories/space/X/diff/123/parsed");
.isEqualTo("/scm/api/v2/repositories/space/X/diff/123/parsed");
}
@Test
@@ -67,7 +67,7 @@ class DiffResultToDiffResultDtoMapperTest {
.isPresent()
.get()
.extracting("href")
.contains("/scm/api/v2/repositories/space/X/incoming/feature%2Fsome/master/diff/parsed");
.isEqualTo("/scm/api/v2/repositories/space/X/incoming/feature%2Fsome/master/diff/parsed");
}
private DiffResult createResult() {