Skip to content

Commit

Permalink
Pull release notes from keycloak-client repository
Browse files Browse the repository at this point in the history
Closes #547

Signed-off-by: Jon Koops <[email protected]>
  • Loading branch information
jonkoops committed Jan 23, 2025
1 parent 9080596 commit f8c7f7e
Show file tree
Hide file tree
Showing 177 changed files with 519 additions and 64 deletions.
30 changes: 30 additions & 0 deletions add-version-client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash -e

VERSION=$1
if [ "$VERSION" == "" ]; then
echo "usage: add-version-client.sh VERSION"
exit 1
fi

VERSION_NAME=`echo $VERSION | sed 's/.Final//' | sed 's/.CR[[:digit:]]//'`
DATE=`date +%F`

if [[ "$VERSION" == *".0" ]]; then
TEMPLATE="version-template.json"
else
TEMPLATE="versions/keycloak-client/${VERSION%.*}.0.json"
fi

if [ ! -f "$TEMPLATE" ]; then
echo "$TEMPLATE not found"
exit
fi

cat $TEMPLATE | sed "s/\"version\":.*/\"version\": \"$VERSION\",/" | sed 's/"date": ".*"/"date": "DATE"/' | sed "s/DATE/$DATE/" > versions/keycloak-client/$VERSION_NAME.json

CURRENT=`cat pom.xml | grep '<version.keycloak.client>' | cut -d '>' -f 2 | cut -d '<' -f 1`
LATEST=`echo -e "$CURRENT\n$VERSION" | sort -V -r | head -n 1`

sed -i "s|<version.keycloak.client>$CURRENT</version.keycloak.client>|<version.keycloak.client>$LATEST</version.keycloak.client>|g" pom.xml

mvn install
6 changes: 3 additions & 3 deletions add-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ fi
VERSION_NAME=`echo $VERSION | sed 's/.Final//' | sed 's/.CR[[:digit:]]//'`
DATE=`date +%F`

if [[ "$VERSION" == *".0" ]]; then
if [[ "$VERSION" == *".0" ]]; then
TEMPLATE="version-template.json"
else
TEMPLATE="versions/${VERSION%.*}.0.json"
TEMPLATE="versions/keycloak/{VERSION%.*}.0.json"
fi

if [ ! -f "$TEMPLATE" ]; then
echo "$TEMPLATE not found"
exit
fi

cat $TEMPLATE | sed "s/\"version\":.*/\"version\": \"$VERSION\",/" | sed 's/"date": ".*"/"date": "DATE"/' | sed "s/DATE/$DATE/" > versions/$VERSION_NAME.json
cat $TEMPLATE | sed "s/\"version\":.*/\"version\": \"$VERSION\",/" | sed 's/"date": ".*"/"date": "DATE"/' | sed "s/DATE/$DATE/" > versions/keycloak/$VERSION_NAME.json

CURRENT=`cat pom.xml | grep '<version.keycloak>' | cut -d '>' -f 2 | cut -d '<' -f 1`
LATEST=`echo -e "$CURRENT\n$VERSION" | sort -V -r | head -n 1`
Expand Down
15 changes: 15 additions & 0 deletions cache/releases/keycloak-client/26.0.1/changelog.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[ {
"number" : 89,
"repository" : "keycloak-client",
"title" : "ClientTest failing with latest Keycloak nightly",
"kind" : "bug",
"area" : "admin-client",
"url" : "https://github.com/keycloak/keycloak-client/issues/89"
}, {
"number" : 92,
"repository" : "keycloak-client",
"title" : "Setup CI during nightly build",
"kind" : "enhancement",
"area" : null,
"url" : "https://github.com/keycloak/keycloak-client/issues/92"
} ]
20 changes: 20 additions & 0 deletions cache/releases/keycloak-client/26.0.1/gh-release-notes.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<div>

<h2>Upgrading</h2>
<p>Before upgrading refer to <a href="https://www.keycloak.org/docs/latest/upgrading/index.html#migration-changes">the migration guide</a> for a complete list of changes.</p>

<h2>All resolved issues</h2>



<h3>Enhancements</h3>
<ul>
<li><a href="https://github.com/keycloak/keycloak-client/issues/92">#92</a> Setup CI during nightly build <code>client</code></li>
</ul>

<h3>Bugs</h3>
<ul>
<li><a href="https://github.com/keycloak/keycloak-client/issues/89">#89</a> ClientTest failing with latest Keycloak nightly <code>client</code></li>
</ul>

</div>
File renamed without changes.
22 changes: 22 additions & 0 deletions cache/releases/keycloak-client/26.0.2/changelog.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[ {
"number" : 92,
"repository" : "keycloak-client",
"title" : "Setup CI during nightly build",
"kind" : "enhancement",
"area" : null,
"url" : "https://github.com/keycloak/keycloak-client/issues/92"
}, {
"number" : 94,
"repository" : "keycloak-client",
"title" : "Tests failing with latest Keycloak server nightly",
"kind" : "bug",
"area" : null,
"url" : "https://github.com/keycloak/keycloak-client/issues/94"
}, {
"number" : 99,
"repository" : "keycloak-client",
"title" : "Sync with keycloak server 26.0.4",
"kind" : "enhancement",
"area" : "admin-client",
"url" : "https://github.com/keycloak/keycloak-client/issues/99"
} ]
21 changes: 21 additions & 0 deletions cache/releases/keycloak-client/26.0.2/gh-release-notes.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<div>

<h2>Upgrading</h2>
<p>Before upgrading refer to <a href="https://www.keycloak.org/docs/latest/upgrading/index.html#migration-changes">the migration guide</a> for a complete list of changes.</p>

<h2>All resolved issues</h2>



<h3>Enhancements</h3>
<ul>
<li><a href="https://github.com/keycloak/keycloak-client/issues/92">#92</a> Setup CI during nightly build <code>client</code></li>
<li><a href="https://github.com/keycloak/keycloak-client/issues/99">#99</a> Sync with keycloak server 26.0.4 <code>client</code></li>
</ul>

<h3>Bugs</h3>
<ul>
<li><a href="https://github.com/keycloak/keycloak-client/issues/94">#94</a> Tests failing with latest Keycloak server nightly <code>client</code></li>
</ul>

</div>
File renamed without changes.
36 changes: 36 additions & 0 deletions cache/releases/keycloak-client/26.0.3/changelog.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[ {
"number" : 87,
"repository" : "keycloak-client",
"title" : "Setup nightly action to sync from keycloak server main",
"kind" : "task",
"area" : null,
"url" : "https://github.com/keycloak/keycloak-client/issues/87"
}, {
"number" : 90,
"repository" : "keycloak-client",
"title" : "Update MD files ",
"kind" : "enhancement",
"area" : null,
"url" : "https://github.com/keycloak/keycloak-client/issues/90"
}, {
"number" : 93,
"repository" : "keycloak-client",
"title" : "Move upgrading guide for keycloak-client libraries to the client documentation",
"kind" : "enhancement",
"area" : "docs",
"url" : "https://github.com/keycloak/keycloak-client/issues/93"
}, {
"number" : 101,
"repository" : "keycloak-client",
"title" : "Setup GH action (or script), which will send PR for automatically sync with keycloak server",
"kind" : "enhancement",
"area" : null,
"url" : "https://github.com/keycloak/keycloak-client/issues/101"
}, {
"number" : 105,
"repository" : "keycloak-client",
"title" : "Unnecessary `httpclient` dependency in `keycloak-client-common-synced` module",
"kind" : "bug",
"area" : null,
"url" : "https://github.com/keycloak/keycloak-client/issues/105"
} ]
22 changes: 22 additions & 0 deletions cache/releases/keycloak-client/26.0.3/gh-release-notes.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<div>

<h2>Upgrading</h2>
<p>Before upgrading refer to <a href="https://www.keycloak.org/docs/latest/upgrading/index.html#migration-changes">the migration guide</a> for a complete list of changes.</p>

<h2>All resolved issues</h2>



<h3>Enhancements</h3>
<ul>
<li><a href="https://github.com/keycloak/keycloak-client/issues/90">#90</a> Update MD files <code>client</code></li>
<li><a href="https://github.com/keycloak/keycloak-client/issues/93">#93</a> Move upgrading guide for keycloak-client libraries to the client documentation <code>client</code></li>
<li><a href="https://github.com/keycloak/keycloak-client/issues/101">#101</a> Setup GH action (or script), which will send PR for automatically sync with keycloak server <code>client</code></li>
</ul>

<h3>Bugs</h3>
<ul>
<li><a href="https://github.com/keycloak/keycloak-client/issues/105">#105</a> Unnecessary `httpclient` dependency in `keycloak-client-common-synced` module <code>client</code></li>
</ul>

</div>
File renamed without changes.
43 changes: 43 additions & 0 deletions cache/releases/keycloak-client/26.0.4/changelog.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[ {
"number" : 115,
"repository" : "keycloak-client",
"title" : "ProviderTest failing with latest nightly build",
"kind" : "bug",
"area" : null,
"url" : "https://github.com/keycloak/keycloak-client/issues/115"
}, {
"number" : 117,
"repository" : "keycloak-client",
"title" : "Remove JEE from the title of GH actions",
"kind" : "enhancement",
"area" : null,
"url" : "https://github.com/keycloak/keycloak-client/issues/117"
}, {
"number" : 124,
"repository" : "keycloak-client",
"title" : "The action \"Sync with Keycloak Server and send PR with changes\" sends PR, which does not have DCO on the commit",
"kind" : "bug",
"area" : null,
"url" : "https://github.com/keycloak/keycloak-client/issues/124"
}, {
"number" : 127,
"repository" : "keycloak-client",
"title" : "Sync after Keycloak server 26.1.0 release",
"kind" : "enhancement",
"area" : null,
"url" : "https://github.com/keycloak/keycloak-client/issues/127"
}, {
"number" : 129,
"repository" : "keycloak-client",
"title" : "The action \"Sync with Keycloak Server and send PR with changes\" takes only client-common-synced into consideration",
"kind" : "bug",
"area" : null,
"url" : "https://github.com/keycloak/keycloak-client/issues/129"
}, {
"number" : 130,
"repository" : "keycloak-client",
"title" : "Test with keycloak server images 24.0, 26.0 and 26.1",
"kind" : "enhancement",
"area" : null,
"url" : "https://github.com/keycloak/keycloak-client/issues/130"
} ]
24 changes: 24 additions & 0 deletions cache/releases/keycloak-client/26.0.4/gh-release-notes.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<div>

<h2>Upgrading</h2>
<p>Before upgrading refer to <a href="https://www.keycloak.org/docs/latest/upgrading/index.html#migration-changes">the migration guide</a> for a complete list of changes.</p>

<h2>All resolved issues</h2>



<h3>Enhancements</h3>
<ul>
<li><a href="https://github.com/keycloak/keycloak-client/issues/117">#117</a> Remove JEE from the title of GH actions <code>client</code></li>
<li><a href="https://github.com/keycloak/keycloak-client/issues/127">#127</a> Sync after Keycloak server 26.1.0 release <code>client</code></li>
<li><a href="https://github.com/keycloak/keycloak-client/issues/130">#130</a> Test with keycloak server images 24.0, 26.0 and 26.1 <code>client</code></li>
</ul>

<h3>Bugs</h3>
<ul>
<li><a href="https://github.com/keycloak/keycloak-client/issues/115">#115</a> ProviderTest failing with latest nightly build <code>client</code></li>
<li><a href="https://github.com/keycloak/keycloak-client/issues/124">#124</a> The action "Sync with Keycloak Server and send PR with changes" sends PR, which does not have DCO on the commit <code>client</code></li>
<li><a href="https://github.com/keycloak/keycloak-client/issues/129">#129</a> The action "Sync with Keycloak Server and send PR with changes" takes only client-common-synced into consideration <code>client</code></li>
</ul>

</div>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions releases.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sources:
- id: keycloak
productName: Keycloak
repo: keycloak/keycloak
githubReleaseFrom: 23.0.0
releaseNotes: release/${version.getVersionShorter()}/docs/documentation/release_notes/topics/${version.getVersion()?replace(".", "_")}.adoc
attributeSources:
- release/${version.getVersionShorter()}/docs/documentation/topics/templates/document-attributes.adoc
- ${version.getVersion()}/docs/documentation/topics/templates/document-attributes.adoc
- id: keycloak-client
productName: Keycloak Client Libraries
repo: keycloak/keycloak-client
githubReleaseFrom: 26.0.1
releaseNotes: main/docs/release-notes/${version.getVersion()?replace(".", "_")}.adoc
40 changes: 23 additions & 17 deletions src/main/java/org/keycloak/webbuilder/Blogs.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package org.keycloak.webbuilder;

import org.keycloak.webbuilder.utils.AsciiDoctor;
import org.keycloak.webbuilder.utils.FreeMarker;

import java.io.File;
import java.util.*;

Expand All @@ -17,15 +14,9 @@ public class Blogs extends LinkedList<Blogs.Blog> {
OLD_BLOG.add(Calendar.MONTH, -12);
}

private FreeMarker freeMarker;
private AsciiDoctor asciiDoctor;

public Blogs(File blogDir, Versions versions, Config config, FreeMarker freeMarker, AsciiDoctor asciiDoctor) throws Exception {
this.freeMarker = freeMarker;
this.asciiDoctor = asciiDoctor;

public Blogs(Context context) throws Exception {
List<File> blogFiles = new LinkedList<>();
for (File d : blogDir.listFiles((dir, name) -> name.matches("\\d{4}"))) {
for (File d : context.getBlogDir().listFiles((dir, name) -> name.matches("\\d{4}"))) {
for (File f: d.listFiles((dir, name) -> name.endsWith(".ftl") || name.endsWith(".adoc"))) {
blogFiles.add(f);
}
Expand All @@ -34,7 +25,7 @@ public Blogs(File blogDir, Versions versions, Config config, FreeMarker freeMark
if (blogFiles != null) {
for (File f : blogFiles) {
BlogFormat format = f.getName().endsWith(".ftl") ? BlogFormat.FREEMARKER : BlogFormat.ASCIIDOC;
Map<String, Object> attributes = BlogFormat.FREEMARKER.equals(format) ? freeMarker.parseAttributes(f) : asciiDoctor.parseAttributes(f);
Map<String, Object> attributes = BlogFormat.FREEMARKER.equals(format) ? context.freeMarker().parseAttributes(f) : context.asciiDoctor().parseAttributes(f);

Date date = attributes.containsKey("date") ? Constants.DATE_IN.parse(attributes.get("date").toString()) : null;
boolean publish = attributes.containsKey("publish") ? Boolean.parseBoolean((String) attributes.get("publish")) : false;
Expand All @@ -58,16 +49,31 @@ public Blogs(File blogDir, Versions versions, Config config, FreeMarker freeMark
false,
"blog/" + f.getParentFile().getName() + "/" + f.getName());

if (blog.isPublish() || !config.isPublish()) {
if (blog.isPublish() || !context.config().isPublish()) {
add(blog);
}
}
}

for (Versions.Version v : versions) {
Blog blog = new Blog(BlogFormat.FREEMARKER, v.getDate(), "keycloak-" + v.getVersion().replace(".", "") + "-released", "Keycloak " + v.getVersion() + " released", null, null, "Keycloak Release", true, true, "templates/blog-release-" + v.getBlogTemplate() + ".ftl");
blog.getMap().put("version", v);
add(blog);
ReleasesMetadata metadata = context.getReleasesMetadata();

for (ReleasesMetadata.ReleaseSource source : metadata.getSources()) {
for (Versions.Version v : context.versionsFor(source.getId())) {
Blog blog = new Blog(
BlogFormat.FREEMARKER,
v.getDate(),
source.getId() + "-" + v.getVersion().replace(".", "") + "-released",
source.getProductName() + " " + v.getVersion() + " released",
null,
null,
source.getProductName() + " Release",
true,
true,
"templates/blog-release-" + v.getBlogTemplate() + ".ftl"
);
blog.getMap().put("version", v);
add(blog);
}
}

sort(Comparator.comparing(Blog::getDate).reversed());
Expand Down
Loading

0 comments on commit f8c7f7e

Please sign in to comment.