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

royteeuwen pushed a commit to branch feature/SLING-13314-ssh-commit-signing
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-committer-cli.git

commit 7d3da850eb56f3ddee0ab69779838972bab84dda
Author: Roy Teeuwen <[email protected]>
AuthorDate: Thu Aug 20 21:22:33 2026 +0200

    SLING-13314 - do not sign the commits the CLI creates
    
    JGit reads commit.gpgsign from the ambient git config, but only jgit core 
is on the
    classpath and it registers no SignerFactory, so any committer who signs 
their commits
    hit UnsupportedSigningFormatException in all five places the tool commits.
    
    The container holds no key material and every commit the tool has ever made 
is
    unsigned, so ask for that explicitly rather than inheriting whatever the 
host config
    says. The resulting commit object is unchanged.
---
 .../java/org/apache/sling/cli/impl/release/UpdateLocalSiteCommand.java | 3 +++
 .../java/org/apache/sling/cli/impl/jbake/JBakeContentUpdaterTest.java  | 2 +-
 src/test/java/org/apache/sling/cli/impl/release/SiteRepository.java    | 1 +
 .../org/apache/sling/cli/impl/release/UpdateLocalSiteCommandTest.java  | 1 +
 .../java/org/apache/sling/cli/impl/release/UpdateLocalSiteGitTest.java | 1 +
 5 files changed, 7 insertions(+), 1 deletion(-)

diff --git 
a/src/main/java/org/apache/sling/cli/impl/release/UpdateLocalSiteCommand.java 
b/src/main/java/org/apache/sling/cli/impl/release/UpdateLocalSiteCommand.java
index 13ae7fc..0b5ce65 100644
--- 
a/src/main/java/org/apache/sling/cli/impl/release/UpdateLocalSiteCommand.java
+++ 
b/src/main/java/org/apache/sling/cli/impl/release/UpdateLocalSiteCommand.java
@@ -323,6 +323,9 @@ public class UpdateLocalSiteCommand extends 
AbstractReleaseCommand {
                     .setMessage(message)
                     .setAuthor(author.getName(), author.getEmail())
                     .setCommitter(author.getName(), author.getEmail())
+                    // never sign: the container holds no key material, and 
JGit fails outright rather
+                    // than skipping when the ambient git config asks for a 
signature it cannot produce
+                    .setSign(false)
                     .call();
             git.push()
                     .setCredentialsProvider(new 
UsernamePasswordCredentialsProvider(
diff --git 
a/src/test/java/org/apache/sling/cli/impl/jbake/JBakeContentUpdaterTest.java 
b/src/test/java/org/apache/sling/cli/impl/jbake/JBakeContentUpdaterTest.java
index 01c8e20..505baef 100644
--- a/src/test/java/org/apache/sling/cli/impl/jbake/JBakeContentUpdaterTest.java
+++ b/src/test/java/org/apache/sling/cli/impl/jbake/JBakeContentUpdaterTest.java
@@ -260,7 +260,7 @@ public class JBakeContentUpdaterTest {
                     .addFilepattern("news.md")
                     .call();
 
-            git.commit().setMessage("Initial commit").call();
+            git.commit().setMessage("Initial commit").setSign(false).call();
 
             Path releasesPath = Paths.get(new File(tmp.getRoot(), 
"releases.md").toURI());
             updater.updateReleases(releasesPath, releaseName, releaseVersion, 
releaseDate);
diff --git 
a/src/test/java/org/apache/sling/cli/impl/release/SiteRepository.java 
b/src/test/java/org/apache/sling/cli/impl/release/SiteRepository.java
index af9e648..1fe554a 100644
--- a/src/test/java/org/apache/sling/cli/impl/release/SiteRepository.java
+++ b/src/test/java/org/apache/sling/cli/impl/release/SiteRepository.java
@@ -76,6 +76,7 @@ class SiteRepository extends ExternalResource {
                     .setMessage("seed the site")
                     .setAuthor("Seed", "[email protected]")
                     .setCommitter("Seed", "[email protected]")
+                    .setSign(false)
                     .call();
             git.remoteAdd()
                     .setName("origin")
diff --git 
a/src/test/java/org/apache/sling/cli/impl/release/UpdateLocalSiteCommandTest.java
 
b/src/test/java/org/apache/sling/cli/impl/release/UpdateLocalSiteCommandTest.java
index 320ebca..f198e0c 100644
--- 
a/src/test/java/org/apache/sling/cli/impl/release/UpdateLocalSiteCommandTest.java
+++ 
b/src/test/java/org/apache/sling/cli/impl/release/UpdateLocalSiteCommandTest.java
@@ -249,6 +249,7 @@ public class UpdateLocalSiteCommandTest {
                     .setMessage("their work")
                     .setAuthor("Them", "[email protected]")
                     .setCommitter("Them", "[email protected]")
+                    .setSign(false)
                     .call();
         }
         Files.writeString(site.releases(), "and uncommitted on top\n", 
StandardCharsets.UTF_8);
diff --git 
a/src/test/java/org/apache/sling/cli/impl/release/UpdateLocalSiteGitTest.java 
b/src/test/java/org/apache/sling/cli/impl/release/UpdateLocalSiteGitTest.java
index e9f1e03..ff26db7 100644
--- 
a/src/test/java/org/apache/sling/cli/impl/release/UpdateLocalSiteGitTest.java
+++ 
b/src/test/java/org/apache/sling/cli/impl/release/UpdateLocalSiteGitTest.java
@@ -80,6 +80,7 @@ public class UpdateLocalSiteGitTest {
                     .setMessage("seed")
                     .setAuthor("Seed", "[email protected]")
                     .setCommitter("Seed", "[email protected]")
+                    .setSign(false)
                     .call();
             git.remoteAdd()
                     .setName("origin")

Reply via email to