You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[build] sign Java artifacts in-process with in-memory PGP keys instead of gpg-agent - #18130
Signs Java artifacts in-process through rules_jvm_external's in-memory PGP path instead of shelling out to a gpg-agent populated by crazy-max/ghaction-import-gpg.
Signs nightly Java snapshots too, so the release signing path runs daily instead of only at release time.
This prevents the error we had during the 4.50.0 release where Java publish failed partway through with gpg: signing failed: Inappropriate ioctl for device after gpg-agent dropped the preset passphrase.
🔧 Implementation Notes
java.rake derives the publisher's PGP_SIGNING_KEY/PGP_SIGNING_PWD from the existing GPG_PRIVATE_KEY/GPG_PASSPHRASE secrets, base64-encoding the key when it is armored, the same way Sonatype.load_credentials maps SEL_M2_USER to MAVEN_USER; a gpg binary is no longer needed anywhere in the release path.
The two secrets join the other publishing secrets in the bazel.yml job env, so the gpg-sign input is gone; only the nightly and release workflows inherit secrets.
The publisher signs with the keyring's primary key, which is sign-capable and is the key that has signed every release so far, so no new secret is needed.
Verified locally by publishing selenium-json to a file: repo with a throwaway key: the publisher logs in-memory signing and verification per artifact and gpg --verify accepts each .asc.
🤖 AI assistance
AI assisted (complete below)
Tool(s): Claude Code (Fable 5.1)
What was generated: the rules_jvm_external source review, the release-key inspection, the rake and workflow changes, the local dry run, and this description
I reviewed all AI output and can explain the change
Sign Java releases and nightly snapshots without gpg-agent
🐞 Bug fix⚙️ Configuration changes🕐 20-40 Minutes
AI Description
• Move Java artifact signing in-process to avoid gpg-agent passphrase failures during publishing.
• Sign nightly snapshots as well as releases, exercising the signing path daily.
• Pass existing GPG secrets to the publisher and remove the workflow's GPG import step.
Use the publisher's existing in-memory PGP path. Retaining external GPG with agent or loopback configuration would preserve another process-level signing dependency and would not address the failure as directly.
Files changed (3) +16 / -21
Bug fix (1) +14 / -9
java.rakeConfigure in-memory PGP signing for Java publishing+14/-9
Configure in-memory PGP signing for Java publishing
• Maps the existing GPG secrets to publisher credentials, base64-encoding an armored key, and requires them for both releases and nightlies. Enables in-memory signing, disables the external GPG path, and removes the gpg-binary check.
bazel.ymlExpose signing secrets without importing a GPG key+2/-11
Expose signing secrets without importing a GPG key
• Adds the existing private key and passphrase secrets to the reusable Bazel job environment. Removes its optional gpg-sign input and GPG-import action.
1. Non-Java jobs receive the signing key✗ Dismissed
Description
The reusable Bazel job places GPG_PRIVATE_KEY and GPG_PASSPHRASE in job-wide environment
variables instead of supplying them only to Java publishing. Release and nightly publishing both
call that workflow with inherited secrets across language matrices, so non-Java commands and their
setup steps receive the Java private key and passphrase even when they do not publish Java
artifacts.
The added variables are declared at the reusable job's scope. Both publishing workflows invoke that
job with secrets: inherit for matrices containing Java and other languages; the reusable job also
runs setup and publish steps within that scope.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The reusable Bazel workflow exposes the Java signing key and passphrase to every publishing language job, expanding access beyond Java publishing.
## Fix Focus Areas
- .github/workflows/bazel.yml[100-104]
- .github/workflows/release.yml[150-164]
- .github/workflows/nightly.yml[79-92]
## Recommended Fix
Add an explicit Java-signing input to the reusable workflow and conditionally populate the signing environment variables only for Java publish invocations. Set that input for Java in both the release and nightly callers.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
B-buildIncludes scripting, bazel and CI integrations
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💥 What does this PR do?
crazy-max/ghaction-import-gpg.This prevents the error we had during the 4.50.0 release where Java publish failed partway through with
gpg: signing failed: Inappropriate ioctl for deviceafter gpg-agent dropped the preset passphrase.🔧 Implementation Notes
java.rakederives the publisher'sPGP_SIGNING_KEY/PGP_SIGNING_PWDfrom the existingGPG_PRIVATE_KEY/GPG_PASSPHRASEsecrets, base64-encoding the key when it is armored, the same waySonatype.load_credentialsmapsSEL_M2_USERtoMAVEN_USER; agpgbinary is no longer needed anywhere in the release path.bazel.ymljob env, so thegpg-signinput is gone; only the nightly and release workflows inherit secrets.selenium-jsonto afile:repo with a throwaway key: the publisher logs in-memory signing and verification per artifact andgpg --verifyaccepts each.asc.🤖 AI assistance
🔄 Types of changes