This is an automated email from the ASF dual-hosted git repository.

fanningpj pushed a commit to branch main
in repository 
https://gitbox.apache.org/repos/asf/incubator-pekko-persistence-r2dbc.git


The following commit(s) were added to refs/heads/main by this push:
     new 0c80f90  validate links (#70)
0c80f90 is described below

commit 0c80f90efff81f28fcb4cbbcea5e1057bf63aba5
Author: PJ Fanning <[email protected]>
AuthorDate: Mon Nov 6 12:31:29 2023 +0100

    validate links (#70)
    
    * validate links
    
    * try to fix links
    
    * scalafmt
    
    * Update build.sbt
    
    * continuing build issues
    
    * Update link-validator.conf
---
 .github/workflows/format.yml         |  2 +-
 .github/workflows/link-validator.yml | 41 +++++++++++++++++++++++++++
 .scalafmt.conf                       |  2 +-
 build.sbt                            |  8 +++++-
 docs/src/main/paradox/projection.md  |  4 +--
 project/Dependencies.scala           |  1 +
 scripts/link-validator.conf          | 54 ++++++++++++++++++++++++++++++++++++
 7 files changed, 107 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml
index 4befca7..163b3ed 100644
--- a/.github/workflows/format.yml
+++ b/.github/workflows/format.yml
@@ -20,5 +20,5 @@ jobs:
       - name: Check project is formatted
         uses: jrouly/scalafmt-native-action@v2
         with:
-          version: '3.7.1'
+          version: '3.7.11'
           arguments: '--list --mode diff-ref=origin/main'
diff --git a/.github/workflows/link-validator.yml 
b/.github/workflows/link-validator.yml
new file mode 100644
index 0000000..8bc9135
--- /dev/null
+++ b/.github/workflows/link-validator.yml
@@ -0,0 +1,41 @@
+name: Link Validator
+
+permissions: {}
+
+on:
+  pull_request:
+  workflow_dispatch:
+  schedule:
+    - cron: '0 6 * * 1'
+
+jobs:
+  validate-links:
+    runs-on: ubuntu-20.04
+    if: github.repository == 'apache/incubator-pekko-persistence-r2dbc'
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v4
+
+      - name: Checkout GitHub merge
+        if: github.event.pull_request
+        run: |-
+          git fetch origin pull/${{ github.event.pull_request.number 
}}/merge:scratch
+          git checkout scratch
+
+      - name: Setup Java 8
+        uses: actions/setup-java@v3
+        with:
+          distribution: temurin
+          java-version: 8
+
+      - name: Cache Coursier cache
+        uses: coursier/[email protected]
+
+      - name: Setup Coursier
+        uses: coursier/[email protected]
+
+      - name: Create the Pekko site
+        run: sbt "unidoc; docs/paradox"
+
+      - name: Run Link Validator
+        run: cs launch net.runne::site-link-validator:0.2.2 -- 
scripts/link-validator.conf
diff --git a/.scalafmt.conf b/.scalafmt.conf
index 1aae8a4..23ae712 100644
--- a/.scalafmt.conf
+++ b/.scalafmt.conf
@@ -1,4 +1,4 @@
-version                                  = 3.7.1
+version                                  = 3.7.11
 runner.dialect                           = scala213
 project.git                              = true
 style                                    = defaultWithAlign
diff --git a/build.sbt b/build.sbt
index c0ba80c..9afec59 100644
--- a/build.sbt
+++ b/build.sbt
@@ -107,7 +107,13 @@ lazy val docs = project
       "extref.pekko-projection.base_url" -> 
s"https://pekko.apache.org/docs/pekko-projection/${Dependencies.PekkoProjectionVersionInDocs}/%s";,
       "extref.java-docs.base_url" -> 
"https://docs.oracle.com/en/java/javase/11/%s";,
       "scaladoc.scala.base_url" -> s"https://www.scala-lang.org/api/current/";,
-      "scaladoc.org.apache.pekko.base_url" -> 
s"https://pekko.apache.org/api/pekko/${Dependencies.PekkoVersion}";,
+      "scaladoc.org.apache.pekko.persistence.r2dbc.base_url" ->
+      
s"https://pekko.apache.org/api/pekko-persistence-r2dbc/${Dependencies.PekkoPersistenceR2dbcVersionInDocs}";,
+      "scaladoc.org.apache.pekko.projection.r2dbc.base_url" ->
+      
s"https://pekko.apache.org/api/pekko-persistence-r2dbc/${Dependencies.PekkoPersistenceR2dbcVersionInDocs}";,
+      "scaladoc.org.apache.pekko.projection.base_url" ->
+      
s"https://pekko.apache.org/api/pekko-projection/${Dependencies.PekkoProjectionVersionInDocs}";,
+      "scaladoc.org.apache.pekko.base_url" -> 
s"https://pekko.apache.org/api/pekko/${Dependencies.PekkoVersionInDocs}";,
       "scaladoc.com.typesafe.config.base_url" -> 
s"https://lightbend.github.io/config/latest/api/";),
     apidocRootPackage := "org.apache.pekko",
     Compile / paradoxMarkdownToHtml / sourceGenerators += Def.taskDyn {
diff --git a/docs/src/main/paradox/projection.md 
b/docs/src/main/paradox/projection.md
index 48b6303..974e06a 100644
--- a/docs/src/main/paradox/projection.md
+++ b/docs/src/main/paradox/projection.md
@@ -206,7 +206,7 @@ Same type of handlers can be used with `R2dbcProjection` 
instead of `CassandraPr
 ### Actor handler
 
 A good alternative for advanced state management is to implement the handler 
as an 
-@extref:[actor](pekko:typed/typed/actors.html) which is described in 
+@extref:[actor](pekko:typed/actors.html) which is described in 
 @extref:[Processing with Actor](pekko-projection:actor.html).
 
 ### Flow handler
@@ -228,7 +228,7 @@ The supported offset types of the `R2dbcProjection` are:
 
 * @apidoc[pekko.persistence.query.TimestampOffset] that is used for 
@extref:[SourceProvider for 
eventsBySlices](pekko-projection:eventsourced.html#sourceprovider-for-eventsbyslices)
 and @extref:[SourceProvider for 
changesBySlices](pekko-projection:durable-state.html#sourceprovider-for-changesbyslices)
 * other @apidoc[pekko.persistence.query.Offset] types
-* @apidoc[MergeableOffset] that is used for @extref:[messages from 
Kafka](pekko-projection:kafka.md#mergeable-offset)
+* @apidoc[MergeableOffset] that is used for @extref:[messages from 
Kafka](pekko-projection:kafka.html#mergeable-offset)
 * `String`
 * `Int`
 * `Long`
diff --git a/project/Dependencies.scala b/project/Dependencies.scala
index 57f1048..b9bc0fa 100644
--- a/project/Dependencies.scala
+++ b/project/Dependencies.scala
@@ -20,6 +20,7 @@ object Dependencies {
   val PekkoVersion = System.getProperty("override.pekko.version", "1.0.1")
   val PekkoVersionInDocs = "1.0"
   val PekkoPersistenceJdbcVersion = "1.0.0"
+  val PekkoPersistenceR2dbcVersionInDocs = "1.0"
   val PekkoProjectionVersion = "1.0.0"
   val PekkoProjectionVersionInDocs = "1.0"
 
diff --git a/scripts/link-validator.conf b/scripts/link-validator.conf
new file mode 100644
index 0000000..ec9e40b
--- /dev/null
+++ b/scripts/link-validator.conf
@@ -0,0 +1,54 @@
+// config for https://github.com/ennru/site-link-validator/
+site-link-validator {
+  root-dir = "docs/target/paradox/site/main/"
+  # relative to `root-dir`
+  start-file = "index.html"
+
+  # Resolves URLs with the given prefix as local files instead
+  link-mappings = [
+    {
+      prefix = "https://pekko.apache.org/docs/pekko/current/";
+      replace = ""
+    }
+    # ScalaDoc from unidoc
+    {
+      prefix = "https://pekko.apache.org/api/pekko-persistence-r2dbc/current/";
+      replace = "/../../../../../target/scala-2.13/unidoc/"
+    }
+    {
+      prefix = "https://pekko.apache.org/api/pekko-persistence-r2dbc/current/";
+      replace = "/../../../../../target/scala-2.13/unidoc/"
+    }
+    {
+      prefix = "https://pekko.apache.org/api/pekko-persistence-r2dbc/snapshot/";
+      replace = "/../../../../../target/scala-2.13/unidoc/"
+    }
+  ]
+
+  ignore-missing-local-files-regex = ""
+  // e.g. 
"^api/alpakka/snapshot/pekko/stream/alpakka/googlecloud/storage/impl/Formats.*"
+
+  ignore-prefixes = [
+    # broken links for license report
+    "http://asm.objectweb.org";
+    "https://r2dbc.io/r2dbc-spi";
+  ]
+
+  non-https-whitelist = [
+    # http links in license report
+    "http://github.com/jnr/";
+    "http://github.com/slick/slick/blob/master/LICENSE.txt";
+    "http://junit.org";
+    "http://opensource.org/licenses/";
+    "http://www.opensource.org/licenses/";
+    "http://slick.typesafe.com";
+    "http://www.apache.org/licenses/";
+    "http://www.eclipse.org/legal/epl-v10.html";
+    "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html";
+    "http://www.reactive-streams.org/";
+    "http://www.scala-lang.org/";
+    "http://www.scalatest.org";
+    "http://www.slf4j.org";
+  ]
+
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to