fix wrong regex for commit-refs

Tue, 25 Jul 2023 18:19:04 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 25 Jul 2023 18:19:04 +0200
changeset 288
10324c383126
parent 287
2aabfe7709c4
child 289
d702bdd4da51

fix wrong regex for commit-refs

and also adds some more - fixes #279

build.gradle.kts file | annotate | diff | comparison | revisions
src/main/kotlin/de/uapcore/lightpit/types/CommitRef.kt file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/changelogs/changelog-de.jspf file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/changelogs/changelog.jspf file | annotate | diff | comparison | revisions
src/test/kotlin/de/uapcore/lightpit/types/CommitRefTest.kt file | annotate | diff | comparison | revisions
     1.1 --- a/build.gradle.kts	Sun Jul 23 18:57:33 2023 +0200
     1.2 +++ b/build.gradle.kts	Tue Jul 25 18:19:04 2023 +0200
     1.3 @@ -5,7 +5,7 @@
     1.4      war
     1.5  }
     1.6  group = "de.uapcore"
     1.7 -version = "1.1.0"
     1.8 +version = "1.1.1"
     1.9  
    1.10  repositories {
    1.11      mavenCentral()
     2.1 --- a/src/main/kotlin/de/uapcore/lightpit/types/CommitRef.kt	Sun Jul 23 18:57:33 2023 +0200
     2.2 +++ b/src/main/kotlin/de/uapcore/lightpit/types/CommitRef.kt	Tue Jul 25 18:19:04 2023 +0200
     2.3 @@ -53,7 +53,7 @@
     2.4          if (currentHash.isEmpty()) continue
     2.5  
     2.6          // scan the lines for commit references
     2.7 -        Regex("""(?:relates to|fix(?:es)?|close(?:es)?) #(\d+)""")
     2.8 +        Regex("""(?:issue|relates? to|fix(?:e[sd])?|close(?:[sd])?) \#(\d+)""")
     2.9              .findAll(line)
    2.10              .map { it.groupValues[1] }
    2.11              .map { it.toIntOrNull() }
     3.1 --- a/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf	Sun Jul 23 18:57:33 2023 +0200
     3.2 +++ b/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf	Tue Jul 25 18:19:04 2023 +0200
     3.3 @@ -24,6 +24,15 @@
     3.4    --%>
     3.5  <%@ page contentType="text/html;charset=UTF-8" %>
     3.6  
     3.7 +<h3>Version 1.1.1</h3>
     3.8 +
     3.9 +<ul>
    3.10 +    <li>
    3.11 +        Fehlende Unterstützung für Commit-Referenzen hinzugefügt. Es werden nun unterstützt:<br>
    3.12 +        issue, relate to, relates to, fix, fixes, fixed, close, closes, closed
    3.13 +    </li>
    3.14 +</ul>
    3.15 +
    3.16  <h3>Version 1.1.0</h3>
    3.17  
    3.18  <ul>
     4.1 --- a/src/main/webapp/WEB-INF/changelogs/changelog.jspf	Sun Jul 23 18:57:33 2023 +0200
     4.2 +++ b/src/main/webapp/WEB-INF/changelogs/changelog.jspf	Tue Jul 25 18:19:04 2023 +0200
     4.3 @@ -24,6 +24,15 @@
     4.4    --%>
     4.5  <%@ page contentType="text/html;charset=UTF-8" %>
     4.6  
     4.7 +<h3>Version 1.1.1</h3>
     4.8 +
     4.9 +<ul>
    4.10 +    <li>
    4.11 +        Add support for missing commit-ref verbs. Now supported are:<br>
    4.12 +        issue, relate to, relates to, fix, fixes, fixed, close, closes, closed
    4.13 +    </li>
    4.14 +</ul>
    4.15 +
    4.16  <h3>Version 1.1.0</h3>
    4.17  
    4.18  <ul>
     5.1 --- a/src/test/kotlin/de/uapcore/lightpit/types/CommitRefTest.kt	Sun Jul 23 18:57:33 2023 +0200
     5.2 +++ b/src/test/kotlin/de/uapcore/lightpit/types/CommitRefTest.kt	Tue Jul 25 18:19:04 2023 +0200
     5.3 @@ -32,30 +32,33 @@
     5.4  class CommitRefTest {
     5.5  
     5.6      @Test
     5.7 -    fun readCommitLog() {
     5.8 +    fun parseCommitRefs() {
     5.9          assertContentEquals(
    5.10              listOf(
    5.11                  CommitRef("cf9f5982ddeb28c7f695dc547fe73abf5460016f", 50, "here we fix #50"),
    5.12                  CommitRef("cf9f5982ddeb28c7f695dc547fe73abf5460016f", 30, "here we fix #50"),
    5.13 +                CommitRef("cf9f5982ddeb28c7f695dc547fe73abf5460016f", 80, "here we fix #50"),
    5.14                  CommitRef(
    5.15                      "ed7134e5f4ce278c4f62798fb9f96129be2b132b",
    5.16                      1337,
    5.17 -                    "commit with a #non-ref, relates to #wrong ref but still fixes #1337"
    5.18 +                    "commit with a #non-ref, relates to #wrong ref but still closes #1337"
    5.19                  ),
    5.20 -                CommitRef("74d770da3c80c0c3fc1fb7e44fb710d665127dfe", 47, "a change with commitref in body"),
    5.21 -                CommitRef("9a14e5628bdf2d578f3385d78022ddcaf23d1abb", 47, "add test file - relates to #47")
    5.22 +                CommitRef("74d770da3c80c0c3fc1fb7e44fb710d665127dfe", 47, "a change with commitrefs only in body"),
    5.23 +                CommitRef("74d770da3c80c0c3fc1fb7e44fb710d665127dfe", 13, "a change with commitrefs only in body"),
    5.24 +                CommitRef("9a14e5628bdf2d578f3385d78022ddcaf23d1abb", 47, "add test file - closed #47 and fixed #90"),
    5.25 +                CommitRef("9a14e5628bdf2d578f3385d78022ddcaf23d1abb", 90, "add test file - closed #47 and fixed #90")
    5.26              ),
    5.27 -            parseCommitRefs(
    5.28 -                """::lpitref:cf9f5982ddeb28c7f695dc547fe73abf5460016f:here we fix #50
    5.29 +            parseCommitRefs("""
    5.30 +::lpitref:cf9f5982ddeb28c7f695dc547fe73abf5460016f:here we fix #50
    5.31  
    5.32 -and close #30
    5.33 -::lpitref:ed7134e5f4ce278c4f62798fb9f96129be2b132b:commit with a #non-ref, relates to #wrong ref but still fixes #1337
    5.34 -::lpitref:74d770da3c80c0c3fc1fb7e44fb710d665127dfe:a change with commitref in body
    5.35 +and close #30 which blocked issue #80
    5.36 +::lpitref:ed7134e5f4ce278c4f62798fb9f96129be2b132b:commit with a #non-ref, relates to #wrong ref but still closes #1337
    5.37 +::lpitref:74d770da3c80c0c3fc1fb7e44fb710d665127dfe:a change with commitrefs only in body
    5.38  
    5.39  some more details
    5.40 -fixes #47
    5.41 +fixes #47 and relates to #13
    5.42  ::lpitref:d533c717dfecb8e4b993ca6c8760f1493bc834b6:no commitref
    5.43 -::lpitref:9a14e5628bdf2d578f3385d78022ddcaf23d1abb:add test file - relates to #47
    5.44 +::lpitref:9a14e5628bdf2d578f3385d78022ddcaf23d1abb:add test file - closed #47 and fixed #90
    5.45  """
    5.46              )
    5.47          )

mercurial