Prevent exception in the log (#22201)
Also speed up the external link check by avoiding checking each bug submission link in the rendered docs which only differs by its parameter. Closes #22200
This commit is contained in:
parent
95a45f0910
commit
41fd12d20a
4 changed files with 29 additions and 20 deletions
24
.github/workflows/documentation.yml
vendored
24
.github/workflows/documentation.yml
vendored
|
@ -48,18 +48,12 @@ jobs:
|
||||||
name: Maven cache
|
name: Maven cache
|
||||||
uses: ./.github/actions/maven-cache
|
uses: ./.github/actions/maven-cache
|
||||||
|
|
||||||
- id: build-documentation
|
- id: build-test-documentation
|
||||||
name: Build Keycloak
|
name: Build and verify Keycloak documentation
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
MVN_HTTP_CONFIG="-Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=120"
|
MVN_HTTP_CONFIG="-Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=120"
|
||||||
./mvnw install -DskipTests -am -pl docs/documentation/tests,docs/documentation/dist -nsu -B -e $MVN_HTTP_CONFIG -Pdocumentation
|
./mvnw install -Dtest=!ExternalLinksTest -am -pl docs/documentation/tests,docs/documentation/dist -nsu -B -e $MVN_HTTP_CONFIG -Pdocumentation
|
||||||
|
|
||||||
- id: test-documentation
|
|
||||||
name: Verify Keycloak documentation
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
./mvnw test -Dtest=!ExternalLinksTest -am -pl docs/documentation/tests,docs/documentation/dist -nsu -B -e -Pdocumentation
|
|
||||||
|
|
||||||
- id: upload-keycloak-documentation
|
- id: upload-keycloak-documentation
|
||||||
name: Upload Keycloak documentation
|
name: Upload Keycloak documentation
|
||||||
|
@ -85,18 +79,12 @@ jobs:
|
||||||
name: Maven cache
|
name: Maven cache
|
||||||
uses: ./.github/actions/maven-cache
|
uses: ./.github/actions/maven-cache
|
||||||
|
|
||||||
- id: build-documentation
|
- id: build-test-documentation
|
||||||
name: Build Keycloak
|
name: Build and verify Keycloak documentation
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
MVN_HTTP_CONFIG="-Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=120"
|
MVN_HTTP_CONFIG="-Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=120"
|
||||||
./mvnw install -DskipTests -am -pl docs/documentation/tests -nsu -B -e -Pdocumentation $MVN_HTTP_CONFIG
|
./mvnw install -Dtest=ExternalLinksTest -am -pl docs/documentation/tests -nsu -B -e -Pdocumentation $MVN_HTTP_CONFIG
|
||||||
|
|
||||||
- id: test-documentation
|
|
||||||
name: Verify Keycloak documentation
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
./mvnw test -Dtest=ExternalLinksTest -am -pl docs/documentation/tests,docs/documentation/dist -nsu -B -e -Pdocumentation
|
|
||||||
|
|
||||||
check:
|
check:
|
||||||
name: Status Check - Keycloak Documentation
|
name: Status Check - Keycloak Documentation
|
||||||
|
|
|
@ -4,6 +4,11 @@
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<version.log4j>2.17.1</version.log4j>
|
<version.log4j>2.17.1</version.log4j>
|
||||||
|
<!-- this property prevents the warning "WARN FilenoUtil: Native subprocess control requires open access" when using JRuby for the unit tests on JDK17 -->
|
||||||
|
<surefire.system.args>
|
||||||
|
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED
|
||||||
|
--add-opens java.base/java.io=ALL-UNNAMED
|
||||||
|
</surefire.system.args>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -134,7 +139,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.asciidoctor</groupId>
|
<groupId>org.asciidoctor</groupId>
|
||||||
<artifactId>asciidoctorj</artifactId>
|
<artifactId>asciidoctorj</artifactId>
|
||||||
<version>2.1.0</version>
|
<version>2.5.10</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package org.keycloak.documentation.test;
|
package org.keycloak.documentation.test;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.AfterAll;
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.params.ParameterizedTest;
|
import org.junit.jupiter.params.ParameterizedTest;
|
||||||
import org.junit.jupiter.params.provider.MethodSource;
|
import org.junit.jupiter.params.provider.MethodSource;
|
||||||
import org.keycloak.documentation.test.utils.LinkUtils;
|
import org.keycloak.documentation.test.utils.LinkUtils;
|
||||||
|
@ -10,11 +12,24 @@ import java.util.List;
|
||||||
|
|
||||||
public class ExternalLinksTest {
|
public class ExternalLinksTest {
|
||||||
|
|
||||||
|
static LinkUtils linkUtils = LinkUtils.getInstance();
|
||||||
|
|
||||||
|
@BeforeAll
|
||||||
|
public static void setup() {
|
||||||
|
linkUtils = LinkUtils.getInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
@AfterAll
|
||||||
|
public static void close() {
|
||||||
|
// this will save a cache with all verified links that will expire after one day.
|
||||||
|
linkUtils.close();
|
||||||
|
}
|
||||||
|
|
||||||
@ParameterizedTest
|
@ParameterizedTest
|
||||||
@MethodSource("org.keycloak.documentation.test.Guides#guides()")
|
@MethodSource("org.keycloak.documentation.test.Guides#guides()")
|
||||||
public void checkExternalLinks(String guideName) throws IOException {
|
public void checkExternalLinks(String guideName) throws IOException {
|
||||||
Guide guide = new Guide(guideName);
|
Guide guide = new Guide(guideName);
|
||||||
List<LinkUtils.InvalidLink> invalidLinks = LinkUtils.getInstance().findInvalidLinks(guide);
|
List<LinkUtils.InvalidLink> invalidLinks = linkUtils.findInvalidLinks(guide);
|
||||||
if (!invalidLinks.isEmpty()) {
|
if (!invalidLinks.isEmpty()) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("Broken links (" + invalidLinks.size() + ") in guide '" + guideName + "': ");
|
sb.append("Broken links (" + invalidLinks.size() + ") in guide '" + guideName + "': ");
|
||||||
|
|
|
@ -41,3 +41,4 @@ https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#ro
|
||||||
https://github.com/keycloak/keycloak/blob/main/docs/tests.md#kerberos-server
|
https://github.com/keycloak/keycloak/blob/main/docs/tests.md#kerberos-server
|
||||||
https://github.com/apache/felix-dev/tree/master/http#using-the-osgi-http-whiteboard
|
https://github.com/apache/felix-dev/tree/master/http#using-the-osgi-http-whiteboard
|
||||||
https://github.com/keycloak/keycloak/blob/025778fe9c745316f80b53fe3052aeb314e868ef/js/apps/admin-ui/public/locales/en/dashboard.json#L3
|
https://github.com/keycloak/keycloak/blob/025778fe9c745316f80b53fe3052aeb314e868ef/js/apps/admin-ui/public/locales/en/dashboard.json#L3
|
||||||
|
https://github.com/keycloak/keycloak/issues/new?*
|
Loading…
Reference in a new issue