You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2026/08/16 14:42:52 UTC
(juneau) 01/01: Import Juneau Release Manager as maintainer dev-tooling (TODO-376)
This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch release-manager
in repository https://gitbox.apache.org/repos/asf/juneau.git
commit 27da3eeba0df5b136fc9714795ecf1fb15dc79e0
Author: James Bognar <ja...@apache.org>
AuthorDate: Sun Aug 16 10:42:36 2026 -0400
Import Juneau Release Manager as maintainer dev-tooling (TODO-376)
- Initial import of the Juneau Release Manager onto the release-manager orphan
branch, mirroring the docs branch. Project-owned release automation (Juneau
REST + FreeMarker View + macOS Keychain), license-audited: AL2.0 headers
throughout, MIT-vendored jQuery/DataTables attributed in LICENSE, apache-rat
enforced.
- Not part of the signed release train. Depends on 10.0.0-SNAPSHOT pending
10.0 GA.
- Audited tree imported from jamesbognar/juneau-release-manager
@ f059623ea8195d675f00cfcdfdeceb1e74adc6de. Landed with PMC buy-in.
---
.gitignore | 7 +
.settings/org.eclipse.core.resources.prefs | 6 +
.settings/org.eclipse.jdt.core.prefs | 135 ++++
.settings/org.eclipse.jdt.ui.prefs | 68 ++
.settings/org.eclipse.m2e.core.prefs | 4 +
CODE-CONVENTIONS.md | 152 +++++
LICENSE | 258 +++++++
README.md | 52 ++
pom.xml | 136 ++++
push.py | 175 +++++
src/main/java/org/apache/juneau/releng/App.java | 30 +
.../org/apache/juneau/releng/AppConfiguration.java | 374 +++++++++++
.../java/org/apache/juneau/releng/RootRest.java | 34 +
.../apache/juneau/releng/config/TargetProfile.java | 43 ++
.../juneau/releng/credential/AccountStore.java | 89 +++
.../releng/credential/ApacheLdapValidator.java | 63 ++
.../releng/credential/CredentialService.java | 131 ++++
.../juneau/releng/credential/CredentialSpec.java | 53 ++
.../juneau/releng/credential/CredentialStatus.java | 36 +
.../releng/credential/GithubTokenValidator.java | 39 ++
.../juneau/releng/credential/GpgValidator.java | 44 ++
.../apache/juneau/releng/credential/Validator.java | 33 +
.../apache/juneau/releng/email/EmailService.java | 116 ++++
.../apache/juneau/releng/email/EmailTemplate.java | 38 ++
.../juneau/releng/engine/BranchResolver.java | 53 ++
.../apache/juneau/releng/engine/DropRcService.java | 174 +++++
.../apache/juneau/releng/engine/ExecutionMode.java | 37 ++
.../org/apache/juneau/releng/engine/Preview.java | 43 ++
.../juneau/releng/engine/RcHistoryEntry.java | 34 +
.../apache/juneau/releng/engine/ReleaseEngine.java | 374 +++++++++++
.../apache/juneau/releng/engine/ReleaseStep.java | 49 ++
.../org/apache/juneau/releng/engine/RunState.java | 73 ++
.../apache/juneau/releng/engine/RunStateStore.java | 96 +++
.../org/apache/juneau/releng/engine/RunStatus.java | 23 +
.../apache/juneau/releng/engine/StepContext.java | 119 ++++
.../apache/juneau/releng/engine/StepRegistry.java | 78 +++
.../apache/juneau/releng/engine/StepResult.java | 40 ++
.../org/apache/juneau/releng/engine/StepState.java | 37 ++
.../apache/juneau/releng/engine/StepStatus.java | 26 +
.../engine/steps/BinaryArtifactsStageStep.java | 132 ++++
.../releng/engine/steps/BuildVerifyStep.java | 48 ++
.../engine/steps/ComposeAnnouncementEmailStep.java | 56 ++
.../engine/steps/ComposeProposeEmailStep.java | 52 ++
.../engine/steps/ComposeResultEmailStep.java | 57 ++
.../releng/engine/steps/ComposeVoteEmailStep.java | 81 +++
.../releng/engine/steps/DeploySnapshotStep.java | 59 ++
.../releng/engine/steps/DevDistVerifyStep.java | 104 +++
.../releng/engine/steps/DistPromoteStep.java | 116 ++++
.../releng/engine/steps/FinalizeRunStep.java | 49 ++
.../engine/steps/GithubReleaseCreateStep.java | 70 ++
.../releng/engine/steps/JavadocVerifyStep.java | 60 ++
.../engine/steps/ManualFollowupChecklistStep.java | 62 ++
.../releng/engine/steps/MilestoneCloseStep.java | 60 ++
.../releng/engine/steps/NexusReleaseStep.java | 57 ++
.../releng/engine/steps/NexusStagingCloseStep.java | 69 ++
.../juneau/releng/engine/steps/PreflightStep.java | 72 ++
.../releng/engine/steps/ReleaseDiffReviewStep.java | 54 ++
.../releng/engine/steps/ReleasePerformStep.java | 55 ++
.../releng/engine/steps/ReleasePrepareStep.java | 79 +++
.../releng/engine/steps/TallyVoteResultStep.java | 51 ++
.../engine/steps/TestWorkspaceVerifyStep.java | 95 +++
.../juneau/releng/engine/steps/VoteGateStep.java | 50 ++
.../releng/engine/steps/WorkspaceSetupStep.java | 74 +++
.../apache/juneau/releng/log/LogBroadcaster.java | 46 ++
.../java/org/apache/juneau/releng/log/RunLog.java | 94 +++
.../apache/juneau/releng/log/SseLogServlet.java | 149 +++++
.../juneau/releng/log/VoteDeadlineTimer.java | 60 ++
.../juneau/releng/milestone/ChangelogEntry.java | 70 ++
.../juneau/releng/milestone/GithubPrSource.java | 74 +++
.../juneau/releng/milestone/MilestoneService.java | 70 ++
.../juneau/releng/milestone/PullRequest.java | 34 +
.../releng/nexus/MavenSettingsCredentials.java | 86 +++
.../apache/juneau/releng/nexus/NexusMockModel.java | 139 ++++
.../apache/juneau/releng/nexus/NexusMockRest.java | 119 ++++
.../juneau/releng/nexus/NexusStagingClient.java | 176 +++++
.../apache/juneau/releng/nexus/StagingRepo.java | 40 ++
.../juneau/releng/release/GitTagReleaseSource.java | 50 ++
.../juneau/releng/release/GithubReleaseSource.java | 62 ++
.../releng/release/LocalStateReleaseSource.java | 58 ++
.../org/apache/juneau/releng/release/Release.java | 44 ++
.../juneau/releng/release/ReleaseListService.java | 68 ++
.../juneau/releng/release/ReleaseVersion.java | 139 ++++
.../apache/juneau/releng/rest/CredentialRest.java | 89 +++
.../org/apache/juneau/releng/rest/HomeRest.java | 43 ++
.../apache/juneau/releng/rest/MilestoneRest.java | 81 +++
.../org/apache/juneau/releng/rest/ReleaseRest.java | 58 ++
.../apache/juneau/releng/rest/ReleaseRunRest.java | 204 ++++++
.../apache/juneau/releng/util/ProcessRunner.java | 173 +++++
src/main/resources/application.properties | 27 +
src/main/resources/static/css/chrome.css | 738 +++++++++++++++++++++
src/main/resources/static/css/new-release.css | 532 +++++++++++++++
.../datatables/dataTables.dataTables.min.css | 1 +
.../resources/static/datatables/dataTables.min.js | 4 +
src/main/resources/static/datatables/jquery.min.js | 2 +
src/main/resources/static/index.html | 28 +
src/main/resources/static/js/credentials.js | 38 ++
src/main/resources/static/js/new-release.js | 175 +++++
src/main/resources/static/js/releases.js | 26 +
src/main/resources/templates/base.ftlh | 71 ++
src/main/resources/templates/credentials.ftlh | 41 ++
src/main/resources/templates/home.ftlh | 42 ++
src/main/resources/templates/new-release.ftlh | 91 +++
src/main/resources/templates/releases.ftlh | 59 ++
.../apache/juneau/releng/AppConfigurationTest.java | 134 ++++
.../juneau/releng/credential/AccountStoreTest.java | 76 +++
.../releng/credential/CredentialServiceTest.java | 133 ++++
.../juneau/releng/credential/GpgValidatorTest.java | 84 +++
.../juneau/releng/email/EmailServiceTest.java | 118 ++++
.../juneau/releng/engine/BranchResolverTest.java | 79 +++
.../juneau/releng/engine/DropRcServiceTest.java | 174 +++++
.../juneau/releng/engine/ReleaseEngineTest.java | 167 +++++
.../juneau/releng/engine/ReviewGateTest.java | 89 +++
.../juneau/releng/engine/RunStateStoreTest.java | 66 ++
.../apache/juneau/releng/engine/RunStateTest.java | 63 ++
.../juneau/releng/engine/SafeModeGuardTest.java | 124 ++++
.../juneau/releng/engine/SecretsOffArgvTest.java | 119 ++++
.../juneau/releng/engine/StepRegistryTest.java | 56 ++
.../engine/steps/BinaryArtifactsStageStepTest.java | 157 +++++
.../engine/steps/ComposeVoteEmailStepTest.java | 95 +++
.../releng/engine/steps/DevDistVerifyStepTest.java | 120 ++++
.../releng/engine/steps/DistPromoteStepTest.java | 143 ++++
.../engine/steps/MilestoneCloseStepTest.java | 96 +++
.../engine/steps/NexusStagingCloseStepTest.java | 75 +++
.../releng/engine/steps/PreflightStepTest.java | 87 +++
.../engine/steps/ReleasePrepareStepTest.java | 93 +++
.../releng/engine/steps/SafeModeTierBTest.java | 92 +++
.../engine/steps/TestWorkspaceVerifyStepTest.java | 93 +++
.../org/apache/juneau/releng/log/RunLogTest.java | 98 +++
.../juneau/releng/log/SseLogServletTest.java | 39 ++
.../releng/milestone/GithubPrSourceTest.java | 70 ++
.../releng/milestone/MilestoneServiceTest.java | 73 ++
.../apache/juneau/releng/nexus/NexusMockTest.java | 91 +++
.../releng/nexus/NexusStagingClientTest.java | 81 +++
.../releng/release/GitTagReleaseSourceTest.java | 58 ++
.../releng/release/ReleaseListServiceTest.java | 64 ++
.../juneau/releng/release/ReleaseVersionTest.java | 83 +++
.../juneau/releng/rest/MilestoneRestTest.java | 67 ++
.../juneau/releng/rest/ReleaseRunRestTest.java | 157 +++++
.../releng/util/ProcessRunnerStreamTest.java | 46 ++
src/test/resources/email/announcement.expected.txt | 10 +
src/test/resources/email/propose.expected.txt | 3 +
src/test/resources/email/result.expected.txt | 5 +
src/test/resources/email/vote.expected.txt | 13 +
start.sh | 44 ++
stop.sh | 58 ++
145 files changed, 12728 insertions(+)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000..5e6084f339
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+target/
+*.class
+.DS_Store
+
+# Eclipse IDE metadata (machine-specific; the shared .settings/ convention prefs ARE tracked)
+.classpath
+.project
diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000000..29abf99956
--- /dev/null
+++ b/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,6 @@
+eclipse.preferences.version=1
+encoding//src/main/java=UTF-8
+encoding//src/main/resources=UTF-8
+encoding//src/test/java=UTF-8
+encoding//src/test/resources=UTF-8
+encoding/<project>=UTF-8
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..f44de1440e
--- /dev/null
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,135 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.annotationPath.allLocations=disabled
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
+org.eclipse.jdt.core.compiler.annotation.notowning=org.eclipse.jdt.annotation.NotOwning
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.annotation.owning=org.eclipse.jdt.annotation.Owning
+org.eclipse.jdt.core.compiler.annotation.resourceanalysis=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.compliance=17
+org.eclipse.jdt.core.compiler.problem.APILeak=warning
+org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=ignore
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleOwningContract=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.insufficientResourceAnalysis=warning
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.memberOfDeprecatedTypeNotDeprecated=info
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed=ignore
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=ignore
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
+org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLambdaParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=17
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=1
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false
+org.eclipse.jdt.core.formatter.comment.format_source_code=false
+org.eclipse.jdt.core.formatter.comment.format_html=false
+org.eclipse.jdt.core.formatter.comment.format_line_comments=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=false
+org.eclipse.jdt.core.formatter.use_on_off_tags=true
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter:on
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter:off
diff --git a/.settings/org.eclipse.jdt.ui.prefs b/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000000..93057db4c9
--- /dev/null
+++ b/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,68 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;com;
+org.eclipse.jdt.ui.ondemandthreshold=1
+org.eclipse.jdt.ui.staticondemandthreshold=1
+formatter_profile=_juneau-formatter-rules
+formatter_settings_version=23
+cleanup_profile=_juneau-cleanup-rules
+cleanup_settings_version=2
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.organize_imports=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_type_arguments=true
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.use_lambda=true
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.always_use_blocks=false
+sp_cleanup.use_blocks=false
+sp_cleanup.never_use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=false
+sp_cleanup.use_type_arguments=false
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.add_missing_methods=false
+sp_cleanup.make_type_abstract_if_missing_method=false
diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000000..f897a7f1cb
--- /dev/null
+++ b/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/CODE-CONVENTIONS.md b/CODE-CONVENTIONS.md
new file mode 100644
index 0000000000..f954d2b10b
--- /dev/null
+++ b/CODE-CONVENTIONS.md
@@ -0,0 +1,152 @@
+# Code conventions
+
+These conventions derive from Apache Juneau's `juneau-code-conventions` skill
+(in `apache/juneau` at `.claude/skills/juneau-code-conventions/SKILL.md`), adapted for this
+**standalone Spring Boot + Apache Juneau application**. They are the checklist for a "READY-0
+review" of this repo: a future session can run the review against this file without re-deriving
+the rules from the upstream skill.
+
+This project depends only on Apache Juneau's **public API** (Juneau `10.0.0-SNAPSHOT`) plus Spring
+Boot; it is **not** part of `apache/juneau`. Some upstream conventions rely on Juneau's *internal*
+test/build machinery that isn't published as a consumable dependency, so those are marked **N/A**
+with a rationale below.
+
+Each item: a one-line rule, then **Applied** or **N/A** (with rationale).
+
+## Java source
+
+- **Imports over FQCN** — Reference types by simple name + `import`; no inline fully-qualified class
+ names (fields, params, returns, locals, generics, casts, `instanceof`, annotation values, Javadoc
+ `{@link}`). **Applied.** Swept all `java.*`, `javax.*`, `org.xml.*`, and `org.apache.juneau.*` inline
+ FQCNs. Verify per file with `rg '\bjava\.[a-z][a-zA-Z]+\.[A-Z]' <file>` (should be empty outside
+ `import`/`package` lines).
+- **FQCN allowed exceptions** — Name collisions, string literals (`Class.forName`, `@SuppressWarnings`),
+ `java.lang.*` (always simple). **Applied.** The one deliberate FQCN kept:
+ `freemarker.template.Configuration` in `AppConfiguration` — its simple name collides with Spring's
+ `@Configuration` used on the same class.
+- **`var` for obvious locals** — Use `var` when the RHS makes the type obvious; keep explicit types where
+ readability needs it (interface-typed locals, loop `String line;`, etc.). **Applied** (codebase was
+ already idiomatic; no remaining candidates).
+- **Terse exception factories (`Shorts`)** — Use `iaex`/`rex`/`isex`/`ioex`/`uoex`/… with printf `%s`
+ placeholders and `import static org.apache.juneau.commons.utils.Shorts.*;` instead of
+ `new IllegalArgumentException(...)` etc. **Applied.** `org.apache.juneau.commons.utils.Shorts` is on the
+ compile classpath (transitive via `juneau-commons 10.0.0-SNAPSHOT`); migrated 32 throw sites across 11
+ files. Note: `Shorts` routes through `StringUtils.format`, which is **pure printf** — single quotes are
+ literal, so do **not** double them (`''` is only for the MessageFormat `mf()`/`mfs()` path).
+- **No process/planning vocabulary in code** — No work-item IDs, phase/wave/session markers, dated
+ "revision" notes, decision numbers, or internal design-spec section citations (`spec §N`) in comments or
+ Javadoc; rewrite as neutral standalone English. **Applied.** Removed all `Task N`, `spec §N`, `decision
+ #N`, `CONFIRM-AT-BUILD`, `Slice N`, and `2026-08-15 revision` markers. (Dates that are genuine test
+ **data** — e.g. `voteDeadline`, JSON `created`, `rcHistory` timestamps — are left untouched.)
+- **`final` fields** — Declare instance fields `final` wherever possible; use `find`-prefixed helpers for
+ memoized suppliers needing constructor params. **Applied.** All service-class fields are already `final`;
+ the only non-final fields are intentionally mutable (public JSON-bean fields Juneau marshals, and the
+ `ChangelogEntry.Builder` accumulators).
+- **`instanceof` pattern-variable naming (`o` → `o2`)** — **N/A.** No `instanceof` pattern matches in the
+ codebase.
+- **`@SuppressWarnings` format** — Always the multiline brace/array form with a `//` rationale on every
+ token, even a single token (except the inline catch-parameter `"unused"` case). **Applied.** Converted
+ the four `@SuppressWarnings("unchecked")` (parsed-JSON casts) to the multiline form with rationale.
+- **Delete dead code** — Remove unreachable branches / unused fields & imports rather than leaving them.
+ **Applied** (none found).
+- **Indentation: tabs** — **Applied (tabs)** — full Juneau parity; enforced by the checked-in Eclipse
+ formatter + save-action profile in `.settings/`. The whole tree (98 Java files) was reformatted with the
+ real Eclipse formatter using Juneau's tab profile (`org.eclipse.jdt.core.formatter.tabulation.char=tab`),
+ so indentation, line-wrapping, and spacing all match upstream Juneau. The Eclipse convention metadata is
+ now tracked in the repo: `.settings/org.eclipse.jdt.core.prefs` (compiler settings + inlined tab formatter
+ profile), `.settings/org.eclipse.jdt.ui.prefs` (import order + cleanup/save-action profile), and
+ `.settings/org.eclipse.core.resources.prefs` (UTF-8 encoding). These are sourced from Juneau's canonical
+ `scripts/eclipse-preferences/` baseline; upstream keeps the formatter/cleanup as workspace-imported XML,
+ but here they're inlined into the project `.settings/` so the profile is enforced project-scoped and
+ travels with the repo. Only `.classpath` and `.project` remain git-ignored.
+
+## Javadoc
+
+- **Javadoc on public types & methods** — Brief description; `@param`/`@return`/`@throws` as applicable.
+ **Applied.** Public types and non-trivial public methods are documented; trivial accessors/REST handlers
+ are self-descriptive.
+- **Juneau syntax-highlight tags (`<jc>`/`<jk>`/`<jv>`/…)** — **N/A (style choice).** This app does not use
+ Juneau's Javadoc syntax-highlight tags (it doesn't ship the Juneau doclet/CSS); plain Javadoc with
+ `{@code ...}` and `{@link ...}` is used consistently.
+
+## Tests
+
+- **Method naming `LNN_testName` + `@Nested L_category`** — **Partially applied / project style.** Test
+ methods use descriptive camelCase names (e.g. `discoversMostRecentOpenRepoForProfile`) consistently
+ across the suite; the `LNN_`/`@Nested L_category` scheme is not retrofitted here to avoid churning a
+ green ~98-test suite for a purely cosmetic naming change. New tests should follow the existing
+ descriptive-name style for consistency within this repo.
+- **SSLLC test-data naming (`a`,`a1`,`b`…)** — **Project style.** Applied loosely; not enforced.
+- **`TestBase` base class** — **N/A.** Juneau's `TestBase` lives in Juneau's internal test sources and is
+ not published as a consumable test-jar dependency. Tests use plain JUnit 5 (`spring-boot-starter-test`).
+- **`assertBean` / `assertMap` / DPPAP assertions** — **N/A.** Same reason as `TestBase` — Juneau's
+ assertion helpers are not on this app's test classpath. Tests use JUnit 5 `Assertions.*`
+ (`assertEquals`, `assertTrue`, `assertThrows`, `assertDoesNotThrow`).
+- **`assertThrowsWithMessage`** — **N/A** (not available). Use JUnit 5 `assertThrows(...)` plus a
+ `getMessage()`/`contains` check where message content matters.
+- **`Flag` / `IntegerValue` for lambda state capture** — **N/A.** Not on the test classpath; use local
+ mutable holders (e.g. `ArrayList`, `AtomicInteger`) where state capture is needed.
+- **Exception factories in tests** — **Applied** where a test stub throws (e.g. `throw uoex()`), since
+ `Shorts` is on the test classpath too.
+
+## SonarQube findings policy
+
+How to triage SonarQube/SonarLint findings in this repo, mirroring Apache Juneau's Sonar Suppression
+Policy (upstream `juneau-code-conventions` skill → "Sonar Suppression Policy").
+
+**Default: prefer a real fix.** Refactor the code so the finding no longer applies. Only suppress when
+the finding matches one of Juneau's *standing* suppression rules (below).
+
+**Suppression format (required).** When you do suppress, ALWAYS use the multiline brace/array form with a
+`//` rationale comment on **every** token — even a single token. The inline single-string form
+(`@SuppressWarnings("java:Sxxx") // ...`) is **not** allowed. Scope to the smallest practical target
+(class-level for the class-shape rules). Example:
+
+```java
+@SuppressWarnings({
+ "java:S6539" // Spring @Configuration legitimately aggregates cohesive bean wiring; splitting would fragment it.
+})
+```
+
+The one exception is the inline `@SuppressWarnings("unused")` on a catch parameter, which cannot carry a
+trailing comment.
+
+**Suppress (Juneau standing policy — do not refactor):**
+
+| Rule | Where | Rationale |
+|------|-------|-----------|
+| `java:S110` (inheritance depth) | `RootRest` | Depth is imposed by the Juneau REST servlet base-class hierarchy; flattening isn't appropriate. Class-level. |
+| `java:S6539` (Monster Class / too many deps) | `AppConfiguration` | A Spring `@Configuration` legitimately aggregates bean wiring; splitting fragments cohesive wiring. Juneau suppresses S6539 unconditionally. Class-level. |
+| `java:S107` (too many params) | `ReleaseEngine` constructor | Constructor-injected collaborators; a parameter object would obscure the DI wiring. Suppress at the constructor only when a holder/record refactor would read worse than plain constructor injection (document the choice). |
+| `java:S1192` (duplicate literals) | — | Suppress at class level **only** when the repeated literal is a protocol-wire value, annotation attribute, or config key where a constant would obscure meaning. Ordinary duplicated strings → extract a constant instead (see below). |
+| `java:S115` (constant naming) | — | Suppress at **class** level (never on the field) for `UPPER_camelCase` constants or constants mirroring an external-protocol literal. |
+| `unchecked` (parsed-JSON casts) | JSON parse sites | Assigning a raw `Json.DEFAULT.read(…, List.class/Map.class)` result to its known parameterized shape is an unchecked conversion; keep the multiline-form suppression with a rationale. |
+
+**Fix, don't suppress (rules handled by real changes in this repo):**
+
+- `java:S1192` — extract a constant for ordinary duplicated string literals (not protocol/annotation/config keys). E.g. `EmailTemplate.DEV` (dev-list address), `ProcessRunner.Default.MSG_INTERRUPTED`/`MSG_ERROR`.
+- `java:S125` — delete genuinely commented-out code; if it's explanatory prose that Sonar's recognizer misclassifies (e.g. a comment containing `Type.method()`), reword it so it isn't code-shaped rather than deleting the explanation.
+- `java:S1845` — rename to remove a method/field name clash (prefer renaming the field): `CredentialSpec.name`→`id`, `StepResult.ok` field→`success` (keeping the `ok(…)`/`fail(…)` factory pair). Update all references + tests; keep behavior identical.
+- `java:S1172` — remove unused parameters and simplify callers/tests.
+- `java:S1905` — drop redundant casts; where a `var` + cast only supplied the generic type, switch to an explicit typed declaration.
+- `java:S3400` — replace a method that always returns a constant with a declared constant (e.g. `SseLogServlet.HEARTBEAT`).
+- `java:S2589` / `java:S1125` — remove always-true expressions and unnecessary boolean literals (`while (x || true)` → a real loop condition).
+- `java:S135` — reduce a loop to ≤1 `break`/`continue` (combine conditions; use a boolean loop flag).
+- `java:S1989` — never let a servlet method leak a checked `IOException`; catch and handle it (a broken SSE pipe just ends the stream).
+- `java:S1210` — a class implementing `compareTo` gets `equals`/`hashCode` consistent with it.
+- `java:S1130` — drop a `throws` clause that can't actually be thrown.
+- `java:S2065` — drop `transient` on fields that are never serialized (e.g. REST-resource collaborators).
+- `java:S5778` — in `assertThrows` lambdas, keep exactly one throwing invocation (hoist helper calls like `Map.of()` / builders out of the lambda).
+- `java:S1659` — one variable declaration per line.
+- `java:S1640` — use `EnumMap` for enum-keyed maps.
+- `java:S1186` — give an empty method/constructor a nested comment explaining why it's empty (e.g. no-arg constructor required for JSON deserialization), or implement/throw.
+- `java:S2142` — on a caught `InterruptedException`, call `Thread.currentThread().interrupt()` before proceeding.
+- `java:S6126` — use a text block instead of multi-line string concatenation.
+- **Web** (`Web:MetaRefreshCheck`, `Web:PageWithoutTitleCheck`, `Web:S5254`) — HTML needs `<html lang=…>`, a `<title>`, and an accessible redirect (inline `location.replace(...)` + a `<noscript>` link) rather than `<meta http-equiv="refresh">`.
+- **JavaScript** (`javascript:S7764`, `javascript:S6582`) — prefer `globalThis` over `window`; use optional chaining (`a?.b`) instead of `a && a.b`.
+
+## General rule
+
+Any upstream convention that cannot be cleanly applied to this standalone app is documented as
+**N/A-with-rationale** above rather than forced via a fragile/experimental dependency. Do not add a
+Juneau internal test-jar or any new dependency solely to satisfy a convention.
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000000..166df52937
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,258 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "{}"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright {yyyy} {name of copyright owner}
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+=============================================================================
+== THIRD-PARTY COMPONENTS ==
+=============================================================================
+
+This product bundles the following third-party components under
+src/main/resources/static/. Each is licensed under the MIT License.
+
+-----------------------------------------------------------------------------
+jQuery JavaScript Library v3.7.1
+ Bundled at: src/main/resources/static/datatables/jquery.min.js
+ Homepage: https://jquery.com/ (https://jquery.org/license/)
+ Copyright OpenJS Foundation and other contributors.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+-----------------------------------------------------------------------------
+DataTables 2.1.8
+ Bundled at: src/main/resources/static/datatables/dataTables.min.js
+ src/main/resources/static/datatables/dataTables.dataTables.min.css
+ Homepage: https://datatables.net/ (https://datatables.net/license)
+ Copyright (C) 2008-2024, SpryMedia Ltd.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+-----------------------------------------------------------------------------
diff --git a/README.md b/README.md
new file mode 100644
index 0000000000..e136efcb9d
--- /dev/null
+++ b/README.md
@@ -0,0 +1,52 @@
+# Juneau Release Manager
+
+> **Maintainer dev-tooling — NOT an Apache Juneau release artifact.**
+>
+> This branch (`release-manager`) is project-owned release-automation tooling for
+> Apache Juneau maintainers. It is **not** an official Apache Juneau release
+> artifact: it does **not** ride the release train, is **not** part of the signed
+> source/binary distribution or the release assembly, is **not** published to
+> Maven Central, and carries **no** ASF release guarantees. It lives on an orphan
+> branch of `apache/juneau` (mirroring the `docs` branch) with no history from
+> `master` and no CI/deploy pipeline.
+
+## What it is
+
+A Juneau REST + FreeMarker View web application (with macOS Keychain credential
+storage) that automates the Apache Juneau release process — preflight checks,
+build/verify, staging, vote orchestration, and promotion.
+
+## Dependency status
+
+This tooling currently depends on `10.0.0-SNAPSHOT` of several Juneau modules
+(`juneau-rest-server-springboot`, `juneau-rest-server-view-freemarker`,
+`juneau-secret-keychain`). The `<juneau.version>` property will be pinned to
+`10.0.0` once Juneau 10.0 GA is published. The project's own version
+(`1.0.0-SNAPSHOT`) is intentionally unreleased.
+
+## Getting a working copy (committers)
+
+This branch mirrors the `docs`-branch workflow — obtain a dedicated checkout of
+just this orphan branch, sibling to your `master` checkout:
+
+```bash
+# Dedicated single-branch clone:
+git clone -b release-manager --single-branch https://github.com/apache/juneau.git juneau-release-manager
+
+# ...or, from an existing apache/juneau checkout, add a worktree:
+git worktree add ../release-manager release-manager
+```
+
+## Building / running
+
+```bash
+mvn clean verify # build + run tests + apache-rat license check
+./start.sh # launch the web app
+./stop.sh # stop it
+```
+
+## License
+
+Apache License 2.0. See `LICENSE` (which also reproduces the MIT attribution
+notices for the vendored jQuery 3.7.1 and DataTables 2.1.8 assets under
+`src/main/resources/static/datatables/`).
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000000..b7657d27d7
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-release-manager</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <name>Apache Juneau Release Manager</name>
+
+ <properties>
+ <maven.compiler.release>17</maven.compiler.release>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <juneau.version>10.0.0-SNAPSHOT</juneau.version>
+ <spring.boot.version>4.1.0</spring.boot.version>
+ <freemarker.version>2.3.34</freemarker.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-dependencies</artifactId>
+ <version>${spring.boot.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-rest-server-springboot</artifactId>
+ <version>${juneau.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-rest-server-view-freemarker</artifactId>
+ <version>${juneau.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-secret-keychain</artifactId>
+ <version>${juneau.version}</version>
+ </dependency>
+ <!-- FreeMarker engine (provided-scope in the bridge module; supply it here). -->
+ <dependency>
+ <groupId>org.freemarker</groupId>
+ <artifactId>freemarker</artifactId>
+ <version>${freemarker.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <version>${spring.boot.version}</version>
+ <executions>
+ <execution><goals><goal>repackage</goal></goals></execution>
+ </executions>
+ </plugin>
+ <!--
+ Runs Apache Rat against all source code to make sure all first-party
+ files carry the AL2.0 header. Bound to the verify phase so `mvn verify`
+ fails the build on any unapproved (unlicensed) file.
+ -->
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <version>0.16.1</version>
+ <configuration>
+ <consoleOutput>true</consoleOutput>
+ <excludes>
+ <!-- Vendored third-party MIT assets - keep their own upstream headers -->
+ <exclude>src/main/resources/static/datatables/**</exclude>
+
+ <!-- Docs / release metadata - no license-header comment syntax -->
+ <exclude>**/*.md</exclude>
+ <exclude>LICENSE</exclude>
+ <exclude>NOTICE</exclude>
+ <exclude>.gitignore</exclude>
+
+ <!-- Eclipse IDE metadata -->
+ <exclude>.settings/**</exclude>
+ <exclude>.classpath</exclude>
+ <exclude>.project</exclude>
+
+ <!-- Test fixtures compared byte-for-byte by unit tests - must not be altered -->
+ <exclude>src/test/resources/email/**</exclude>
+
+ <!-- Build output / local run-state -->
+ <exclude>target/**</exclude>
+ </excludes>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>verify</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/push.py b/push.py
new file mode 100755
index 0000000000..d35b2e09f4
--- /dev/null
+++ b/push.py
@@ -0,0 +1,175 @@
+#!/usr/bin/env python3
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+Commit and Push Script for juneau-release-manager
+
+A small convenience helper for this personal repo (github.com/jamesbognar) — NOT
+the Apache push.py (that one build/test/installs first; this one is just
+add + commit + push, run manually whenever you want to save progress).
+
+Usage:
+ ./push.py "commit message"
+ ./push.py # prompts for a commit message
+ ./push.py --dry-run "message" # show what would happen, change nothing
+
+Safety:
+ - Never uses --force or --no-verify.
+ - Never runs `git config` (it only reads config; you fix a missing
+ identity yourself).
+ - Exits non-zero with a clear message on any precondition failure
+ (no git identity configured, nothing to commit, push rejected, etc).
+"""
+
+import argparse
+import subprocess
+import sys
+from pathlib import Path
+
+REPO_DIR = Path(__file__).resolve().parent
+
+
+def run(cmd, cwd=REPO_DIR, check=True, capture=False, input_text=None):
+ """Run a command (list form, no shell) and return the CompletedProcess."""
+ return subprocess.run(
+ cmd,
+ cwd=cwd,
+ check=check,
+ capture_output=capture,
+ text=True,
+ input=input_text,
+ )
+
+
+def git_identity_configured():
+ """True if `git config user.email` resolves to a non-empty value."""
+ result = run(["git", "config", "--get", "user.email"], check=False, capture=True)
+ return bool(result.stdout.strip())
+
+
+def has_changes_to_commit():
+ """True if `git status --porcelain` reports anything (staged or not)."""
+ result = run(["git", "status", "--porcelain"], capture=True)
+ return bool(result.stdout.strip())
+
+
+def current_branch():
+ result = run(["git", "rev-parse", "--abbrev-ref", "HEAD"], capture=True)
+ return result.stdout.strip()
+
+
+def short_sha():
+ result = run(["git", "rev-parse", "--short", "HEAD"], capture=True)
+ return result.stdout.strip()
+
+
+def remote_url(remote="origin"):
+ result = run(["git", "remote", "get-url", remote], check=False, capture=True)
+ return result.stdout.strip() if result.returncode == 0 else "(no remote)"
+
+
+def resolve_commit_message(cli_message):
+ """Use the CLI-supplied message, or prompt for one; abort if still empty."""
+ if cli_message:
+ return cli_message
+
+ try:
+ message = input("Commit message: ").strip()
+ except (EOFError, KeyboardInterrupt):
+ print("\n❌ Aborted: no commit message provided.")
+ sys.exit(1)
+
+ if not message:
+ print("❌ Aborted: commit message cannot be empty.")
+ sys.exit(1)
+
+ return message
+
+
+def main():
+ parser = argparse.ArgumentParser(
+ description="Commit and push juneau-release-manager to origin.",
+ formatter_class=argparse.RawDescriptionHelpFormatter,
+ epilog="""
+Examples:
+ ./push.py "Fix credential validator NPE"
+ ./push.py
+ ./push.py --dry-run "Would-be commit message"
+ """,
+ )
+ parser.add_argument(
+ "message",
+ nargs="?",
+ default=None,
+ help="Commit message. If omitted, you'll be prompted for one.",
+ )
+ parser.add_argument(
+ "--dry-run",
+ action="store_true",
+ help="Show what would be done without making any changes.",
+ )
+ args = parser.parse_args()
+
+ print("=" * 70)
+ print("📦 juneau-release-manager push")
+ print("=" * 70)
+
+ # Identity gate — must hold before anything else.
+ print("🔐 Checking git identity...")
+ if not git_identity_configured():
+ print("❌ ERROR: no git identity configured (git config user.email is unset).")
+ print(" This has caused a failed push before on this repo. Fix it with:")
+ print(' git config user.email "you@example.com"')
+ print(' git config user.name "Your Name"')
+ print(" (this script will never set it for you)")
+ sys.exit(1)
+ print("✅ Git identity configured.")
+
+ if not has_changes_to_commit():
+ print("⚠ Nothing to commit — working tree is clean. Nothing to do.")
+ sys.exit(0)
+
+ message = resolve_commit_message(args.message)
+ branch = current_branch()
+
+ if args.dry_run:
+ print("\n🔍 DRY RUN — no changes will be made. Would run:")
+ print(" git add .")
+ print(f" git commit -F- <<< {message!r}")
+ print(f" git push origin {branch}")
+ sys.exit(0)
+
+ print(f"\n📝 Staging all changes in {REPO_DIR}...")
+ run(["git", "add", "."])
+
+ print("📝 Committing...")
+ # Pipe the message via stdin (git commit -F -) instead of -m, so multi-line
+ # messages and odd characters round-trip safely with no shell quoting at all.
+ run(["git", "commit", "-F", "-"], input_text=message)
+
+ print(f"🚀 Pushing to origin/{branch}...")
+ run(["git", "push", "origin", branch])
+
+ print("\n" + "=" * 70)
+ print("✅ Push complete.")
+ print(f" Branch: {branch}")
+ print(f" Commit: {short_sha()}")
+ print(f" Remote: {remote_url()}")
+ print("=" * 70)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/src/main/java/org/apache/juneau/releng/App.java b/src/main/java/org/apache/juneau/releng/App.java
new file mode 100644
index 0000000000..7761df40c8
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/App.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class App {
+ @SuppressWarnings({ "resource" // The application context lives for the JVM/app lifetime; Spring registers a shutdown hook to close it.
+ })
+ public static void main(String[] args) {
+ SpringApplication.run(App.class, args);
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/AppConfiguration.java b/src/main/java/org/apache/juneau/releng/AppConfiguration.java
new file mode 100644
index 0000000000..f1d7be2e65
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/AppConfiguration.java
@@ -0,0 +1,374 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng;
+
+import java.nio.file.Path;
+import java.util.EnumMap;
+import java.util.Map;
+import java.util.Optional;
+import java.util.function.BiFunction;
+import java.util.function.Supplier;
+import org.apache.juneau.commons.secret.SecretStore;
+import org.apache.juneau.releng.credential.AccountStore;
+import org.apache.juneau.releng.credential.ApacheLdapValidator;
+import org.apache.juneau.releng.credential.CredentialService;
+import org.apache.juneau.releng.credential.CredentialSpec;
+import org.apache.juneau.releng.credential.GithubTokenValidator;
+import org.apache.juneau.releng.credential.GpgValidator;
+import org.apache.juneau.releng.credential.Validator;
+import org.apache.juneau.releng.email.EmailService;
+import org.apache.juneau.releng.config.TargetProfile;
+import org.apache.juneau.releng.engine.BranchResolver;
+import org.apache.juneau.releng.engine.DropRcService;
+import org.apache.juneau.releng.engine.ExecutionMode;
+import org.apache.juneau.releng.engine.ReleaseEngine;
+import org.apache.juneau.releng.engine.RunStateStore;
+import org.apache.juneau.releng.engine.StepRegistry;
+import org.apache.juneau.releng.log.LogBroadcaster;
+import org.apache.juneau.releng.log.SseLogServlet;
+import org.apache.juneau.releng.milestone.GithubPrSource;
+import org.apache.juneau.releng.milestone.MilestoneService;
+import org.apache.juneau.releng.nexus.NexusMockRest;
+import org.apache.juneau.releng.nexus.NexusStagingClient;
+import org.apache.juneau.releng.release.GitTagReleaseSource;
+import org.apache.juneau.releng.release.GithubReleaseSource;
+import org.apache.juneau.releng.release.LocalStateReleaseSource;
+import org.apache.juneau.releng.release.ReleaseListService;
+import org.apache.juneau.releng.rest.CredentialRest;
+import org.apache.juneau.releng.rest.HomeRest;
+import org.apache.juneau.releng.rest.MilestoneRest;
+import org.apache.juneau.releng.rest.ReleaseRest;
+import org.apache.juneau.releng.rest.ReleaseRunRest;
+import org.apache.juneau.releng.util.ProcessRunner;
+import org.apache.juneau.secret.keychain.KeychainSecretStore;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.web.servlet.ServletRegistrationBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import jakarta.servlet.Servlet;
+
+@Configuration
+@SuppressWarnings({ "java:S6539" // Spring @Configuration legitimately aggregates cohesive bean wiring; splitting would fragment it.
+})
+public class AppConfiguration {
+
+ @Bean
+ public ProcessRunner processRunner() {
+ return new ProcessRunner.Default();
+ }
+
+ /**
+ * FreeMarker engine configuration picked up by the Juneau view bridge (via BeanStore lookup).
+ *
+ * <p>Mirrors the bridge-default (classpath loader rooted at {@code /templates}, UTF-8, HTML output,
+ * cached templates) but enables {@code exposeFields} so the public-field view beans
+ * ({@code Release}, {@code CredentialStatus}) are readable from templates — the default object
+ * wrapper only exposes bean getters, which these beans intentionally don't have.
+ *
+ * <p>FreeMarker's {@code Configuration} is referenced by fully-qualified name because its simple name
+ * collides with Spring's {@link Configuration @Configuration} annotation used on this class.
+ */
+ @Bean
+ public freemarker.template.Configuration freemarkerConfiguration() {
+ var cfg = new freemarker.template.Configuration(freemarker.template.Configuration.VERSION_2_3_34);
+ cfg.setClassLoaderForTemplateLoading(AppConfiguration.class.getClassLoader(), "templates");
+ cfg.setDefaultEncoding("UTF-8");
+ cfg.setOutputFormat(freemarker.core.HTMLOutputFormat.INSTANCE);
+ cfg.setTemplateUpdateDelayMilliseconds(Long.MAX_VALUE);
+ var owb = new freemarker.template.DefaultObjectWrapperBuilder(freemarker.template.Configuration.VERSION_2_3_34);
+ owb.setExposeFields(true);
+ cfg.setObjectWrapper(owb.build());
+ return cfg;
+ }
+
+ @Bean
+ public ReleaseListService releaseListService(ProcessRunner runner, @Value("${rm.repo.dir}") String repoDir,
+ @Value("${rm.repo.slug}") String repoSlug, @Value("${rm.state.dir}") String stateDir) {
+ var tags = new GitTagReleaseSource(runner, repoDir);
+ var github = new GithubReleaseSource(runner, repoSlug);
+ var state = new LocalStateReleaseSource(Path.of(stateDir));
+ return new ReleaseListService(tags::list, github::list, state::list);
+ }
+
+ @Bean
+ public RootRest rootRest() {
+ return new RootRest();
+ }
+
+ @Bean
+ public HomeRest homeRest() {
+ return new HomeRest();
+ }
+
+ @Bean
+ public ReleaseRest releaseRest(ReleaseListService svc) {
+ return new ReleaseRest(svc);
+ }
+
+ @Bean
+ public GithubPrSource githubPrSource(ProcessRunner runner, @Value("${rm.repo.slug}") String repoSlug) {
+ return new GithubPrSource(runner, repoSlug);
+ }
+
+ @Bean
+ public MilestoneService milestoneService() {
+ return new MilestoneService();
+ }
+
+ @Bean
+ public MilestoneRest milestoneRest(MilestoneService svc, GithubPrSource prSource, ProcessRunner runner,
+ @Value("${rm.repo.dir}") String repoDir) {
+ return new MilestoneRest(svc, prSource, runner, repoDir);
+ }
+
+ /**
+ * One {@link SecretStore} per credential, namespaced by {@link CredentialSpec#keychainService} so the
+ * keychain service+account coordinates the app has always used are preserved exactly.
+ */
+ @Bean
+ public Map<CredentialSpec, SecretStore> credentialSecretStores() {
+ var stores = new EnumMap<CredentialSpec, SecretStore>(CredentialSpec.class);
+ for (var spec : CredentialSpec.values())
+ stores.put(spec, new KeychainSecretStore(spec.keychainService));
+ return stores;
+ }
+
+ /**
+ * Persists the non-secret {availid, GPG key ID} account identifiers under {@code rm.state.dir}
+ * (see {@link AccountStore}) so they survive a restart alongside the Keychain-held secrets.
+ */
+ @Bean
+ public AccountStore accountStore(@Value("${rm.state.dir}") String stateDir) {
+ return new AccountStore(Path.of(stateDir));
+ }
+
+ @Bean
+ public CredentialService credentialService(Map<CredentialSpec, SecretStore> stores, ProcessRunner runner,
+ AccountStore accounts) {
+ var validators = new EnumMap<CredentialSpec, Validator>(CredentialSpec.class);
+ validators.put(CredentialSpec.APACHE_LDAP, new ApacheLdapValidator());
+ validators.put(CredentialSpec.GPG, new GpgValidator(runner));
+ validators.put(CredentialSpec.GITHUB, new GithubTokenValidator(runner));
+ return new CredentialService(stores, validators, accounts);
+ }
+
+ @Bean
+ public CredentialRest credentialRest(CredentialService svc) {
+ return new CredentialRest(svc);
+ }
+
+ @Bean
+ public ServletRegistrationBean<Servlet> rootRestRegistration(RootRest rest) {
+ return new ServletRegistrationBean<>(rest, "/rest/*");
+ }
+
+ // ==========================================================================================
+ // Release-orchestration engine and New Release tab wiring.
+ // ==========================================================================================
+
+ /**
+ * The box-wide execution mode. Defaults to SAFE; only {@code rm.mode=live} enables real mutation (and
+ * even then, per-run arming is still required at the guard chokepoint).
+ */
+ @Bean
+ public ExecutionMode executionMode(@Value("${rm.mode:safe}") String mode) {
+ return "live".equalsIgnoreCase(mode) ? ExecutionMode.LIVE : ExecutionMode.SAFE;
+ }
+
+ /**
+ * The release target's centralized endpoints. Everything is the canonical Apache Juneau production value
+ * except the Nexus base, which is <b>mode-derived</b>: the in-app {@code /mock/nexus} loopback under SAFE,
+ * real {@code repository.apache.org} under LIVE. This is what makes the 3 Tier-A Nexus staging callouts
+ * hit the mock in SAFE and real Nexus in LIVE without any per-step branching.
+ */
+ @Bean
+ public TargetProfile targetProfile(ExecutionMode mode, @Value("${server.address:127.0.0.1}") String address,
+ @Value("${server.port:8790}") int port) {
+ var base = mode == ExecutionMode.LIVE ? TargetProfile.prodDefault().nexusBaseUrl()
+ : "http://" + address + ":" + port + "/mock/nexus";
+ return TargetProfile.prodDefault().withNexusBaseUrl(base);
+ }
+
+ @Bean
+ public RunStateStore runStateStore(@Value("${rm.state.dir}") String stateDir) {
+ return new RunStateStore(Path.of(stateDir));
+ }
+
+ @Bean
+ public BranchResolver branchResolver(ProcessRunner runner, @Value("${rm.repo.dir}") String repoDir) {
+ return new BranchResolver(runner, repoDir);
+ }
+
+ @Bean
+ public EmailService emailService(ProcessRunner runner, @Value("${rm.state.dir}") String stateDir) {
+ return new EmailService(Path.of(stateDir), runner);
+ }
+
+ /** Resolves live secrets from CredentialService's stores per mutating action. */
+ @Bean
+ public ReleaseEngine.SecretResolver secretResolver(Map<CredentialSpec, SecretStore> stores, AccountStore accounts,
+ ExecutionMode mode, TargetProfile target) {
+ return new ReleaseEngine.SecretResolver() {
+ private String read(CredentialSpec spec, String account) {
+ return stores.get(spec).find(account).map(String::new).orElse("");
+ }
+
+ // Precedence: the rm.availid/rm.gpg.keyid system property (headless/testing override) wins when
+ // set, else the AccountStore-persisted value (survives restart), else "".
+ @Override
+ public String availid() {
+ var sys = System.getProperty("rm.availid", "");
+ return !sys.isBlank() ? sys : accounts.get(CredentialSpec.APACHE_LDAP).orElse("");
+ }
+
+ @Override
+ public String ldapPassword() {
+ return read(CredentialSpec.APACHE_LDAP, availid());
+ }
+
+ @Override
+ public String gpgKeyId() {
+ var sys = System.getProperty("rm.gpg.keyid", "");
+ return !sys.isBlank() ? sys : accounts.get(CredentialSpec.GPG).orElse("");
+ }
+
+ @Override
+ public String gpgPassphrase() {
+ return read(CredentialSpec.GPG, gpgKeyId());
+ }
+
+ @Override
+ public String githubToken() {
+ return read(CredentialSpec.GITHUB, "token");
+ }
+
+ // Nexus credentials are the committer's Apache LDAP identity — the same Keychain-backed
+ // SecretStore entry as ldapPassword() above, because an encrypted <password> in settings.xml
+ // cannot be used directly. Falls back to ~/.m2/settings.xml only when that Keychain entry
+ // hasn't been stored yet. Under SAFE the base is the loopback mock and the credential is a
+ // throwaway placeholder — the real Keychain secret is never read or sent (OQ-C).
+ @Override
+ public NexusStagingClient nexus() {
+ if (mode == ExecutionMode.SAFE)
+ return NexusStagingClient.create(target.nexusBaseUrl(), target.nexusProfileId(), "safe-placeholder",
+ "safe-placeholder");
+ return nexusClient(target, availid(), ldapPassword(), () -> NexusStagingClient
+ .create(target.nexusBaseUrl(), target.nexusProfileId(), "apache.releases.https"));
+ }
+ };
+ }
+
+ /**
+ * Builds the LIVE Nexus client from Keychain-backed credentials (via the {@link SecretStore} SPI, per
+ * {@code availid}/{@code ldapPassword} above) when both are present, else defers to
+ * {@code settingsXmlFallback}. The base URL + profile id come from the (mode-derived) {@link TargetProfile}.
+ * Package-private for {@code AppConfigurationTest}.
+ */
+ static NexusStagingClient nexusClient(TargetProfile target, String availid, String ldapPassword,
+ Supplier<NexusStagingClient> settingsXmlFallback) {
+ if (availid.isBlank() || ldapPassword.isBlank())
+ return settingsXmlFallback.get();
+ return NexusStagingClient.create(target.nexusBaseUrl(), target.nexusProfileId(), availid, ldapPassword);
+ }
+
+ @Bean
+ public StepRegistry stepRegistry(BranchResolver branches) {
+ return StepRegistry.standard(branches);
+ }
+
+ @Bean
+ @SuppressWarnings({ "java:S107" // Constructor-injected collaborators; a parameter object would obscure the wiring.
+ })
+ public ReleaseEngine releaseEngine(RunStateStore store, StepRegistry registry, ProcessRunner runner,
+ BranchResolver branches, EmailService email, MilestoneService milestone,
+ ReleaseEngine.SecretResolver secrets, ExecutionMode mode, TargetProfile target,
+ @Value("${rm.state.dir}") String stateDir, @Value("${rm.staging.dir}") String stagingDir,
+ @Value("${rm.repo.dir}") String repoDir, @Value("${rm.git.committer.email}") String committerEmail) {
+ var engine = new ReleaseEngine(store, registry, runner, branches, Path.of(stateDir), Path.of(stagingDir),
+ repoDir, committerEmail, email, milestone, secrets, mode, target);
+ engine.recoverOnBoot(); // Demote runs left mid-flight by a previous process on restart.
+ return engine;
+ }
+
+ @Bean
+ public DropRcService dropRcService(RunStateStore store, StepRegistry registry, ProcessRunner runner,
+ ReleaseEngine.SecretResolver secrets, ReleaseEngine engine, ExecutionMode mode, TargetProfile target,
+ @Value("${rm.staging.dir}") String stagingDir, @Value("${rm.state.dir}") String stateDir) {
+ return new DropRcService(store, registry, runner, Path.of(stagingDir).resolve("git/juneau"), Path.of(stateDir),
+ secrets.nexus(), mode, engine::isArmed, target, engine::broadcaster);
+ }
+
+ @Bean
+ public ReleaseRunRest releaseRunRest(ReleaseEngine engine, DropRcService dropRc) {
+ return new ReleaseRunRest(engine, dropRc);
+ }
+
+ /**
+ * The SAFE-only Nexus loopback mock (OQ-D): a dedicated Juneau REST resource that lets the real
+ * {@link NexusStagingClient} run its full staging flow against an in-memory model with zero canonical
+ * side effects. Present only when {@code rm.mode=safe} (default), so it can never serve a LIVE run.
+ */
+ @Bean
+ @ConditionalOnProperty(name = "rm.mode", havingValue = "safe", matchIfMissing = true)
+ public NexusMockRest nexusMockRest(TargetProfile target) {
+ return new NexusMockRest(target.nexusProfileId());
+ }
+
+ @Bean
+ @ConditionalOnProperty(name = "rm.mode", havingValue = "safe", matchIfMissing = true)
+ public ServletRegistrationBean<Servlet> nexusMockRegistration(NexusMockRest mock, ReleaseEngine engine) {
+ // Each new run resets the mock so the lazily-synthesized staging repo starts from a clean slate.
+ engine.setRunStartHook(() -> mock.model().reset());
+ return new ServletRegistrationBean<>(mock, "/mock/nexus/*");
+ }
+
+ /**
+ * The SSE servlet — a plain HttpServlet, registered alongside RootRest. Keyed by
+ * {@code (version, stepId)} rather than {@code version} alone, and resolves each step's log path from
+ * its {@code StepState.logRef} rather than a run-level {@code logFile}.
+ */
+ @Bean
+ public ServletRegistrationBean<Servlet> sseLogRegistration(ReleaseEngine engine, RunStateStore store) {
+ var servlet = new SseLogServlet(logPathForStep(store), broadcasterForStep(engine, store));
+ return new ServletRegistrationBean<>(servlet, "/events/*");
+ }
+
+ /**
+ * That step's on-disk log path, or empty when there's no persisted run for {@code version} or that run
+ * has no such {@code stepId}. Package-private for {@code AppConfigurationTest}.
+ */
+ static BiFunction<String, String, Optional<Path>> logPathForStep(RunStateStore store) {
+ return (version, stepId) -> store.load(version).map(rs -> rs.step(stepId))
+ .filter(ss -> ss != null && ss.logRef != null).map(ss -> store.stateDir().resolve(ss.logRef));
+ }
+
+ /**
+ * That step's live {@link LogBroadcaster}, or empty when there's no persisted run for {@code version}
+ * or that run has no such {@code stepId}. Returning empty (rather than always minting a broadcaster via
+ * {@code engine.broadcaster()}'s {@code computeIfAbsent}) lets {@code SseLogServlet} take its immediate
+ * "(no active run/step …)" branch for a bogus key instead of blocking a worker thread for the full
+ * heartbeat interval. Package-private for {@code AppConfigurationTest}.
+ */
+ static BiFunction<String, String, Optional<LogBroadcaster>> broadcasterForStep(ReleaseEngine engine,
+ RunStateStore store) {
+ return (version, stepId) -> store.load(version).filter(rs -> rs.step(stepId) != null)
+ .map(rs -> engine.broadcaster(version, stepId));
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/RootRest.java b/src/main/java/org/apache/juneau/releng/RootRest.java
new file mode 100644
index 0000000000..969f289719
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/RootRest.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng;
+
+import org.apache.juneau.rest.server.Rest;
+import org.apache.juneau.rest.server.springboot.BasicSpringRestServletGroup;
+import org.apache.juneau.releng.rest.HomeRest;
+import org.apache.juneau.releng.rest.ReleaseRest;
+import org.apache.juneau.releng.rest.MilestoneRest;
+import org.apache.juneau.releng.rest.CredentialRest;
+import org.apache.juneau.releng.rest.ReleaseRunRest;
+
+@Rest(path = "/rest/*", title = "Apache Juneau · Release Manager", children = { HomeRest.class, ReleaseRest.class,
+ MilestoneRest.class, CredentialRest.class, ReleaseRunRest.class })
+@SuppressWarnings({ "java:S110" // Inheritance depth is imposed by the Juneau REST servlet hierarchy.
+})
+public class RootRest extends BasicSpringRestServletGroup {
+ private static final long serialVersionUID = 1L;
+}
diff --git a/src/main/java/org/apache/juneau/releng/config/TargetProfile.java b/src/main/java/org/apache/juneau/releng/config/TargetProfile.java
new file mode 100644
index 0000000000..d1e934b49e
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/config/TargetProfile.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.config;
+
+/**
+ * Centralizes the release target's endpoints in one config-backed, auditable object, replacing the endpoint
+ * literals that used to be scattered across the pipeline steps and the Nexus client.
+ *
+ * <p>{@code nexusBaseUrl} is mode-derived by the application wiring: it points at the in-app loopback mock
+ * under SAFE mode and at real Nexus under LIVE mode. Everything else defaults to the canonical Apache Juneau
+ * production endpoints (see {@link #prodDefault()}). This slice ships prod defaults only; no fork target is
+ * defined.
+ */
+public record TargetProfile(String cloneUrl, String repoSlug, String ghSlug, String nexusBaseUrl,
+ String nexusProfileId, String distDevBase, String distReleaseBase) {
+
+ /** The canonical Apache Juneau production endpoints (the former hardcoded literals). */
+ public static TargetProfile prodDefault() {
+ return new TargetProfile("https://gitbox.apache.org/repos/asf/juneau.git", "apache/juneau", "apache/juneau",
+ "https://repository.apache.org", "1a24bc7f954a70", "https://dist.apache.org/repos/dist/dev/juneau",
+ "https://dist.apache.org/repos/dist/release/juneau");
+ }
+
+ /** A copy of this profile with a different Nexus base URL (used to inject the mode-derived base). */
+ public TargetProfile withNexusBaseUrl(String url) {
+ return new TargetProfile(cloneUrl, repoSlug, ghSlug, url, nexusProfileId, distDevBase, distReleaseBase);
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/credential/AccountStore.java b/src/main/java/org/apache/juneau/releng/credential/AccountStore.java
new file mode 100644
index 0000000000..4ebdecf3a2
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/credential/AccountStore.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.credential;
+
+import static org.apache.juneau.commons.utils.Shorts.*;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Optional;
+import java.util.Properties;
+import org.apache.juneau.commons.secret.SecretStore;
+
+/**
+ * Persists the non-secret {@code CredentialSpec -> account} mapping (Apache availid, GPG key ID) to
+ * {@code accounts.properties} under {@code rm.state.dir}, so lookups survive an app restart even though the
+ * secrets themselves live only in the Keychain (via {@link SecretStore}).
+ *
+ * <p>An availid/key ID isn't a secret — it's a public identifier — so it belongs in a plain state file, not
+ * the Keychain. GitHub isn't tracked here: its account is the fixed literal {@code "token"}
+ * (see {@link CredentialSpec#accountIsFixed()}).
+ */
+public class AccountStore {
+
+ private final Path file;
+
+ public AccountStore(Path stateDir) {
+ this.file = stateDir.resolve("accounts.properties");
+ }
+
+ /** The persisted account for {@code spec}, or empty if never stored (or since deleted). */
+ public synchronized Optional<String> get(CredentialSpec spec) {
+ return Optional.ofNullable(load().getProperty(spec.id)).filter(s -> !s.isBlank());
+ }
+
+ /** Persist {@code account} for {@code spec} immediately, creating {@code rm.state.dir} if absent. */
+ public synchronized void put(CredentialSpec spec, String account) {
+ var props = load();
+ props.setProperty(spec.id, account);
+ save(props);
+ }
+
+ /** Forget the persisted account for {@code spec} (credential delete). */
+ public synchronized void remove(CredentialSpec spec) {
+ var props = load();
+ if (props.remove(spec.id) != null)
+ save(props);
+ }
+
+ private Properties load() {
+ var props = new Properties();
+ if (Files.isRegularFile(file)) {
+ try (InputStream in = Files.newInputStream(file)) {
+ props.load(in);
+ } catch (IOException e) {
+ throw isex(e, "Unreadable accounts file: %s", file);
+ }
+ }
+ return props;
+ }
+
+ private void save(Properties props) {
+ try {
+ Files.createDirectories(file.getParent());
+ try (OutputStream out = Files.newOutputStream(file)) {
+ props.store(out, "Juneau Release Manager - non-secret account identifiers (availid / GPG key ID)");
+ }
+ } catch (IOException e) {
+ throw isex(e, "Cannot save accounts file: %s", file);
+ }
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/credential/ApacheLdapValidator.java b/src/main/java/org/apache/juneau/releng/credential/ApacheLdapValidator.java
new file mode 100644
index 0000000000..870946b2e4
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/credential/ApacheLdapValidator.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.credential;
+
+import java.net.URI;
+import java.net.http.HttpClient;
+import java.net.http.HttpRequest;
+import java.net.http.HttpResponse;
+import java.nio.charset.StandardCharsets;
+import java.util.Base64;
+
+/** Validates Apache LDAP creds by Basic-authenticating to Nexus (repository.apache.org) status. */
+public class ApacheLdapValidator implements Validator {
+
+ static final String NEXUS_STATUS = "https://repository.apache.org/service/local/status";
+
+ private final HttpClient http;
+ private final String url;
+
+ public ApacheLdapValidator() {
+ this(HttpClient.newHttpClient(), NEXUS_STATUS);
+ }
+
+ ApacheLdapValidator(HttpClient http, String url) {
+ this.http = http;
+ this.url = url;
+ }
+
+ @Override
+ public ValidationResult validate(String password, String availid) {
+ try {
+ var basic = Base64.getEncoder().encodeToString((availid + ":" + password).getBytes(StandardCharsets.UTF_8));
+ var req = HttpRequest.newBuilder(URI.create(url)).header("Authorization", "Basic " + basic).GET().build();
+ var resp = http.send(req, HttpResponse.BodyHandlers.discarding());
+ var code = resp.statusCode();
+ if (code == 200)
+ return ValidationResult.ok("Nexus authentication OK (200)");
+ if (code == 401 || code == 403)
+ return ValidationResult.fail("Nexus rejected credentials (" + code + ")");
+ return ValidationResult.fail("Unexpected Nexus status " + code);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ return ValidationResult.fail("Nexus check error: " + e.getMessage());
+ } catch (Exception e) {
+ return ValidationResult.fail("Nexus check error: " + e.getMessage());
+ }
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/credential/CredentialService.java b/src/main/java/org/apache/juneau/releng/credential/CredentialService.java
new file mode 100644
index 0000000000..1423c2f0e5
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/credential/CredentialService.java
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.credential;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.EnumMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.juneau.commons.secret.SecretStore;
+import org.apache.juneau.releng.credential.Validator.ValidationResult;
+
+/**
+ * Stores + validates the managed credentials. Accounts: GitHub uses the fixed account "token"; Apache uses
+ * the availid; GPG uses the key ID. The last validation result per credential is cached in memory for the UI.
+ *
+ * <p>Each {@link CredentialSpec} is backed by its own {@link SecretStore} instance, namespaced by
+ * {@link CredentialSpec#keychainService}; the resolved account (availid/keyId/fixed "token") is the store key,
+ * preserving the keychain service+account coordinates the app has always used.
+ *
+ * <p>The non-fixed accounts (availid/keyId) are not secrets, so they're persisted via {@link AccountStore}
+ * rather than the Keychain — this is what lets a lookup survive an app restart.
+ */
+public class CredentialService {
+
+ private final Map<CredentialSpec, SecretStore> stores;
+ private final Map<CredentialSpec, Validator> validators;
+ private final Map<CredentialSpec, ValidationResult> lastResults = new EnumMap<>(CredentialSpec.class);
+ private final AccountStore accounts;
+
+ public CredentialService(Map<CredentialSpec, SecretStore> stores, Map<CredentialSpec, Validator> validators,
+ AccountStore accounts) {
+ this.stores = stores;
+ this.validators = validators;
+ this.accounts = accounts;
+ }
+
+ /** Store a credential whose account is fixed (GitHub) or already known. */
+ public void store(String name, String account, String secret) {
+ var spec = CredentialSpec.byName(name);
+ var acct = spec.accountIsFixed() ? spec.fixedAccount() : account;
+ var chars = secret.toCharArray();
+ try {
+ stores.get(spec).store(acct, chars);
+ } finally {
+ Arrays.fill(chars, '\0');
+ }
+ if (!spec.accountIsFixed())
+ accounts.put(spec, acct);
+ lastResults.remove(spec);
+ }
+
+ /** Store a credential supplying its account explicitly (Apache availid / GPG key ID). */
+ public void storeWithAccount(String name, String account, String secret) {
+ store(name, account, secret);
+ }
+
+ /** Run the live validation for one credential, caching + returning the result. */
+ public ValidationResult validate(String name) {
+ var spec = CredentialSpec.byName(name);
+ var acct = resolveAccount(spec);
+ if (acct == null) {
+ var r = ValidationResult.fail(spec.label + " is not set");
+ lastResults.put(spec, r);
+ return r;
+ }
+ var found = stores.get(spec).find(acct);
+ if (found.isEmpty()) {
+ var r = ValidationResult.fail(spec.label + " is not set");
+ lastResults.put(spec, r);
+ return r;
+ }
+ var chars = found.get();
+ try {
+ var r = validators.get(spec).validate(new String(chars), acct);
+ lastResults.put(spec, r);
+ return r;
+ } finally {
+ Arrays.fill(chars, '\0');
+ }
+ }
+
+ /** Delete a credential from the store. */
+ public void delete(String name) {
+ var spec = CredentialSpec.byName(name);
+ var acct = resolveAccount(spec);
+ if (acct != null)
+ stores.get(spec).delete(acct);
+ if (!spec.accountIsFixed())
+ accounts.remove(spec);
+ lastResults.remove(spec);
+ }
+
+ /** Presence + last-validation status for all credentials (never the secret). */
+ public List<CredentialStatus> status() {
+ var out = new ArrayList<CredentialStatus>();
+ for (var spec : CredentialSpec.values()) {
+ var acct = resolveAccount(spec);
+ var present = acct != null && stores.get(spec).exists(acct);
+ var cs = new CredentialStatus(spec.id, spec.label, present);
+ var last = lastResults.get(spec);
+ if (last != null) {
+ cs.lastValid = last.valid();
+ cs.lastMessage = last.message();
+ }
+ out.add(cs);
+ }
+ return out;
+ }
+
+ private String resolveAccount(CredentialSpec spec) {
+ if (spec.accountIsFixed())
+ return spec.fixedAccount();
+ return accounts.get(spec).orElse(null); // persisted in rm.state.dir — survives restart
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/credential/CredentialSpec.java b/src/main/java/org/apache/juneau/releng/credential/CredentialSpec.java
new file mode 100644
index 0000000000..27fdc9dc06
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/credential/CredentialSpec.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.credential;
+
+import static org.apache.juneau.commons.utils.Shorts.*;
+
+/** The set of managed credentials and their Keychain coordinates. */
+public enum CredentialSpec {
+
+ APACHE_LDAP("apache", "juneau-rm.apache", "Apache LDAP (Nexus + dist SVN)"),
+ GPG("gpg", "juneau-rm.gpg", "GPG signing key"), GITHUB("github", "juneau-rm.github", "GitHub token");
+
+ public final String id; // URL-safe id used in REST paths
+ public final String keychainService; // Keychain service prefix
+ public final String label; // human label for the UI
+
+ CredentialSpec(String id, String keychainService, String label) {
+ this.id = id;
+ this.keychainService = keychainService;
+ this.label = label;
+ }
+
+ public static CredentialSpec byName(String name) {
+ for (var c : values())
+ if (c.id.equalsIgnoreCase(name))
+ return c;
+ throw iaex("Unknown credential: %s", name);
+ }
+
+ /** GitHub's account is the fixed literal "token"; the others store the account with the secret. */
+ public boolean accountIsFixed() {
+ return this == GITHUB;
+ }
+
+ public String fixedAccount() {
+ return this == GITHUB ? "token" : null;
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/credential/CredentialStatus.java b/src/main/java/org/apache/juneau/releng/credential/CredentialStatus.java
new file mode 100644
index 0000000000..d6f97bdb0d
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/credential/CredentialStatus.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.credential;
+
+/** UI/JSON status for one credential. Never contains the secret value. */
+public class CredentialStatus {
+ public String name;
+ public String label;
+ public boolean present;
+ public Boolean lastValid; // null = not yet validated
+ public String lastMessage; // human message from last validation
+
+ public CredentialStatus() {
+ }
+
+ public CredentialStatus(String name, String label, boolean present) {
+ this.name = name;
+ this.label = label;
+ this.present = present;
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/credential/GithubTokenValidator.java b/src/main/java/org/apache/juneau/releng/credential/GithubTokenValidator.java
new file mode 100644
index 0000000000..c94f8c8d7a
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/credential/GithubTokenValidator.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.credential;
+
+import java.util.List;
+import java.util.Map;
+import org.apache.juneau.releng.util.ProcessRunner;
+
+/** Validates a GitHub token via {@code GH_TOKEN=<token> gh api user}. */
+public class GithubTokenValidator implements Validator {
+
+ private final ProcessRunner runner;
+
+ public GithubTokenValidator(ProcessRunner runner) {
+ this.runner = runner;
+ }
+
+ @Override
+ public ValidationResult validate(String token, String account) {
+ var r = runner.run(List.of("gh", "api", "user", "-q", ".login"), null, Map.of("GH_TOKEN", token));
+ return r.ok() ? ValidationResult.ok("GitHub token OK (user " + r.output().strip() + ")")
+ : ValidationResult.fail("GitHub token rejected: " + r.output().strip());
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/credential/GpgValidator.java b/src/main/java/org/apache/juneau/releng/credential/GpgValidator.java
new file mode 100644
index 0000000000..cf0bd9ce39
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/credential/GpgValidator.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.credential;
+
+import java.util.List;
+import org.apache.juneau.releng.util.ProcessRunner;
+
+/** Validates a GPG key + passphrase: key must exist, and a discard test-sign must succeed. */
+public class GpgValidator implements Validator {
+
+ private final ProcessRunner runner;
+
+ public GpgValidator(ProcessRunner runner) {
+ this.runner = runner;
+ }
+
+ @Override
+ public ValidationResult validate(String passphrase, String keyId) {
+ var present = runner.run(List.of("gpg", "--list-secret-keys", keyId), null, null);
+ if (!present.ok())
+ return ValidationResult.fail("No secret key for " + keyId);
+
+ // Test-sign a tiny payload; passphrase on stdin, signature discarded.
+ var sign = runner.run(List.of("gpg", "--batch", "--yes", "--pinentry-mode", "loopback", "--passphrase-fd", "0",
+ "--local-user", keyId, "--sign", "--output", "/dev/null", "-"), passphrase + "\n", null);
+ return sign.ok() ? ValidationResult.ok("GPG key " + keyId + " signs OK")
+ : ValidationResult.fail("GPG test-sign failed (bad passphrase?): " + sign.output().strip());
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/credential/Validator.java b/src/main/java/org/apache/juneau/releng/credential/Validator.java
new file mode 100644
index 0000000000..debd9f3b7d
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/credential/Validator.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.credential;
+
+/** Live validation of a single stored secret. */
+public interface Validator {
+ ValidationResult validate(String secret, String account);
+
+ record ValidationResult(boolean valid, String message) {
+ public static ValidationResult ok(String m) {
+ return new ValidationResult(true, m);
+ }
+
+ public static ValidationResult fail(String m) {
+ return new ValidationResult(false, m);
+ }
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/email/EmailService.java b/src/main/java/org/apache/juneau/releng/email/EmailService.java
new file mode 100644
index 0000000000..0022302eba
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/email/EmailService.java
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.email;
+
+import static org.apache.juneau.commons.utils.Shorts.*;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.List;
+import java.util.Map;
+import org.apache.juneau.releng.engine.RunState;
+import org.apache.juneau.releng.util.ProcessRunner;
+
+/** Composes the four release emails into {@code .eml} drafts and opens them in the mail client. */
+public class EmailService {
+
+ private final Path draftsDir; // rm.state.dir/drafts
+ private final ProcessRunner runner;
+
+ public EmailService(Path stateDir, ProcessRunner runner) {
+ this.draftsDir = stateDir.resolve("drafts");
+ this.runner = runner;
+ }
+
+ /** Render + write the {@code .eml}, then {@code open} it; returns the draft path. */
+ public Path compose(EmailTemplate t, RunState rs) {
+ return compose(t, rs, Map.of());
+ }
+
+ public Path compose(EmailTemplate t, RunState rs, Map<String, String> extra) {
+ var body = renderBody(t, rs, extra);
+ var subject = subject(t, rs);
+ var eml = "To: " + t.to + "\nSubject: " + subject + "\n\n" + body;
+ try {
+ Files.createDirectories(draftsDir);
+ var name = rs.version + "-RC" + rs.rc + "-" + t.name().toLowerCase() + ".eml";
+ var path = draftsDir.resolve(name);
+ Files.writeString(path, eml, StandardCharsets.UTF_8);
+ runner.run(List.of("open", path.toString()), null, null);
+ return path;
+ } catch (IOException e) {
+ throw isex(e, "Cannot write email draft for %s", t);
+ }
+ }
+
+ public String subject(EmailTemplate t, RunState rs) {
+ return t.subjectPrefix + " Apache Juneau " + rs.version + " RC" + rs.rc;
+ }
+
+ /** The plain-text body per template. {@code extra} carries step-computed values (checksums, tally, links). */
+ public String renderBody(EmailTemplate t, RunState rs, Map<String, String> extra) {
+ return switch (t) {
+ case PROPOSE -> """
+ I propose to release Apache Juneau %s (RC%d) from branch %s.
+
+ If there are last-minute blockers, please reply on this thread before the build starts.
+ """.formatted(rs.version, rs.rc, rs.branch);
+ case VOTE -> """
+ Please vote on releasing Apache Juneau %s RC%d.
+
+ Staging repo: %s
+ Commit: %s
+ Source SHA-512: %s
+ Binary SHA-512: %s
+ Dist (dev): https://dist.apache.org/repos/dist/dev/juneau/
+
+ The vote is open for at least 72 hours and closes %s.
+
+ [ ] +1 Release this package
+ [ ] 0 No opinion
+ [ ] -1 Do not release (please provide a reason)
+ """.formatted(rs.version, rs.rc, nz(rs.nexusRepoId), extra.getOrDefault("commitHash", ""),
+ extra.getOrDefault("srcSha512", ""), extra.getOrDefault("binSha512", ""), nz(rs.voteDeadline));
+ case RESULT -> """
+ The vote to release Apache Juneau %s RC%d has %s.
+
+ %s
+
+ Thanks to everyone who voted.
+ """.formatted(rs.version, rs.rc, extra.getOrDefault("outcome", ""), extra.getOrDefault("tally", ""));
+ case ANNOUNCEMENT -> """
+ The Apache Juneau team is pleased to announce the release of Apache Juneau %s.
+
+ %s
+
+ Downloads: %s
+ GitHub Release: %s
+ Release notes: https://juneau.apache.org/#release-notes
+
+ The Apache Juneau Team
+ """.formatted(rs.version, extra.getOrDefault("highlights", ""),
+ "https://dist.apache.org/repos/dist/release/juneau/" + rs.version + "/", nz(rs.githubReleaseUrl));
+ };
+ }
+
+ private static String nz(String s) {
+ return s == null ? "" : s;
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/email/EmailTemplate.java b/src/main/java/org/apache/juneau/releng/email/EmailTemplate.java
new file mode 100644
index 0000000000..14afd2eb5c
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/email/EmailTemplate.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.email;
+
+/** The four release emails. All draft-and-open; none auto-sent. */
+public enum EmailTemplate {
+ PROPOSE("[PROPOSE]", Lists.DEV), VOTE("[VOTE]", Lists.DEV), RESULT("[RESULT]", Lists.DEV),
+ ANNOUNCEMENT("[ANNOUNCEMENT]", "announce@apache.org, " + Lists.DEV);
+
+ // Held in a nested type because Java forbids an enum constant from referencing a static field
+ // declared later in the same enum (which is where a field must go, after the constants).
+ private static final class Lists {
+ static final String DEV = "dev@juneau.apache.org";
+ }
+
+ public final String subjectPrefix;
+ public final String to;
+
+ EmailTemplate(String subjectPrefix, String to) {
+ this.subjectPrefix = subjectPrefix;
+ this.to = to;
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/BranchResolver.java b/src/main/java/org/apache/juneau/releng/engine/BranchResolver.java
new file mode 100644
index 0000000000..07e3443a38
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/BranchResolver.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine;
+
+import java.util.List;
+import org.apache.juneau.releng.release.ReleaseVersion;
+import org.apache.juneau.releng.util.ProcessRunner;
+
+/** Resolves the target branch for a version and verifies (never creates) its remote existence. */
+public class BranchResolver {
+
+ private final ProcessRunner runner;
+ private final String repoDir; // rm.repo.dir — the maintainer's existing working clone
+
+ public BranchResolver(ProcessRunner runner, String repoDir) {
+ this.runner = runner;
+ this.repoDir = repoDir;
+ }
+
+ /** {@code master} when z==0, else {@code juneau-<version>-branch}. */
+ public String resolve(String version) {
+ var v = ReleaseVersion.of(version);
+ return v.maintenance() == 0 ? "master" : "juneau-" + version + "-branch";
+ }
+
+ /** {@code git ls-remote --heads origin <branch>} against {@code rm.repo.dir} — true if a ref comes back. */
+ public boolean remoteBranchExists(String branch) {
+ var res = runner.run(List.of("git", "-C", repoDir, "ls-remote", "--heads", "origin", branch), null, null);
+ return res.ok() && res.output() != null && res.output().contains("refs/heads/" + branch);
+ }
+
+ /** Human instructions shown when the target branch is missing (never auto-created). */
+ public String missingBranchInstructions(String branch) {
+ return "Branch '" + branch + "' does not exist on origin. This engine does not create maintenance "
+ + "branches.\nTo create it: git checkout -b " + branch + " <appropriate-source-commit> "
+ + "&& git push origin " + branch;
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/DropRcService.java b/src/main/java/org/apache/juneau/releng/engine/DropRcService.java
new file mode 100644
index 0000000000..082f7b1662
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/DropRcService.java
@@ -0,0 +1,174 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine;
+
+import static org.apache.juneau.commons.utils.Shorts.*;
+
+import java.nio.file.Path;
+import java.time.Instant;
+import java.util.List;
+import java.util.Map;
+import java.util.function.BiFunction;
+import java.util.function.Consumer;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+import org.apache.juneau.releng.config.TargetProfile;
+import org.apache.juneau.releng.log.LogBroadcaster;
+import org.apache.juneau.releng.log.RunLog;
+import org.apache.juneau.releng.nexus.NexusStagingClient;
+import org.apache.juneau.releng.util.ProcessRunner;
+
+/** The one coarse Drop-RC action: drop remote state, bump RC, reset from workspace-setup. */
+public class DropRcService {
+
+ /** Pseudo-step id under which Drop-RC's own log file + broadcaster are keyed (it isn't a registry step). */
+ public static final String LOG_STEP_ID = "drop-rc";
+
+ private final RunStateStore store;
+ private final StepRegistry registry;
+ private final ProcessRunner runner;
+ private final Path stagingRepo;
+ private final Path stateDir;
+ private final NexusStagingClient nexus;
+ private final ExecutionMode mode;
+ private final Predicate<String> armed;
+ private final TargetProfile target;
+ private final BiFunction<String, String, LogBroadcaster> broadcasterFn;
+
+ @SuppressWarnings({ "java:S107" // Constructor-injected collaborators; a parameter object would obscure the wiring.
+ })
+ public DropRcService(RunStateStore store, StepRegistry registry, ProcessRunner runner, Path stagingRepo,
+ Path stateDir, NexusStagingClient nexus, ExecutionMode mode, Predicate<String> armed, TargetProfile target,
+ BiFunction<String, String, LogBroadcaster> broadcasterFn) {
+ this.store = store;
+ this.registry = registry;
+ this.runner = runner;
+ this.stagingRepo = stagingRepo;
+ this.stateDir = stateDir;
+ this.nexus = nexus;
+ this.mode = mode == null ? ExecutionMode.SAFE : mode;
+ this.armed = armed == null ? v -> false : armed;
+ this.target = target == null ? TargetProfile.prodDefault() : target;
+ this.broadcasterFn = broadcasterFn == null ? (v, s) -> new LogBroadcaster() : broadcasterFn;
+ }
+
+ private boolean live() {
+ return mode == ExecutionMode.LIVE;
+ }
+
+ /**
+ * This action's own log — mirrors how {@code ReleaseEngine.context()} builds a step's {@link RunLog}, so
+ * Drop-RC's Tier-B calls get the same "would run:" command-logging fidelity a registry step's do (rather
+ * than the silent no-op this had before). Truncated at the start of every {@link #apply} so a re-drop
+ * overwrites in place.
+ */
+ private Consumer<String> logSink(RunState rs) {
+ var path = stateDir.resolve("logs/" + rs.version + "-RC" + rs.rc + "-" + LOG_STEP_ID + ".log");
+ var log = new RunLog(path, broadcasterFn.apply(rs.version, LOG_STEP_ID));
+ log.reset();
+ return log.lineSink();
+ }
+
+ /**
+ * The Tier-B seam for Drop-RC's mutating subprocess calls: runs the command in LIVE, logs a redacted
+ * "would run:" line and no-ops in SAFE so a rehearsed drop has zero canonical side effects (the Tier-A
+ * Nexus drop still round-trips the mock).
+ */
+ private void tierB(List<String> command, String stdin, Map<String, String> env, Consumer<String> log) {
+ if (live()) {
+ runner.run(command, stdin, env);
+ return;
+ }
+ var line = "would run: " + String.join(" ", StepContext.redactArgv(command));
+ if (stdin != null)
+ line += " <stdin:redacted>";
+ log.accept(line);
+ }
+
+ /** Compute the drop plan without executing. */
+ public Preview preview(String version) {
+ var rs = store.load(version).orElseThrow();
+ var tag = "juneau-" + rs.version + "-RC" + rs.rc;
+ var p = new Preview("drop-rc", true);
+ p.line("Drop Nexus staging repo: " + rs.nexusRepoId);
+ p.line("svn rm dist/dev/juneau/{source,binaries}/" + tag);
+ p.line("Delete tag " + tag + " (local + remote)");
+ p.line("mvn release:rollback in staging clone");
+ p.line("Then bump to RC" + (rs.rc + 1) + " and reset from workspace-setup.");
+ return p;
+ }
+
+ /** Execute the drop, bump RC, and reset. */
+ public synchronized void apply(String version, String reason, Supplier<String> availid, Supplier<String> password) {
+ // Default-safe guard chokepoint (mirrors ReleaseEngine.apply): the real destructive drop only runs in
+ // LIVE once the run is armed. SAFE rehearses it (Tier-A drop against the mock, Tier-B calls logged).
+ if (live() && !armed.test(version))
+ throw isex("Refused: drop-RC is a mutating action. Enable LIVE mode and arm run %s first.", version);
+ var rs = store.load(version).orElseThrow();
+ var tag = "juneau-" + rs.version + "-RC" + rs.rc;
+ var git = stagingRepo.toString();
+ var pw = password.get();
+ var log = logSink(rs);
+
+ // a) drop Nexus staging repo (Tier A: real client round-trip, against the loopback mock in SAFE)
+ if (rs.nexusRepoId != null && nexus != null) {
+ log.accept("Dropping Nexus staging repo " + rs.nexusRepoId);
+ nexus.drop(rs.nexusRepoId);
+ }
+ // b) svn checkout dist/dev, rm the rejected RC's directories, commit
+ var dist = stateDir.resolve("dist");
+ tierB(List.of("svn", "checkout", "--username", availid.get(), "--password-from-stdin", target.distDevBase(),
+ dist.toString()), pw + "\n", Map.of(), log);
+ tierB(List.of("svn", "rm", dist.resolve("source").resolve(tag).toString()), null, null, log);
+ tierB(List.of("svn", "rm", dist.resolve("binaries").resolve(tag).toString()), null, null, log);
+ tierB(List.of("svn", "commit", dist.toString(), "-m", "Drop " + tag, "--username", availid.get(),
+ "--password-from-stdin"), pw + "\n", Map.of(), log);
+ // c) delete tag local + remote
+ tierB(List.of("git", "-C", git, "tag", "-d", tag), null, null, log);
+ tierB(List.of("git", "-C", git, "push", "origin", ":refs/tags/" + tag), null, null, log);
+ // d) roll back the release:prepare version-bump commits
+ tierB(List.of("mvn", "-f", git + "/pom.xml", "release:rollback"), null, null, log);
+
+ // 4) reset state
+ rs.rcHistory.add(new RcHistoryEntry(rs.rc, Instant.now().toString(), reason));
+ rs.rc = rs.rc + 1;
+ rs.status = RunStatus.RUNNING;
+ rs.nexusRepoId = null;
+ rs.voteDeadline = null;
+ // Nothing to clear at the run level here; the per-step reset below handles each stale log reference.
+
+ // 5) Reset every step from workspace-setup onward back to PENDING, keeping preflight and
+ // compose-propose-email as they are. Clearing each step's stale log reference below also
+ // stops the per-step SSE endpoint from replaying the previous RC's output under the new RC.
+ var ids = registry.ids();
+ var resetFrom = ids.indexOf(StepRegistry.DROP_RC_RESET_FROM);
+ for (var i = 0; i < ids.size(); i++) {
+ if (i >= resetFrom) {
+ var ss = rs.step(ids.get(i));
+ ss.status = StepStatus.PENDING;
+ ss.startedAt = null;
+ ss.completedAt = null;
+ ss.error = null;
+ ss.logOffset = null;
+ ss.logRef = null;
+ }
+ }
+ rs.currentStepId = StepRegistry.DROP_RC_RESET_FROM;
+ store.save(rs);
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/ExecutionMode.java b/src/main/java/org/apache/juneau/releng/engine/ExecutionMode.java
new file mode 100644
index 0000000000..c1dfda9d88
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/ExecutionMode.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine;
+
+/**
+ * Global execution posture for the release engine.
+ *
+ * <p>{@code SAFE} (the default) rehearses a release with zero canonical side effects: the Nexus staging
+ * callouts run their real client flow against an in-app loopback mock, and every other mutating callout is
+ * command-logged rather than executed. {@code LIVE} executes everything for real and additionally requires
+ * the run to be armed before any mutating step is allowed.
+ */
+public enum ExecutionMode {
+ SAFE, LIVE;
+
+ /** Case-insensitive parse; a null/blank/unknown value fails safe to {@link #SAFE}. */
+ public static ExecutionMode fromConfig(String value) {
+ if (value == null)
+ return SAFE;
+ return "live".equalsIgnoreCase(value.strip()) ? LIVE : SAFE;
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/Preview.java b/src/main/java/org/apache/juneau/releng/engine/Preview.java
new file mode 100644
index 0000000000..f026f32b83
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/Preview.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/** A step's dry-run preview payload. */
+public class Preview {
+ public String stepId;
+ public boolean mutating; // does apply() change remote state?
+ public boolean reviewGate; // human-review gate (not a mutation gate)
+ public List<String> lines = new ArrayList<>(); // human-readable preview text
+ public String overrideField; // optional manual override (e.g. Nexus repo-id), else null
+
+ public Preview() {
+ }
+
+ public Preview(String stepId, boolean mutating) {
+ this.stepId = stepId;
+ this.mutating = mutating;
+ }
+
+ public Preview line(String s) {
+ lines.add(s);
+ return this;
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/RcHistoryEntry.java b/src/main/java/org/apache/juneau/releng/engine/RcHistoryEntry.java
new file mode 100644
index 0000000000..5e68b9fc98
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/RcHistoryEntry.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine;
+
+/** Append-only audit record of a dropped RC. */
+public class RcHistoryEntry {
+ public int rc;
+ public String droppedAt; // ISO-8601
+ public String reason;
+
+ public RcHistoryEntry() {
+ }
+
+ public RcHistoryEntry(int rc, String droppedAt, String reason) {
+ this.rc = rc;
+ this.droppedAt = droppedAt;
+ this.reason = reason;
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/ReleaseEngine.java b/src/main/java/org/apache/juneau/releng/engine/ReleaseEngine.java
new file mode 100644
index 0000000000..6df1f70997
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/ReleaseEngine.java
@@ -0,0 +1,374 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine;
+
+import static org.apache.juneau.commons.utils.Shorts.*;
+
+import java.nio.file.Path;
+import java.time.Instant;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.concurrent.ConcurrentHashMap;
+import org.apache.juneau.releng.config.TargetProfile;
+import org.apache.juneau.releng.email.EmailService;
+import org.apache.juneau.releng.log.LogBroadcaster;
+import org.apache.juneau.releng.log.RunLog;
+import org.apache.juneau.releng.milestone.MilestoneService;
+import org.apache.juneau.releng.nexus.NexusStagingClient;
+import org.apache.juneau.releng.util.ProcessRunner;
+
+/** Single-active-run orchestrator. One run advances at a time; state is persisted after every step. */
+public class ReleaseEngine {
+
+ private final RunStateStore store;
+ private final StepRegistry registry;
+ private final ProcessRunner runner;
+ private final BranchResolver branches;
+ private final Path stateDir;
+ private final Path stagingRoot; // rm.staging.dir
+ private final String repoDir;
+ private final String committerEmail;
+ private final EmailService email;
+ private final MilestoneService milestone;
+ // Secrets + nexus client are supplied by the REST layer per mutating action; test factory passes nulls.
+ private final SecretResolver secrets;
+ private final ExecutionMode mode;
+ private final TargetProfile target;
+
+ // The armed run, if any. Transient in-memory posture — deliberately NOT persisted, so it drops on any
+ // restart (re-arm required after a restart/crash). Only meaningful in LIVE mode.
+ private volatile String armedVersion;
+
+ // In-memory per-step broadcasters, keyed "version/stepId". Lost on restart; log files survive.
+ private final Map<String, LogBroadcaster> broadcasters = new ConcurrentHashMap<>();
+
+ // Invoked when a new run starts, e.g. to reset the SAFE Nexus loopback mock. Defaults to a no-op.
+ private Runnable runStartHook = () -> {
+ // No-op by default; the SAFE-mode wiring installs a mock-reset hook.
+ };
+
+ /** Everything the REST layer must provide to build a mutating StepContext. */
+ public interface SecretResolver {
+ String availid();
+
+ String ldapPassword();
+
+ String gpgKeyId();
+
+ String gpgPassphrase();
+
+ String githubToken();
+
+ NexusStagingClient nexus();
+ }
+
+ @SuppressWarnings({ "java:S107" // Constructor-injected collaborators; a parameter object would obscure the wiring.
+ })
+ public ReleaseEngine(RunStateStore store, StepRegistry registry, ProcessRunner runner, BranchResolver branches,
+ Path stateDir, Path stagingRoot, String repoDir, String committerEmail, EmailService email,
+ MilestoneService milestone, SecretResolver secrets, ExecutionMode mode, TargetProfile target) {
+ this.store = store;
+ this.registry = registry;
+ this.runner = runner;
+ this.branches = branches;
+ this.stateDir = stateDir;
+ this.stagingRoot = stagingRoot;
+ this.repoDir = repoDir;
+ this.committerEmail = committerEmail;
+ this.email = email;
+ this.milestone = milestone;
+ this.secrets = secrets;
+ this.mode = mode == null ? ExecutionMode.SAFE : mode;
+ this.target = target == null ? TargetProfile.prodDefault() : target;
+ }
+
+ /** Minimal test factory (no secrets/nexus/email). */
+ public static ReleaseEngine forTests(RunStateStore store, StepRegistry registry, ProcessRunner runner,
+ BranchResolver branches, Path stateDir) {
+ var noSecrets = new SecretResolver() {
+ public String availid() {
+ return "test";
+ }
+
+ public String ldapPassword() {
+ return "";
+ }
+
+ public String gpgKeyId() {
+ return "";
+ }
+
+ public String gpgPassphrase() {
+ return "";
+ }
+
+ public String githubToken() {
+ return "";
+ }
+
+ public NexusStagingClient nexus() {
+ return null;
+ }
+ };
+ return new ReleaseEngine(store, registry, runner, branches, stateDir, stateDir.resolve("staging"), "/repo",
+ "test@apache.org", new EmailService(stateDir, runner), new MilestoneService(), noSecrets,
+ ExecutionMode.SAFE, TargetProfile.prodDefault());
+ }
+
+ /** Test factory pinned to a specific execution mode (for guard/arm/tier tests). */
+ public static ReleaseEngine forTests(RunStateStore store, StepRegistry registry, ProcessRunner runner,
+ BranchResolver branches, Path stateDir, ExecutionMode mode) {
+ var engine = forTests(store, registry, runner, branches, stateDir);
+ return new ReleaseEngine(store, registry, runner, branches, stateDir, stateDir.resolve("staging"), "/repo",
+ "test@apache.org", engine.email, engine.milestone, engine.secrets, mode, TargetProfile.prodDefault());
+ }
+
+ /** One broadcaster per (version, step). */
+ public LogBroadcaster broadcaster(String version, String stepId) {
+ return broadcasters.computeIfAbsent(version + "/" + stepId, k -> new LogBroadcaster());
+ }
+
+ public Optional<RunState> activeRun() {
+ return store.activeRun();
+ }
+
+ public RunState state(String version) {
+ return store.load(version).orElse(null);
+ }
+
+ /** Start a new run; enforces the single-active-run lock. */
+ public synchronized RunState start(String version, String developmentVersion) {
+ return start(version, developmentVersion, null);
+ }
+
+ /**
+ * Start a new run, recording the milestone number resolved (or overridden) on the New-Release form.
+ * {@code milestoneNumber} may be null (no matching milestone; {@code milestone-close} then legitimately
+ * no-ops).
+ */
+ public synchronized RunState start(String version, String developmentVersion, Integer milestoneNumber) {
+ var active = store.activeRun();
+ if (active.isPresent())
+ throw isex("A run is already active: %s (%s). Finish or drop it first.", active.get().version,
+ active.get().currentStepId);
+ var branch = branches.resolve(version);
+ var rs = RunState.create(version, branch, registry.ids());
+ rs.developmentVersion = developmentVersion;
+ rs.milestoneNumber = milestoneNumber;
+ store.save(rs);
+ runStartHook.run(); // e.g. reset the SAFE Nexus loopback mock so this run starts from a clean slate
+ return rs;
+ }
+
+ /** Installs a callback invoked on each {@link #start}, e.g. to reset the SAFE Nexus loopback mock. */
+ public void setRunStartHook(Runnable hook) {
+ this.runStartHook = hook == null ? () -> {
+ // No-op: clearing the hook restores default behavior.
+ } : hook;
+ }
+
+ public ExecutionMode mode() {
+ return mode;
+ }
+
+ public TargetProfile target() {
+ return target;
+ }
+
+ /**
+ * Arms {@code version} for LIVE mutation. Rejected unless mode is LIVE and {@code confirm} equals the
+ * required phrase {@code "<version> LIVE"}. Returns the outcome message-bearing result.
+ */
+ public synchronized StepResult arm(String version, String confirm) {
+ if (mode != ExecutionMode.LIVE)
+ return StepResult.fail("Arming is only possible in LIVE mode; this box is running in SAFE mode.");
+ if (!Objects.equals(confirm, version + " LIVE"))
+ return StepResult.fail("Type '" + version + " LIVE' to arm this run for live mutation.");
+ armedVersion = version;
+ return StepResult.ok("Run " + version + " is armed for LIVE mutation.");
+ }
+
+ public boolean isArmed(String version) {
+ return version != null && version.equals(armedVersion);
+ }
+
+ public synchronized void disarm(String version) {
+ if (isArmed(version))
+ armedVersion = null;
+ }
+
+ /** Preview a step: no mutation, no persistence, no log reset. */
+ public Preview preview(String version, String stepId, Map<String, String> form) {
+ var rs = require(version);
+ var step = requireStep(stepId);
+ return step.preview(context(rs, stepId, form, false));
+ }
+
+ /**
+ * Apply a step — first run, resume, or an ad-hoc re-run of an already-terminal step (any step,
+ * independently, regardless of {@code currentStepId}). Persists status transitions; halts on failure.
+ * Overwrites that step's own log in place via {@code resetLog=true}.
+ */
+ public synchronized StepResult apply(String version, String stepId, Map<String, String> form) {
+ var rs = require(version);
+ var step = requireStep(stepId);
+ // Default-safe guard chokepoint: a mutating step is refused in LIVE until the run is armed. In SAFE it
+ // is allowed to run (simulated) so the pipeline can be rehearsed end-to-end with no canonical effect.
+ if (step.mutating() && mode == ExecutionMode.LIVE && !isArmed(version))
+ return StepResult.fail(guardMessage(step));
+ var ss = rs.step(stepId);
+ ss.status = StepStatus.RUNNING;
+ ss.startedAt = Instant.now().toString();
+ rs.currentStepId = stepId;
+ store.save(rs);
+
+ StepResult result;
+ var ctx = context(rs, stepId, form, true); // true = reset (truncate) this step's log first
+ ss.logRef = stepLogRelativePath(rs, stepId); // per-step logRef
+ try {
+ result = step.apply(ctx);
+ } catch (RuntimeException e) {
+ result = StepResult.fail(e.getMessage());
+ }
+
+ if (result.success) {
+ if (stepId.equals("vote-gate")) {
+ ss.status = StepStatus.AWAITING_VOTE;
+ rs.status = RunStatus.AWAITING_VOTE;
+ } else if (step.reviewGate()) {
+ // The read-only work ran; hold the step for an explicit confirm-review before it counts passed.
+ ss.status = StepStatus.AWAITING_REVIEW;
+ } else {
+ ss.status = StepStatus.SUCCEEDED;
+ }
+ ss.completedAt = Instant.now().toString();
+ if (stepId.equals("finalize-run")) {
+ rs.status = RunStatus.RELEASED;
+ disarm(version); // the run is complete; drop the arm
+ }
+ } else {
+ ss.status = StepStatus.FAILED;
+ ss.error = result.message;
+ rs.status = RunStatus.FAILED;
+ }
+ store.save(rs);
+ return result;
+ }
+
+ /** Mark a step SKIPPED (only steps whose registry entry is skippable). */
+ public synchronized StepResult skip(String version, String stepId) {
+ var rs = require(version);
+ var step = requireStep(stepId);
+ if (!step.skippable())
+ return StepResult.fail(stepId + " is not skippable.");
+ var ss = rs.step(stepId);
+ ss.status = StepStatus.SKIPPED;
+ store.save(rs);
+ return StepResult.ok(stepId + " skipped.");
+ }
+
+ /** Advance a review-gate step held in {@code AWAITING_REVIEW} to {@code SUCCEEDED}. */
+ public synchronized StepResult confirmReview(String version, String stepId) {
+ var rs = require(version);
+ requireStep(stepId);
+ var ss = rs.step(stepId);
+ if (ss == null)
+ return StepResult.fail("Unknown step: " + stepId);
+ if (ss.status != StepStatus.AWAITING_REVIEW)
+ return StepResult.fail(stepId + " is not awaiting review.");
+ ss.status = StepStatus.SUCCEEDED;
+ ss.completedAt = Instant.now().toString();
+ store.save(rs);
+ return StepResult.ok(stepId + " review confirmed.");
+ }
+
+ private String guardMessage(ReleaseStep step) {
+ return "Refused: '" + step.id() + "' is a mutating step. Enable LIVE mode and arm this run first.";
+ }
+
+ /** On boot: demote any RUNNING step to FAILED (its subprocess died with the JVM). */
+ public void recoverOnBoot() {
+ for (var rs : store.loadAll()) {
+ var current = rs.currentStepId == null ? null : rs.step(rs.currentStepId);
+ if (current != null && current.status == StepStatus.RUNNING) {
+ current.status = StepStatus.FAILED;
+ current.error = "interrupted by server restart";
+ rs.status = RunStatus.FAILED;
+ store.save(rs);
+ }
+ }
+ }
+
+ /** {@code logs/<version>-RC<n>-<stepId>.log}, relative to {@code stateDir}. */
+ private String stepLogRelativePath(RunState rs, String stepId) {
+ return "logs/" + rs.version + "-RC" + rs.rc + "-" + stepId + ".log";
+ }
+
+ /**
+ * Builds a step's {@link StepContext}, wiring {@code ctx.log} to that step's own {@link RunLog}. When
+ * {@code resetLog} is true (an actual apply/resume/re-run, never a preview), the log is truncated first
+ * so a re-run overwrites in place rather than appending after a stale prior invocation's output.
+ */
+ private StepContext context(RunState rs, String stepId, Map<String, String> form, boolean resetLog) {
+ var ctx = new StepContext();
+ ctx.run = rs;
+ ctx.runner = runner;
+ ctx.mode = mode;
+ ctx.target = target;
+ var log = new RunLog(stateDir.resolve(stepLogRelativePath(rs, stepId)), broadcaster(rs.version, stepId));
+ if (resetLog)
+ log.reset();
+ ctx.log = log.lineSink();
+ ctx.stagingRepo = stagingRoot.resolve("git/juneau");
+ ctx.stateDir = stateDir;
+ ctx.repoDir = repoDir;
+ ctx.committerEmail = committerEmail;
+ ctx.availid = secrets.availid();
+ ctx.ldapPassword = secrets.ldapPassword();
+ ctx.gpgKeyId = secrets.gpgKeyId();
+ ctx.gpgPassphrase = secrets.gpgPassphrase();
+ ctx.githubToken = secrets.githubToken();
+ ctx.nexus = secrets.nexus();
+ ctx.email = email;
+ ctx.milestone = milestone;
+ ctx.formInputs = form == null ? Map.of() : form;
+ return ctx;
+ }
+
+ private RunState require(String version) {
+ return store.load(version).orElseThrow(() -> isex("No run for %s", version));
+ }
+
+ private ReleaseStep requireStep(String stepId) {
+ var s = registry.byId(stepId);
+ if (s == null)
+ throw iaex("Unknown step: %s", stepId);
+ return s;
+ }
+
+ public StepRegistry registry() {
+ return registry;
+ }
+
+ /** Exposes the wired {@link SecretResolver} so the REST layer can plumb it into {@link DropRcService}'s
+ * {@code Supplier<String>} seams without duplicating the Keychain-backed resolution here. */
+ public SecretResolver secrets() {
+ return secrets;
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/ReleaseStep.java b/src/main/java/org/apache/juneau/releng/engine/ReleaseStep.java
new file mode 100644
index 0000000000..720202f1ab
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/ReleaseStep.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine;
+
+/** One discrete, resumable, idempotent pipeline step. */
+public interface ReleaseStep {
+
+ /** Stable id used in run state + REST paths (e.g. "workspace-setup"). */
+ String id();
+
+ /** Human title for the left-rail. */
+ String title();
+
+ /** Does apply() mutate remote state (git remote / SVN / Nexus / GitHub)? Drives the confirm gate. */
+ default boolean mutating() {
+ return false;
+ }
+
+ /** Human-review gate (run then require explicit "looks good") rather than a mutation gate. */
+ default boolean reviewGate() {
+ return false;
+ }
+
+ /** May the run mark this step SKIPPED? */
+ default boolean skippable() {
+ return false;
+ }
+
+ /** Compute the dry-run preview without mutating anything. */
+ Preview preview(StepContext ctx);
+
+ /** Execute the step (idempotent/safely re-runnable per each step's §5 notes). */
+ StepResult apply(StepContext ctx);
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/RunState.java b/src/main/java/org/apache/juneau/releng/engine/RunState.java
new file mode 100644
index 0000000000..322d74e7d1
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/RunState.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine;
+
+import java.time.Instant;
+import java.util.ArrayList;
+import java.util.List;
+
+/** The per-target-version run record. Mirrored to {@code rm.state.dir/release-<version>.json}. */
+public class RunState {
+
+ public String version; // "9.2.1"
+ public String branch; // resolved at preflight
+ public int rc = 1;
+ public List<RcHistoryEntry> rcHistory = new ArrayList<>();
+ public RunStatus status = RunStatus.RUNNING;
+ public String currentStepId;
+ public String createdAt;
+ public String updatedAt;
+ public String voteDeadline; // ISO-8601 or null
+ public String developmentVersion; // human-supplied when z==0; else null
+ public String nexusRepoId; // set by nexus-staging-close
+ public String githubReleaseUrl; // set by github-release-create
+ public Integer milestoneNumber; // New-Release form field; pre-filled by gh title-match resolution, user-editable
+ public List<StepState> steps = new ArrayList<>();
+
+ public RunState() {
+ // No-arg constructor required so the JSON parser can instantiate this bean before populating fields.
+ }
+
+ /** Build a fresh run with all steps seeded to PENDING. */
+ public static RunState create(String version, String branch, List<String> stepIds) {
+ var rs = new RunState();
+ rs.version = version;
+ rs.branch = branch;
+ rs.rc = 1;
+ rs.status = RunStatus.RUNNING;
+ var now = Instant.now().toString();
+ rs.createdAt = now;
+ rs.updatedAt = now;
+ for (var id : stepIds)
+ rs.steps.add(new StepState(id));
+ rs.currentStepId = stepIds.isEmpty() ? null : stepIds.get(0);
+ return rs;
+ }
+
+ /** The {@link StepState} for {@code id}, or null. */
+ public StepState step(String id) {
+ for (var s : steps)
+ if (s.id.equals(id))
+ return s;
+ return null;
+ }
+
+ public void touch() {
+ updatedAt = Instant.now().toString();
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/RunStateStore.java b/src/main/java/org/apache/juneau/releng/engine/RunStateStore.java
new file mode 100644
index 0000000000..81e372a351
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/RunStateStore.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine;
+
+import static org.apache.juneau.commons.utils.Shorts.*;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+import org.apache.juneau.marshall.marshaller.Json;
+
+/** Reads/writes {@code release-<version>.json} state files under {@code rm.state.dir}. */
+public class RunStateStore {
+
+ private final Path stateDir;
+
+ public RunStateStore(Path stateDir) {
+ this.stateDir = stateDir;
+ }
+
+ public Path stateDir() {
+ return stateDir;
+ }
+
+ private Path fileFor(String version) {
+ return stateDir.resolve("release-" + version + ".json");
+ }
+
+ /** Persist the run (pretty JSON), creating {@code rm.state.dir} if absent. */
+ public synchronized void save(RunState rs) {
+ try {
+ Files.createDirectories(stateDir);
+ rs.touch();
+ Files.writeString(fileFor(rs.version), Json.DEFAULT.write(rs));
+ } catch (IOException e) {
+ throw isex(e, "Cannot save run state for %s", rs.version);
+ }
+ }
+
+ public Optional<RunState> load(String version) {
+ var f = fileFor(version);
+ if (!Files.isRegularFile(f))
+ return Optional.empty();
+ try {
+ return Optional.of(Json.DEFAULT.read(Files.readString(f), RunState.class));
+ } catch (IOException e) {
+ throw isex(e, "Unreadable run state: %s", f);
+ }
+ }
+
+ /** Every persisted run, loaded from disk. */
+ public List<RunState> loadAll() {
+ var out = new ArrayList<RunState>();
+ if (!Files.isDirectory(stateDir))
+ return out;
+ try (var files = Files.list(stateDir)) {
+ files.filter(p -> {
+ var n = p.getFileName().toString();
+ return n.startsWith("release-") && n.endsWith(".json");
+ }).sorted().forEach(p -> {
+ try {
+ out.add(Json.DEFAULT.read(Files.readString(p), RunState.class));
+ } catch (IOException e) {
+ throw isex(e, "Unreadable run state: %s", p);
+ }
+ });
+ } catch (IOException e) {
+ throw isex(e, "Cannot list state dir: %s", stateDir);
+ }
+ return out;
+ }
+
+ /** The single run whose status is RUNNING or AWAITING_VOTE, if any. */
+ public Optional<RunState> activeRun() {
+ return loadAll().stream().filter(r -> r.status == RunStatus.RUNNING || r.status == RunStatus.AWAITING_VOTE)
+ .findFirst();
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/RunStatus.java b/src/main/java/org/apache/juneau/releng/engine/RunStatus.java
new file mode 100644
index 0000000000..1931b9f450
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/RunStatus.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine;
+
+/** Run-level status. */
+public enum RunStatus {
+ RUNNING, AWAITING_VOTE, FAILED, RELEASED, DROPPED
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/StepContext.java b/src/main/java/org/apache/juneau/releng/engine/StepContext.java
new file mode 100644
index 0000000000..844cd7c21d
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/StepContext.java
@@ -0,0 +1,119 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine;
+
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Consumer;
+import java.util.function.Supplier;
+import org.apache.juneau.releng.config.TargetProfile;
+import org.apache.juneau.releng.email.EmailService;
+import org.apache.juneau.releng.milestone.MilestoneService;
+import org.apache.juneau.releng.nexus.NexusStagingClient;
+import org.apache.juneau.releng.util.ProcessRunner;
+
+/** Injected into every {@link ReleaseStep#preview}/{@link ReleaseStep#apply}. */
+public class StepContext {
+ public RunState run;
+ public ProcessRunner runner;
+ public Consumer<String> log; // This step's RunLog.lineSink(): tees to that step's own log file
+ // and that step's own SSE broadcaster.
+ public ExecutionMode mode = ExecutionMode.SAFE; // stamped by the engine; SAFE unless LIVE is configured
+ public TargetProfile target = TargetProfile.prodDefault(); // stamped by the engine
+ public Path stagingRepo; // rm.staging.dir/git/juneau
+ public Path stateDir; // rm.state.dir
+ public String repoDir; // rm.repo.dir (maintainer's working clone)
+ public String committerEmail; // rm.git.committer.email
+ public String availid; // Apache LDAP account (from CredentialService)
+ public String ldapPassword; // resolved for the duration of a mutating step, then zeroed
+ public String gpgKeyId;
+ public String gpgPassphrase;
+ public String githubToken; // for GH_TOKEN env
+ public NexusStagingClient nexus;
+ public EmailService email;
+ public MilestoneService milestone;
+ public Map<String, String> formInputs; // developmentVersion, voteOutcome, tally, repoIdOverride, checklist...
+
+ /** Runs a subprocess with output teed to the SSE log (helper for step apply/preview implementations). */
+ public ProcessRunner.ProcResult exec(List<String> command) {
+ return runner.run(command, null, null, log);
+ }
+
+ public ProcessRunner.ProcResult exec(List<String> command, String stdin, Map<String, String> env) {
+ return runner.run(command, stdin, env, log);
+ }
+
+ /** Is this a LIVE run? (SAFE simulates mutating callouts; LIVE executes them.) */
+ public boolean live() {
+ return mode == ExecutionMode.LIVE;
+ }
+
+ /**
+ * The Tier-B safe/live seam for mutating subprocess calls. In LIVE, runs the command (teed to the step
+ * log). In SAFE, logs a redacted "would run:" line, spawns nothing, and returns synthetic success so the
+ * downstream {@code .ok()} checks pass with zero side effects.
+ */
+ public ProcessRunner.ProcResult dryRunOr(List<String> command) {
+ return dryRunOr(command, null, null);
+ }
+
+ public ProcessRunner.ProcResult dryRunOr(List<String> command, String stdin, Map<String, String> env) {
+ if (live())
+ return runner.run(command, stdin, env, log);
+ var line = "would run: " + String.join(" ", redactArgv(command));
+ if (stdin != null)
+ line += " <stdin:redacted>";
+ log.accept(line);
+ return new ProcessRunner.ProcResult(0, "[SAFE] simulated");
+ }
+
+ /**
+ * The Tier-B seam for non-subprocess mutations (e.g. an in-process HTTP write): runs the supplier in
+ * LIVE, logs the described action and returns {@code simulated} in SAFE.
+ */
+ public <T> T dryRunOr(String describe, Supplier<T> real, T simulated) {
+ if (live())
+ return real.get();
+ log.accept("would " + describe);
+ return simulated;
+ }
+
+ /**
+ * Belt-and-suspenders scrub of any secret-shaped token before a command is logged. Secrets are already
+ * kept off argv (passed via stdin/env), so this only guards against a future call site accidentally
+ * placing a credential immediately after a {@code --password}/{@code --token}-style flag.
+ */
+ public static List<String> redactArgv(List<String> command) {
+ var out = new ArrayList<String>(command.size());
+ var redactNext = false;
+ for (var token : command) {
+ if (redactNext) {
+ out.add("<redacted>");
+ redactNext = false;
+ continue;
+ }
+ out.add(token);
+ var t = token.toLowerCase();
+ redactNext = (t.endsWith("password") || t.endsWith("token") || t.endsWith("passphrase")
+ || t.endsWith("secret")) && !t.contains("from-stdin");
+ }
+ return out;
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/StepRegistry.java b/src/main/java/org/apache/juneau/releng/engine/StepRegistry.java
new file mode 100644
index 0000000000..4f8a6df350
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/StepRegistry.java
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine;
+
+import java.util.List;
+import org.apache.juneau.releng.engine.steps.*;
+
+/** The ordered list of the 24 pipeline steps. */
+public class StepRegistry {
+
+ private final List<ReleaseStep> steps;
+
+ public StepRegistry(List<ReleaseStep> steps) {
+ this.steps = List.copyOf(steps);
+ }
+
+ /** The canonical 24-step pipeline in spec order. */
+ public static StepRegistry standard(BranchResolver branches) {
+ return new StepRegistry(List.of(new PreflightStep(branches), // 1
+ new ComposeProposeEmailStep(), // 2
+ new WorkspaceSetupStep(), // 3
+ new BuildVerifyStep(), // 4
+ new JavadocVerifyStep(), // 5
+ new TestWorkspaceVerifyStep(), // 6
+ new DeploySnapshotStep(), // 7
+ new ReleasePrepareStep(), // 8
+ new ReleaseDiffReviewStep(), // 9
+ new ReleasePerformStep(), // 10
+ new NexusStagingCloseStep(), // 11
+ new BinaryArtifactsStageStep(), // 12
+ new DevDistVerifyStep(), // 13
+ new ComposeVoteEmailStep(), // 14
+ new VoteGateStep(), // 15
+ new TallyVoteResultStep(), // 16
+ new ComposeResultEmailStep(), // 17
+ new NexusReleaseStep(), // 18
+ new DistPromoteStep(), // 19
+ new GithubReleaseCreateStep(), // 20
+ new MilestoneCloseStep(), // 21
+ new ManualFollowupChecklistStep(), // 22
+ new ComposeAnnouncementEmailStep(), // 23
+ new FinalizeRunStep() // 24
+ ));
+ }
+
+ public List<ReleaseStep> steps() {
+ return steps;
+ }
+
+ public List<String> ids() {
+ return steps.stream().map(ReleaseStep::id).toList();
+ }
+
+ public ReleaseStep byId(String id) {
+ for (var s : steps)
+ if (s.id().equals(id))
+ return s;
+ return null;
+ }
+
+ /** The 0-based index of the first step reset by Drop-RC: {@code workspace-setup}. */
+ public static final String DROP_RC_RESET_FROM = "workspace-setup";
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/StepResult.java b/src/main/java/org/apache/juneau/releng/engine/StepResult.java
new file mode 100644
index 0000000000..47e3c78044
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/StepResult.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine;
+
+/** Outcome of a step's apply(). */
+public class StepResult {
+ public boolean success;
+ public String message;
+
+ public StepResult() {
+ }
+
+ public StepResult(boolean success, String message) {
+ this.success = success;
+ this.message = message;
+ }
+
+ public static StepResult ok(String m) {
+ return new StepResult(true, m);
+ }
+
+ public static StepResult fail(String m) {
+ return new StepResult(false, m);
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/StepState.java b/src/main/java/org/apache/juneau/releng/engine/StepState.java
new file mode 100644
index 0000000000..34fed1d965
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/StepState.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine;
+
+/** One step's mutable state within a run. */
+public class StepState {
+ public String id;
+ public StepStatus status = StepStatus.PENDING;
+ public String startedAt; // ISO-8601 or null
+ public String completedAt; // ISO-8601 or null
+ public String error; // failure message + exit code, or null
+ public Long logOffset; // byte offset into this step's own log file at failure, or null
+ public String logRef; // path to this step's own log file, e.g.
+ // "logs/9.2.1-RC2-release-prepare.log"; null until first run
+
+ public StepState() {
+ }
+
+ public StepState(String id) {
+ this.id = id;
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/StepStatus.java b/src/main/java/org/apache/juneau/releng/engine/StepStatus.java
new file mode 100644
index 0000000000..4c7c1ab209
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/StepStatus.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine;
+
+/**
+ * Per-step status. {@code AWAITING_VOTE} only ever appears on {@code vote-gate}; {@code AWAITING_REVIEW} holds
+ * a review-gate step after its read-only work ran, until an explicit confirm-review advances it.
+ */
+public enum StepStatus {
+ PENDING, RUNNING, SUCCEEDED, FAILED, AWAITING_VOTE, AWAITING_REVIEW, SKIPPED
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/BinaryArtifactsStageStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/BinaryArtifactsStageStep.java
new file mode 100644
index 0000000000..c9de33c764
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/BinaryArtifactsStageStep.java
@@ -0,0 +1,132 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import static org.apache.juneau.commons.utils.Shorts.*;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.List;
+import java.util.Map;
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+
+/** §5.12 binary-artifacts-stage: pull signed artifacts, rename to ASF convention, commit to dist/dev SVN. Mutating. */
+public class BinaryArtifactsStageStep implements ReleaseStep {
+ @Override
+ public String id() {
+ return "binary-artifacts-stage";
+ }
+
+ @Override
+ public String title() {
+ return "Stage dist/dev artifacts";
+ }
+
+ @Override
+ public boolean mutating() {
+ return true;
+ }
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ return new Preview(id(), true).line("svn checkout " + ctx.target.distDevBase())
+ .line("wget signed source + binary artifacts from " + ctx.run.nexusRepoId)
+ .line("rename -> apache-juneau-" + ctx.run.version + "-{src,bin}.zip[.asc|.sha512]")
+ .line("svn add + commit RC" + ctx.run.rc);
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ var rc = "juneau-" + ctx.run.version + "-RC" + ctx.run.rc;
+ var dist = ctx.stateDir.resolve("dist");
+ var source = dist.resolve("source");
+ var binaries = dist.resolve("binaries");
+ var sourceRc = source.resolve(rc);
+ var binariesRc = binaries.resolve(rc);
+ var pw = ctx.ldapPassword + "\n";
+
+ // svn auth: --username <availid> --password-from-stdin (passphrase via stdin, never argv).
+ var co = ctx.dryRunOr(List.of("svn", "checkout", "--username", ctx.availid, "--password-from-stdin",
+ ctx.target.distDevBase(), dist.toString()), pw, null);
+ if (!co.ok())
+ return StepResult.fail("svn checkout of dist/dev failed.");
+
+ // Best-effort: clears whatever prior RC directories are present. The "*" here mirrors
+ // juneau-release.sh's shell-expanded `svn rm dist/source/*` textually; ProcessRunner has no
+ // shell, so it's passed as one literal argument (a no-op against a fresh/empty checkout, which
+ // is the common case since ASF dist working copies normally hold at most one prior RC).
+ ctx.dryRunOr(List.of("svn", "rm", source + "/*"));
+ ctx.dryRunOr(List.of("svn", "rm", binaries + "/*"));
+ ctx.dryRunOr(List.of("mkdir", sourceRc.toString()));
+ ctx.dryRunOr(List.of("mkdir", binariesRc.toString()));
+
+ var nexusUrl = ctx.target.nexusBaseUrl() + "/content/repositories/" + ctx.run.nexusRepoId
+ + "/org/apache/juneau/";
+ ctx.log.accept("Fetching signed source + binary artifacts from " + nexusUrl);
+ ctx.dryRunOr(List.of("wget", "-e", "robots=off", "--recursive", "--no-parent", "--no-directories", "-A",
+ "*-source-release*", "-P", sourceRc.toString(), nexusUrl));
+ ctx.dryRunOr(List.of("wget", "-e", "robots=off", "--recursive", "--no-parent", "--no-directories", "-A",
+ "juneau-distrib*-bin.zip*", "-P", binariesRc.toString(), nexusUrl));
+
+ ctx.log.accept("Renaming to apache-juneau-" + ctx.run.version + "-{src,bin}.zip[.asc|.sha512]");
+ renameAndChecksum(ctx, sourceRc, "juneau-" + ctx.run.version + "-source-release.zip",
+ "apache-juneau-" + ctx.run.version + "-src.zip");
+ renameAndChecksum(ctx, binariesRc, "juneau-distrib-" + ctx.run.version + "-bin.zip",
+ "apache-juneau-" + ctx.run.version + "-bin.zip");
+
+ ctx.dryRunOr(List.of("svn", "add", sourceRc.toString()));
+ ctx.dryRunOr(List.of("svn", "add", binariesRc.toString()));
+ var commit = ctx.dryRunOr(
+ List.of("svn", "commit", dist.toString(), "-m", rc, "--username", ctx.availid, "--password-from-stdin"),
+ pw, Map.of());
+ return commit.ok() ? StepResult.ok("Artifacts staged + committed to dist/dev.")
+ : StepResult.fail("svn commit to dist/dev failed.");
+ }
+
+ /**
+ * Renames the downloaded artifact (+ its {@code .asc}) to the ASF convention, regenerates its SHA-512
+ * checksum via {@code gpg --print-md SHA512}, and clears stray {@code .sha1}/{@code .md5} mirrors that
+ * Nexus may have served alongside it. All mutating calls route through {@code dryRunOr} (Tier B); the
+ * checksum file itself is only written in LIVE, since {@code ProcessRunner} has no shell to honor the
+ * script's {@code > file.sha512} redirection.
+ */
+ private void renameAndChecksum(StepContext ctx, Path dir, String downloaded, String renamed) {
+ ctx.dryRunOr(List.of("mv", dir.resolve(downloaded).toString(), dir.resolve(renamed).toString()));
+ ctx.dryRunOr(
+ List.of("mv", dir.resolve(downloaded + ".asc").toString(), dir.resolve(renamed + ".asc").toString()));
+ var sha = ctx.dryRunOr(List.of("gpg", "--print-md", "SHA512", dir.resolve(renamed).toString()));
+ if (ctx.live() && sha.ok())
+ writeShaFile(dir.resolve(renamed + ".sha512"), sha.output());
+ ctx.dryRunOr(List.of("rm", dir + "/*.sha1"));
+ ctx.dryRunOr(List.of("rm", dir + "/*.md5"));
+ }
+
+ private static void writeShaFile(Path path, String content) {
+ try {
+ Files.createDirectories(path.getParent());
+ Files.writeString(path, content, StandardCharsets.UTF_8);
+ } catch (IOException e) {
+ throw isex(e, "Cannot write %s", path);
+ }
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/BuildVerifyStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/BuildVerifyStep.java
new file mode 100644
index 0000000000..3d196a271a
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/BuildVerifyStep.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import java.util.List;
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+
+/** §5.4 build-verify: mvn clean verify on the checked-out branch. Fully idempotent. */
+public class BuildVerifyStep implements ReleaseStep {
+ @Override
+ public String id() {
+ return "build-verify";
+ }
+
+ @Override
+ public String title() {
+ return "Build & verify";
+ }
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ return new Preview(id(), false).line("Will run: mvn clean verify in " + ctx.stagingRepo);
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ var res = ctx.exec(List.of("mvn", "-f", ctx.stagingRepo.toString() + "/pom.xml", "clean", "verify"));
+ return res.ok() ? StepResult.ok("Build + tests passed.") : StepResult.fail("mvn clean verify failed.");
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/ComposeAnnouncementEmailStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/ComposeAnnouncementEmailStep.java
new file mode 100644
index 0000000000..eae71efc09
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/ComposeAnnouncementEmailStep.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import java.util.Map;
+import org.apache.juneau.releng.email.EmailTemplate;
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+
+/** §5.23 compose-announcement-email: draft-and-open [ANNOUNCEMENT]. */
+public class ComposeAnnouncementEmailStep implements ReleaseStep {
+ @Override
+ public String id() {
+ return "compose-announcement-email";
+ }
+
+ @Override
+ public String title() {
+ return "Compose [ANNOUNCEMENT] email";
+ }
+
+ private Map<String, String> vars(StepContext ctx) {
+ return Map.of("highlights", ctx.formInputs.getOrDefault("highlights", ""));
+ }
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ var p = new Preview(id(), false);
+ for (var line : ctx.email.renderBody(EmailTemplate.ANNOUNCEMENT, ctx.run, vars(ctx)).split("\n"))
+ p.line(line);
+ return p;
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ var path = ctx.email.compose(EmailTemplate.ANNOUNCEMENT, ctx.run, vars(ctx));
+ return StepResult.ok("Opened draft: " + path);
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/ComposeProposeEmailStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/ComposeProposeEmailStep.java
new file mode 100644
index 0000000000..05e253f64f
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/ComposeProposeEmailStep.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import java.util.Map;
+import org.apache.juneau.releng.email.EmailTemplate;
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+
+/** §5.2 compose-propose-email: draft-and-open the [PROPOSE] email. */
+public class ComposeProposeEmailStep implements ReleaseStep {
+ @Override
+ public String id() {
+ return "compose-propose-email";
+ }
+
+ @Override
+ public String title() {
+ return "Compose [PROPOSE] email";
+ }
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ var p = new Preview(id(), false);
+ for (var line : ctx.email.renderBody(EmailTemplate.PROPOSE, ctx.run, Map.of()).split("\n"))
+ p.line(line);
+ return p;
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ var path = ctx.email.compose(EmailTemplate.PROPOSE, ctx.run);
+ return StepResult.ok("Opened draft: " + path);
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/ComposeResultEmailStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/ComposeResultEmailStep.java
new file mode 100644
index 0000000000..7e3ccdb070
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/ComposeResultEmailStep.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import java.util.Map;
+import org.apache.juneau.releng.email.EmailTemplate;
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+
+/** §5.17 compose-result-email: draft-and-open [RESULT] with the tally from §5.16. */
+public class ComposeResultEmailStep implements ReleaseStep {
+ @Override
+ public String id() {
+ return "compose-result-email";
+ }
+
+ @Override
+ public String title() {
+ return "Compose [RESULT] email";
+ }
+
+ private Map<String, String> vars(StepContext ctx) {
+ return Map.of("outcome", ctx.formInputs.getOrDefault("voteOutcome", "passed"), "tally",
+ ctx.formInputs.getOrDefault("tally", ""));
+ }
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ var p = new Preview(id(), false);
+ for (var line : ctx.email.renderBody(EmailTemplate.RESULT, ctx.run, vars(ctx)).split("\n"))
+ p.line(line);
+ return p;
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ var path = ctx.email.compose(EmailTemplate.RESULT, ctx.run, vars(ctx));
+ return StepResult.ok("Opened draft: " + path);
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/ComposeVoteEmailStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/ComposeVoteEmailStep.java
new file mode 100644
index 0000000000..44a80ae180
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/ComposeVoteEmailStep.java
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.util.List;
+import java.util.Map;
+import org.apache.juneau.releng.email.EmailTemplate;
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+
+/** §5.14 compose-vote-email: checksums + commit + staging link + 72h deadline, then draft-and-open. */
+public class ComposeVoteEmailStep implements ReleaseStep {
+ @Override
+ public String id() {
+ return "compose-vote-email";
+ }
+
+ @Override
+ public String title() {
+ return "Compose [VOTE] email";
+ }
+
+ private Map<String, String> gather(StepContext ctx) {
+ var tag = "juneau-" + ctx.run.version + "-RC" + ctx.run.rc;
+ var commit = ctx.runner.run(List.of("git", "-C", ctx.stagingRepo.toString(), "rev-parse", tag), null, null);
+ // srcSha512/binSha512 are computed from the .sha512 files binary-artifacts-stage (§5.12) actually
+ // produced in the local dist/dev working copy — never pasted from a form.
+ return Map.of("commitHash", commit.ok() ? commit.output().strip() : "(unknown)", "srcSha512",
+ readSha512(ctx, "source", "src"), "binSha512", readSha512(ctx, "binaries", "bin"));
+ }
+
+ /** Reads the {@code .sha512} file §5.12 wrote for this RC; blank (SAFE soft-note) if absent. */
+ private String readSha512(StepContext ctx, String subdir, String kind) {
+ var rc = "juneau-" + ctx.run.version + "-RC" + ctx.run.rc;
+ var name = "apache-juneau-" + ctx.run.version + "-" + kind + ".zip.sha512";
+ var file = ctx.stateDir.resolve("dist").resolve(subdir).resolve(rc).resolve(name);
+ try {
+ return Files.isRegularFile(file) ? Files.readString(file).strip() : "";
+ } catch (IOException e) {
+ return "";
+ }
+ }
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ var p = new Preview(id(), false);
+ for (var line : ctx.email.renderBody(EmailTemplate.VOTE, ctx.run, gather(ctx)).split("\n"))
+ p.line(line);
+ return p;
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ var data = gather(ctx);
+ // OQ-E: under SAFE the RC tag + dist checksums were never really produced, so fill-ins may be blank.
+ // Note it and continue rather than hard-failing — the draft is still useful for a rehearsal.
+ if ("(unknown)".equals(data.get("commitHash")) || data.get("srcSha512").isBlank())
+ ctx.log.accept("Note: RC tag/checksums absent (expected under SAFE) — composing draft with placeholders.");
+ var path = ctx.email.compose(EmailTemplate.VOTE, ctx.run, data);
+ return StepResult.ok("Opened draft: " + path);
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/DeploySnapshotStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/DeploySnapshotStep.java
new file mode 100644
index 0000000000..3bf7524262
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/DeploySnapshotStep.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import java.util.List;
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+
+/** §5.7 deploy-snapshot: mvn deploy; primes gpg-agent once (passphrase on stdin, never argv). Mutating. */
+public class DeploySnapshotStep implements ReleaseStep {
+ @Override
+ public String id() {
+ return "deploy-snapshot";
+ }
+
+ @Override
+ public String title() {
+ return "Deploy snapshot";
+ }
+
+ @Override
+ public boolean mutating() {
+ return true;
+ }
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ return new Preview(id(), true)
+ .line("Will prime gpg-agent (key " + ctx.gpgKeyId + ") then run: mvn deploy in " + ctx.stagingRepo);
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ // Prime gpg-agent once: throwaway loopback sign, passphrase via stdin (mirrors GpgValidator).
+ ctx.dryRunOr(
+ List.of("gpg", "--batch", "--yes", "--pinentry-mode", "loopback", "--passphrase-fd", "0",
+ "--local-user", ctx.gpgKeyId, "--sign", "--output", "/dev/null", "-"),
+ ctx.gpgPassphrase + "\n", null);
+ var res = ctx.dryRunOr(List.of("mvn", "-f", ctx.stagingRepo.toString() + "/pom.xml", "deploy"));
+ return res.ok() ? StepResult.ok("SNAPSHOT deployed.") : StepResult.fail("mvn deploy failed.");
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/DevDistVerifyStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/DevDistVerifyStep.java
new file mode 100644
index 0000000000..4309d247a1
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/DevDistVerifyStep.java
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+
+/** §5.13 dev-dist-verify: confirm the 6 expected files present + non-empty; open dist URL for spot-check. */
+public class DevDistVerifyStep implements ReleaseStep {
+
+ private static final List<String> KINDS = List.of("src", "bin");
+ private static final List<String> EXTENSIONS = List.of("", ".asc", ".sha512");
+
+ @Override
+ public String id() {
+ return "dev-dist-verify";
+ }
+
+ @Override
+ public String title() {
+ return "Verify dist/dev";
+ }
+
+ @Override
+ public boolean reviewGate() {
+ return true;
+ }
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ return new Preview(id(), false).line("Check src/bin × {.zip,.zip.asc,.zip.sha512} exist + non-empty.");
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ var missing = missingOrEmptyFiles(ctx);
+ if (!missing.isEmpty()) {
+ // SAFE fidelity note (§8): binary-artifacts-stage's staging was command-logged in SAFE, so these
+ // files were never really produced — soft-note rather than fail the rehearsal (OQ-E). In LIVE the
+ // files are expected to exist for real, so their absence is a genuine failure.
+ if (!ctx.live()) {
+ ctx.log.accept("Note (SAFE: artifacts not staged) — missing/empty: " + missing);
+ } else {
+ return StepResult.fail("Missing or empty dist/dev file(s): " + missing);
+ }
+ }
+
+ var url = ctx.target.distDevBase() + "/";
+ if (ctx.live())
+ ctx.exec(List.of("open", url));
+ else
+ ctx.log.accept("SAFE: staging was command-logged, so no browser is opened for " + url);
+ return StepResult.ok("Dist files present — spot-check the opened URL, then confirm.");
+ }
+
+ /** Refreshes the local dist/dev working copy, then checks the 6 ASF-convention files for this RC. */
+ private List<String> missingOrEmptyFiles(StepContext ctx) {
+ var rc = "juneau-" + ctx.run.version + "-RC" + ctx.run.rc;
+ var dist = ctx.stateDir.resolve("dist");
+ ctx.dryRunOr(List.of("svn", "checkout", "--username", ctx.availid, "--password-from-stdin",
+ ctx.target.distDevBase(), dist.toString()), ctx.ldapPassword + "\n", null);
+
+ var missing = new ArrayList<String>();
+ for (var kind : KINDS) {
+ var subdir = "src".equals(kind) ? "source" : "binaries";
+ for (var ext : EXTENSIONS) {
+ var name = "apache-juneau-" + ctx.run.version + "-" + kind + ".zip" + ext;
+ var file = dist.resolve(subdir).resolve(rc).resolve(name);
+ if (!Files.isRegularFile(file) || fileSize(file) == 0)
+ missing.add(name);
+ }
+ }
+ return missing;
+ }
+
+ private static long fileSize(Path file) {
+ try {
+ return Files.size(file);
+ } catch (java.io.IOException e) {
+ return 0;
+ }
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/DistPromoteStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/DistPromoteStep.java
new file mode 100644
index 0000000000..8a0cf10e7a
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/DistPromoteStep.java
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import java.util.List;
+import java.util.Map;
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+import org.apache.juneau.releng.release.ReleaseVersion;
+
+/** §5.19 dist-promote: svn move dist/dev -> dist/release/<version>; remove prior release on the line. Mutating. */
+public class DistPromoteStep implements ReleaseStep {
+
+ // The six ASF-convention artifact files a fixed binary-artifacts-stage (§5.12) commits to dist/dev.
+ private static final List<String> EXTENSIONS = List.of("", ".asc", ".sha512");
+
+ @Override
+ public String id() {
+ return "dist-promote";
+ }
+
+ @Override
+ public String title() {
+ return "Promote dist/dev -> dist/release";
+ }
+
+ @Override
+ public boolean mutating() {
+ return true;
+ }
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ var rc = "juneau-" + ctx.run.version + "-RC" + ctx.run.rc;
+ var prior = priorReleaseOnLine(ctx);
+ var p = new Preview(id(), true).line(
+ "svn move dist/dev/juneau/{source,binaries}/" + rc + " -> dist/release/juneau/" + ctx.run.version);
+ p.line(prior == null ? "No prior release on this line to remove."
+ : "svn rm dist/release/juneau/" + prior + " (mirror hygiene)");
+ p.line("svn commit.");
+ return p;
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ var rc = "juneau-" + ctx.run.version + "-RC" + ctx.run.rc;
+ var version = ctx.run.version;
+ var dev = ctx.stateDir.resolve("dist-dev");
+ var release = ctx.stateDir.resolve("dist-release");
+ var pw = ctx.ldapPassword + "\n";
+
+ var coDev = ctx.dryRunOr(List.of("svn", "checkout", "--username", ctx.availid, "--password-from-stdin",
+ ctx.target.distDevBase(), dev.toString()), pw, null);
+ if (!coDev.ok())
+ return StepResult.fail("svn checkout of dist/dev failed.");
+ var coRelease = ctx.dryRunOr(List.of("svn", "checkout", "--username", ctx.availid, "--password-from-stdin",
+ ctx.target.distReleaseBase(), release.toString()), pw, null);
+ if (!coRelease.ok())
+ return StepResult.fail("svn checkout of dist/release failed.");
+
+ var destDir = release.resolve(version);
+ ctx.dryRunOr(List.of("mkdir", destDir.toString()));
+ for (var ext : EXTENSIONS) {
+ var name = "apache-juneau-" + version + "-src.zip" + ext;
+ ctx.dryRunOr(List.of("svn", "mv", dev.resolve("source").resolve(rc).resolve(name).toString(),
+ destDir.resolve(name).toString()));
+ }
+ for (var ext : EXTENSIONS) {
+ var name = "apache-juneau-" + version + "-bin.zip" + ext;
+ ctx.dryRunOr(List.of("svn", "mv", dev.resolve("binaries").resolve(rc).resolve(name).toString(),
+ destDir.resolve(name).toString()));
+ }
+
+ var prior = priorReleaseOnLine(ctx);
+ if (prior != null)
+ ctx.dryRunOr(List.of("svn", "rm", release.resolve(prior).toString()));
+
+ var commit = ctx.dryRunOr(List.of("svn", "commit", dev.toString(), release.toString(), "-m",
+ "Apache Juneau " + version, "--username", ctx.availid, "--password-from-stdin"), pw, Map.of());
+ return commit.ok() ? StepResult.ok("Promoted to dist/release.") : StepResult.fail("svn promote failed.");
+ }
+
+ /** The highest non-prerelease version on {@code ctx.run.version}'s major.minor line, strictly below it. */
+ private static String priorReleaseOnLine(StepContext ctx) {
+ var tags = ctx.runner.runLines(List.of("git", "-C", ctx.repoDir, "tag", "--list", "juneau-*"));
+ var target = ReleaseVersion.of(ctx.run.version);
+ ReleaseVersion best = null;
+ for (var t : tags) {
+ var v = ReleaseVersion.ofTag(t);
+ if (v.isPrerelease() || v.major() != target.major() || v.minor() != target.minor())
+ continue;
+ if (v.compareTo(target) >= 0)
+ continue;
+ if (best == null || v.compareTo(best) > 0)
+ best = v;
+ }
+ return best == null ? null : best.version();
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/FinalizeRunStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/FinalizeRunStep.java
new file mode 100644
index 0000000000..7527cc25cb
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/FinalizeRunStep.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.RunStatus;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+
+/** §5.24 finalize-run: mark RELEASED, freeze state, release the single-active-run lock. Terminal. */
+public class FinalizeRunStep implements ReleaseStep {
+ @Override
+ public String id() {
+ return "finalize-run";
+ }
+
+ @Override
+ public String title() {
+ return "Finalize run";
+ }
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ return new Preview(id(), false).line("Mark run RELEASED and freeze state.");
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ ctx.run.status = RunStatus.RELEASED;
+ ctx.log.accept("Run finalized: " + ctx.run.version + " released.");
+ return StepResult.ok("Run finalized.");
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/GithubReleaseCreateStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/GithubReleaseCreateStep.java
new file mode 100644
index 0000000000..021e6c2c6a
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/GithubReleaseCreateStep.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import java.util.List;
+import java.util.Map;
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+
+/** §5.20 github-release-create: gh release create (no binary assets); GH_TOKEN via env. Mutating; retry-safe. */
+public class GithubReleaseCreateStep implements ReleaseStep {
+ @Override
+ public String id() {
+ return "github-release-create";
+ }
+
+ @Override
+ public String title() {
+ return "Create GitHub Release";
+ }
+
+ @Override
+ public boolean mutating() {
+ return true;
+ }
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ return new Preview(id(), true).line(
+ "gh release create juneau-" + ctx.run.version + "-RC" + ctx.run.rc + " --repo " + ctx.target.ghSlug()
+ + " --title " + ctx.run.version + " (notes from release-notes + PRs + dist)");
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ var tag = "juneau-" + ctx.run.version + "-RC" + ctx.run.rc;
+ var env = Map.of("GH_TOKEN", ctx.githubToken);
+ // Idempotency: treat "already exists" as success. Only probed LIVE; in SAFE the create is
+ // command-logged unconditionally (no gh call is made to check for a real, pre-existing release).
+ if (ctx.live()) {
+ var exists = ctx.runner.run(List.of("gh", "release", "view", tag, "--repo", ctx.target.ghSlug()), null,
+ env);
+ if (exists.ok()) {
+ ctx.log.accept("GitHub Release already exists for " + tag);
+ return StepResult.ok("Already exists.");
+ }
+ }
+ var notes = ctx.formInputs.getOrDefault("releaseNotes", "See release notes.");
+ var res = ctx.dryRunOr(List.of("gh", "release", "create", tag, "--repo", ctx.target.ghSlug(), "--title",
+ ctx.run.version, "--notes", notes), null, env);
+ return res.ok() ? StepResult.ok("GitHub Release created.") : StepResult.fail("gh release create failed.");
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/JavadocVerifyStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/JavadocVerifyStep.java
new file mode 100644
index 0000000000..ab1bb92401
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/JavadocVerifyStep.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import java.util.List;
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+
+/** §5.5 javadoc-verify: mvn javadoc:aggregate; human confirms cleanliness. Skippable. */
+public class JavadocVerifyStep implements ReleaseStep {
+ @Override
+ public String id() {
+ return "javadoc-verify";
+ }
+
+ @Override
+ public String title() {
+ return "Javadoc verify";
+ }
+
+ @Override
+ public boolean reviewGate() {
+ return true;
+ }
+
+ @Override
+ public boolean skippable() {
+ return true;
+ }
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ return new Preview(id(), false).line("Will run: mvn javadoc:aggregate in " + ctx.stagingRepo);
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ var res = ctx.exec(List.of("mvn", "-f", ctx.stagingRepo.toString() + "/pom.xml", "javadoc:aggregate"));
+ // Non-zero-but-noisy javadoc historically continues; require human "looks clean" via the review gate.
+ return res.ok() ? StepResult.ok("Javadoc generated — review the log, then confirm.")
+ : StepResult.ok("Javadoc finished with warnings/errors — review the log carefully, then confirm.");
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/ManualFollowupChecklistStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/ManualFollowupChecklistStep.java
new file mode 100644
index 0000000000..cd613d1df6
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/ManualFollowupChecklistStep.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import java.util.List;
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+
+/** §5.22 manual-followup-checklist: reminder gate for the intentionally-manual tasks. No automation. */
+public class ManualFollowupChecklistStep implements ReleaseStep {
+ static final List<String> ITEMS = List.of("Update juneau-docs release-notes page + site",
+ "Publish aggregate Javadoc", "Update the download page", "Edit the Confluence release wiki");
+
+ @Override
+ public String id() {
+ return "manual-followup-checklist";
+ }
+
+ @Override
+ public String title() {
+ return "Manual follow-up checklist";
+ }
+
+ @Override
+ public boolean reviewGate() {
+ return true;
+ }
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ var p = new Preview(id(), false);
+ for (var i : ITEMS)
+ p.line("[ ] " + i);
+ return p;
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ var checked = ctx.formInputs.getOrDefault("checklist", "");
+ for (var i : ITEMS)
+ if (!checked.contains(i))
+ return StepResult.fail("All items must be checked.");
+ return StepResult.ok("All manual follow-ups acknowledged.");
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/MilestoneCloseStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/MilestoneCloseStep.java
new file mode 100644
index 0000000000..5c9bba4b20
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/MilestoneCloseStep.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import java.util.List;
+import java.util.Map;
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+
+/** The milestone-close step: close the GitHub Milestone via {@code gh api}. Mutating; idempotent. */
+public class MilestoneCloseStep implements ReleaseStep {
+ @Override
+ public String id() {
+ return "milestone-close";
+ }
+
+ @Override
+ public String title() {
+ return "Close milestone";
+ }
+
+ @Override
+ public boolean mutating() {
+ return true;
+ }
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ return new Preview(id(), true).line("Close milestone #" + ctx.run.milestoneNumber + " for " + ctx.run.version);
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ if (ctx.run.milestoneNumber == null)
+ return StepResult.ok("No milestone recorded; skipping.");
+ var env = Map.of("GH_TOKEN", ctx.githubToken);
+ var res = ctx.dryRunOr(
+ List.of("gh", "api", "repos/" + ctx.target.repoSlug() + "/milestones/" + ctx.run.milestoneNumber, "-X",
+ "PATCH", "-f", "state=closed"),
+ null, env);
+ return res.ok() ? StepResult.ok("Milestone closed.") : StepResult.fail("Milestone close failed.");
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/NexusReleaseStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/NexusReleaseStep.java
new file mode 100644
index 0000000000..587f022e13
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/NexusReleaseStep.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+
+/** §5.18 nexus-release: promote the closed staging repo to the public release repo. IRREVERSIBLE. Mutating. */
+public class NexusReleaseStep implements ReleaseStep {
+ @Override
+ public String id() {
+ return "nexus-release";
+ }
+
+ @Override
+ public String title() {
+ return "Release Nexus staging repo";
+ }
+
+ @Override
+ public boolean mutating() {
+ return true;
+ }
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ return new Preview(id(), true).line("Promote/release repo " + ctx.run.nexusRepoId + " to Maven Central.")
+ .line("THIS CANNOT BE UNDONE. Type the version to confirm.");
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ // Extra confirmation friction is enforced by ReleaseRunRest (type-to-confirm version string).
+ if (ctx.run.nexusRepoId == null)
+ return StepResult.fail("No nexusRepoId recorded.");
+ ctx.log.accept("Releasing Nexus repo " + ctx.run.nexusRepoId + " (irreversible).");
+ ctx.nexus.promote(ctx.run.nexusRepoId);
+ return StepResult.ok("Released " + ctx.run.nexusRepoId + " to public repo.");
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/NexusStagingCloseStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/NexusStagingCloseStep.java
new file mode 100644
index 0000000000..93af36e006
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/NexusStagingCloseStep.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+
+/** §5.11 nexus-staging-close: discover the just-created staging repo + close it. Mutating. */
+public class NexusStagingCloseStep implements ReleaseStep {
+ @Override
+ public String id() {
+ return "nexus-staging-close";
+ }
+
+ @Override
+ public String title() {
+ return "Close Nexus staging repo";
+ }
+
+ @Override
+ public boolean mutating() {
+ return true;
+ }
+
+ private String resolveRepoId(StepContext ctx) {
+ var override = ctx.formInputs.get("repoIdOverride");
+ if (override != null && !override.isBlank())
+ return override;
+ return ctx.nexus.findLatestRepo().map(r -> r.id).orElse(null);
+ }
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ var p = new Preview(id(), true);
+ p.overrideField = "repoIdOverride";
+ var id = resolveRepoId(ctx);
+ p.line("Discovered staging repo: " + (id == null ? "(none found — supply override)" : id));
+ p.line("Will POST close for this repo id.");
+ return p;
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ var id = resolveRepoId(ctx);
+ if (id == null)
+ return StepResult.fail("No staging repo discovered; supply a manual repoIdOverride.");
+ ctx.run.nexusRepoId = id;
+ ctx.log.accept("Closing Nexus staging repo " + id);
+ ctx.nexus.close(id);
+ return StepResult.ok("Closed staging repo " + id + ".");
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/PreflightStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/PreflightStep.java
new file mode 100644
index 0000000000..ce19d81079
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/PreflightStep.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import java.util.List;
+import org.apache.juneau.releng.engine.BranchResolver;
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+
+/** §5.1 preflight: verify toolchain + target branch exists (never creates). Read-only; preview == apply. */
+public class PreflightStep implements ReleaseStep {
+
+ private final BranchResolver branches;
+
+ public PreflightStep(BranchResolver branches) {
+ this.branches = branches;
+ }
+
+ @Override
+ public String id() {
+ return "preflight";
+ }
+
+ @Override
+ public String title() {
+ return "Preflight checks";
+ }
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ var p = new Preview(id(), false);
+ for (var tool : List.of("wget", "gpg", "svn", "git", "java", "mvn")) {
+ var res = ctx.runner.run(List.of("which", tool), null, null);
+ p.line((res.ok() ? "[ok] " : "[MISSING] ") + tool);
+ }
+ var branch = branches.resolve(ctx.run.version);
+ p.line("Target version: " + ctx.run.version + " RC" + ctx.run.rc);
+ p.line("Resolved branch: " + branch);
+ p.line("Branch exists on origin: " + branches.remoteBranchExists(branch));
+ return p;
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ var branch = branches.resolve(ctx.run.version);
+ ctx.run.branch = branch;
+ ctx.log.accept("Resolved target branch: " + branch);
+ if (!branches.remoteBranchExists(branch)) {
+ var msg = branches.missingBranchInstructions(branch);
+ ctx.log.accept(msg);
+ return StepResult.fail(msg);
+ }
+ return StepResult.ok("Preflight passed; branch " + branch + " exists.");
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/ReleaseDiffReviewStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/ReleaseDiffReviewStep.java
new file mode 100644
index 0000000000..f13be6be34
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/ReleaseDiffReviewStep.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import java.util.List;
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+
+/** §5.9 release-diff-review: git diff against the RC tag; human confirms. Read-only. */
+public class ReleaseDiffReviewStep implements ReleaseStep {
+ @Override
+ public String id() {
+ return "release-diff-review";
+ }
+
+ @Override
+ public String title() {
+ return "Review release diff";
+ }
+
+ @Override
+ public boolean reviewGate() {
+ return true;
+ }
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ return new Preview(id(), false).line("Will run: git diff juneau-" + ctx.run.version + "-RC" + ctx.run.rc);
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ ctx.exec(List.of("git", "-C", ctx.stagingRepo.toString(), "diff",
+ "juneau-" + ctx.run.version + "-RC" + ctx.run.rc));
+ return StepResult.ok("Diff rendered — confirm it looks correct.");
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/ReleasePerformStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/ReleasePerformStep.java
new file mode 100644
index 0000000000..8c64946cac
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/ReleasePerformStep.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import java.util.List;
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+
+/** §5.10 release-perform: build from tag + deploy to a new Nexus staging repo. Mutating. */
+public class ReleasePerformStep implements ReleaseStep {
+ @Override
+ public String id() {
+ return "release-perform";
+ }
+
+ @Override
+ public String title() {
+ return "release:perform";
+ }
+
+ @Override
+ public boolean mutating() {
+ return true;
+ }
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ return new Preview(id(), true).line("Will run: mvn release:perform (builds juneau-" + ctx.run.version + "-RC"
+ + ctx.run.rc + " from target/checkout)");
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ var res = ctx.dryRunOr(List.of("mvn", "-f", ctx.stagingRepo.toString() + "/pom.xml", "release:perform"));
+ return res.ok() ? StepResult.ok("release:perform complete; staging repo populated.")
+ : StepResult.fail("mvn release:perform failed.");
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/ReleasePrepareStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/ReleasePrepareStep.java
new file mode 100644
index 0000000000..a3572fba2e
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/ReleasePrepareStep.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import java.util.List;
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+import org.apache.juneau.releng.release.ReleaseVersion;
+
+/** §5.8 release-prepare: version bump + RC tag + push. Mutating. z==0 requires explicit developmentVersion (§14.1). */
+public class ReleasePrepareStep implements ReleaseStep {
+ @Override
+ public String id() {
+ return "release-prepare";
+ }
+
+ @Override
+ public String title() {
+ return "release:prepare";
+ }
+
+ @Override
+ public boolean mutating() {
+ return true;
+ }
+
+ /** Next dev version: derived for maintenance (z>0), human-supplied for z==0 (returns null -> caller fails). */
+ static String nextDevVersion(StepContext ctx) {
+ var v = ReleaseVersion.of(ctx.run.version);
+ if (v.maintenance() > 0)
+ return v.major() + "." + v.minor() + "." + (v.maintenance() + 1) + "-SNAPSHOT";
+ var supplied = ctx.formInputs.get("developmentVersion");
+ if (supplied == null && ctx.run.developmentVersion != null)
+ supplied = ctx.run.developmentVersion;
+ return (supplied == null || supplied.isBlank()) ? null : supplied;
+ }
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ var next = nextDevVersion(ctx);
+ var p = new Preview(id(), true);
+ p.line("mvn release:prepare -DreleaseVersion=" + ctx.run.version + " -Dtag=juneau-" + ctx.run.version + "-RC"
+ + ctx.run.rc + " -DdevelopmentVersion="
+ + (next == null ? "<REQUIRED — supply developmentVersion>" : next));
+ if (next == null)
+ p.line("z==0 release: an explicit developmentVersion input is REQUIRED.");
+ return p;
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ var next = nextDevVersion(ctx);
+ if (next == null)
+ return StepResult.fail("z==0 release requires an explicit developmentVersion.");
+ ctx.run.developmentVersion = next;
+ var res = ctx.dryRunOr(List.of("mvn", "-f", ctx.stagingRepo.toString() + "/pom.xml", "release:prepare",
+ "-DautoVersionSubmodules=true", "-DreleaseVersion=" + ctx.run.version,
+ "-Dtag=juneau-" + ctx.run.version + "-RC" + ctx.run.rc, "-DdevelopmentVersion=" + next));
+ return res.ok() ? StepResult.ok("release:prepare complete; tag pushed.")
+ : StepResult.fail("mvn release:prepare failed.");
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/TallyVoteResultStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/TallyVoteResultStep.java
new file mode 100644
index 0000000000..81990a6860
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/TallyVoteResultStep.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+
+/** §5.16 tally-vote-result: record outcome (passed/rejected) + tally text. rejected -> Drop-RC (engine handles). */
+public class TallyVoteResultStep implements ReleaseStep {
+ @Override
+ public String id() {
+ return "tally-vote-result";
+ }
+
+ @Override
+ public String title() {
+ return "Tally vote result";
+ }
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ return new Preview(id(), false).line("Submit outcome (passed|rejected) + tally summary.");
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ var outcome = ctx.formInputs.getOrDefault("voteOutcome", "");
+ if (!outcome.equals("passed") && !outcome.equals("rejected"))
+ return StepResult.fail("voteOutcome must be 'passed' or 'rejected'.");
+ ctx.log.accept("Vote outcome recorded: " + outcome);
+ // 'rejected' is routed to Drop-RC by ReleaseEngine.applyStep, not here.
+ return StepResult.ok("Vote outcome: " + outcome + ".");
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/TestWorkspaceVerifyStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/TestWorkspaceVerifyStep.java
new file mode 100644
index 0000000000..739739c08c
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/TestWorkspaceVerifyStep.java
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import java.util.List;
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+
+/**
+ * §5.6 test-workspace-verify: unzip the reactor's workspace-template {@code -bin.zip} artifacts; human confirms
+ * clean Eclipse import. Skippable.
+ *
+ * <p>The four modules below (decision S10) are every reactor module whose {@code pom.xml} wires the
+ * {@code maven-assembly-plugin} to a {@code src/assembly/bin.xml} descriptor producing a workspace-import
+ * template zip — derived from the 10.0 reactor's actual module poms (not just {@code juneau-release.sh}'s
+ * older two-zip list, which predates {@code juneau-examples-mcp} and {@code juneau-sc-server}):
+ * {@code juneau-examples/juneau-examples-core}, {@code juneau-examples/juneau-examples-mcp},
+ * {@code juneau-petstore/juneau-petstore-jetty}, and {@code juneau-sc/juneau-sc-server}. Each assembly's
+ * {@code finalName} is {@code <artifactId>-${project.version}}, so at this point in the pipeline (run
+ * <b>before</b> {@code release-prepare} bumps the pom versions) the produced file is
+ * {@code <artifactId>-<version>-SNAPSHOT-bin.zip} under that module's {@code target/}. {@code juneau-distrib}
+ * also produces a {@code bin.zip}, but that's the full source+binary distribution artifact handled by
+ * {@code binary-artifacts-stage} (§5.12), not a workspace-import template, so it's excluded here.
+ */
+public class TestWorkspaceVerifyStep implements ReleaseStep {
+
+ /** {@code modulePath} relative to the staging clone root; {@code artifactId} is also the unzip target name. */
+ private record WorkspaceZip(String modulePath, String artifactId) {
+ }
+
+ private static final List<WorkspaceZip> ZIPS = List.of(
+ new WorkspaceZip("juneau-examples/juneau-examples-core", "juneau-examples-core"),
+ new WorkspaceZip("juneau-examples/juneau-examples-mcp", "juneau-examples-mcp"),
+ new WorkspaceZip("juneau-petstore/juneau-petstore-jetty", "juneau-petstore-jetty"),
+ new WorkspaceZip("juneau-sc/juneau-sc-server", "juneau-sc-server"));
+
+ @Override
+ public String id() {
+ return "test-workspace-verify";
+ }
+
+ @Override
+ public String title() {
+ return "Test-workspace verify";
+ }
+
+ @Override
+ public boolean reviewGate() {
+ return true;
+ }
+
+ @Override
+ public boolean skippable() {
+ return true;
+ }
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ var p = new Preview(id(), false);
+ for (var z : ZIPS)
+ p.line("Unzip: " + zipPath(ctx, z) + " -> target/workspace/" + z.artifactId());
+ return p;
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ var base = ctx.stagingRepo.toString();
+ for (var z : ZIPS)
+ ctx.exec(List.of("unzip", "-o", zipPath(ctx, z), "-d", base + "/target/workspace/" + z.artifactId()));
+ return StepResult.ok("Workspaces unzipped — confirm they import cleanly into Eclipse.");
+ }
+
+ /** The pre-{@code release-prepare} SNAPSHOT version drives the assembly's {@code finalName}. */
+ private static String zipPath(StepContext ctx, WorkspaceZip z) {
+ var snapshot = ctx.run.version + "-SNAPSHOT";
+ return ctx.stagingRepo + "/" + z.modulePath() + "/target/" + z.artifactId() + "-" + snapshot + "-bin.zip";
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/VoteGateStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/VoteGateStep.java
new file mode 100644
index 0000000000..d8d1759fe5
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/VoteGateStep.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import java.time.Instant;
+import java.time.temporal.ChronoUnit;
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+
+/** §5.15 vote-gate: hold the pipeline open ~72h. Entering it is the gate; only tally-vote-result advances. */
+public class VoteGateStep implements ReleaseStep {
+ @Override
+ public String id() {
+ return "vote-gate";
+ }
+
+ @Override
+ public String title() {
+ return "Awaiting vote";
+ }
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ return new Preview(id(), false).line("Sets status AWAITING_VOTE; deadline = now + 72h.");
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ ctx.run.voteDeadline = Instant.now().plus(72, ChronoUnit.HOURS).toString();
+ ctx.log.accept("Vote opened; closes " + ctx.run.voteDeadline);
+ return StepResult.ok("Awaiting vote until " + ctx.run.voteDeadline + ".");
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/engine/steps/WorkspaceSetupStep.java b/src/main/java/org/apache/juneau/releng/engine/steps/WorkspaceSetupStep.java
new file mode 100644
index 0000000000..6b6bef6b6f
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/engine/steps/WorkspaceSetupStep.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.engine.steps;
+
+import java.nio.file.Files;
+import java.util.List;
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseStep;
+import org.apache.juneau.releng.engine.StepContext;
+import org.apache.juneau.releng.engine.StepResult;
+
+/** §5.3 workspace-setup: clean staging clone of the resolved branch (idempotent; re-pulls on re-run). */
+public class WorkspaceSetupStep implements ReleaseStep {
+ @Override
+ public String id() {
+ return "workspace-setup";
+ }
+
+ @Override
+ public String title() {
+ return "Workspace setup";
+ }
+
+ @Override
+ public boolean mutating() {
+ return false;
+ } // local only, but destructive .m2 cleanup -> apply gate
+
+ @Override
+ public Preview preview(StepContext ctx) {
+ var p = new Preview(id(), false);
+ var git = ctx.stagingRepo;
+ p.line("Staging clone: " + git);
+ p.line("Clone already present: " + Files.isDirectory(git.resolve(".git")));
+ p.line("Resolved branch: " + ctx.run.branch);
+ p.line("Will run: git checkout " + ctx.run.branch + " && git pull --ff-only origin " + ctx.run.branch);
+ return p;
+ }
+
+ @Override
+ public StepResult apply(StepContext ctx) {
+ var git = ctx.stagingRepo;
+ var gitStr = git.toString();
+ if (!Files.isDirectory(git.resolve(".git"))) {
+ var clone = ctx.exec(List.of("git", "clone", ctx.target.cloneUrl(), gitStr));
+ if (!clone.ok())
+ return StepResult.fail("git clone failed");
+ } else {
+ ctx.log.accept("Staging clone exists; skipping clone (idempotent).");
+ }
+ if (!ctx.exec(List.of("git", "-C", gitStr, "checkout", ctx.run.branch)).ok())
+ return StepResult.fail("git checkout " + ctx.run.branch + " failed");
+ if (!ctx.exec(List.of("git", "-C", gitStr, "pull", "--ff-only", "origin", ctx.run.branch)).ok())
+ return StepResult.fail("git pull --ff-only failed");
+ ctx.exec(List.of("git", "-C", gitStr, "config", "user.name", ctx.availid));
+ ctx.exec(List.of("git", "-C", gitStr, "config", "user.email", ctx.committerEmail));
+ return StepResult.ok("Staging clone ready on " + ctx.run.branch + " (fast-forwarded).");
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/log/LogBroadcaster.java b/src/main/java/org/apache/juneau/releng/log/LogBroadcaster.java
new file mode 100644
index 0000000000..eba8e53a54
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/log/LogBroadcaster.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.log;
+
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.function.Consumer;
+
+/** Per-run in-memory pub/sub of output lines. Subscribers are SSE connections. */
+public class LogBroadcaster {
+
+ private final List<Consumer<String>> subscribers = new CopyOnWriteArrayList<>();
+
+ public AutoCloseable subscribe(Consumer<String> sink) {
+ subscribers.add(sink);
+ return () -> subscribers.remove(sink);
+ }
+
+ public void publish(String line) {
+ for (var s : subscribers) {
+ try {
+ s.accept(line);
+ } catch (RuntimeException ignore) {
+ /* a dead client must not break others */ }
+ }
+ }
+
+ public int subscriberCount() {
+ return subscribers.size();
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/log/RunLog.java b/src/main/java/org/apache/juneau/releng/log/RunLog.java
new file mode 100644
index 0000000000..453c23c120
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/log/RunLog.java
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.log;
+
+import static org.apache.juneau.commons.utils.Shorts.*;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.StandardOpenOption;
+import java.util.function.Consumer;
+import org.apache.juneau.releng.engine.StepState;
+
+/** Appends output lines to the current RC's log file and fans them out to the {@link LogBroadcaster}. */
+public class RunLog {
+
+ private final Path file;
+ private final LogBroadcaster broadcaster;
+
+ public RunLog(Path file, LogBroadcaster broadcaster) {
+ this.file = file;
+ this.broadcaster = broadcaster;
+ try {
+ Files.createDirectories(file.getParent());
+ } catch (IOException e) {
+ throw isex(e, "Cannot create log dir for %s", file);
+ }
+ }
+
+ /** Append one line (newline-terminated) to disk, flushed, then broadcast it live. */
+ public synchronized void append(String line) {
+ try {
+ Files.writeString(file, line + "\n", StandardCharsets.UTF_8, StandardOpenOption.CREATE,
+ StandardOpenOption.APPEND);
+ } catch (IOException e) {
+ throw isex(e, "Cannot append to log %s", file);
+ }
+ broadcaster.publish(line);
+ }
+
+ /**
+ * Truncates this step's log file to empty: every invocation of a step — its first run or any later
+ * ad-hoc dry-run/apply/re-run — starts by discarding the previous invocation's output, so the file
+ * always reflects only the most recent run. A no-op if the file doesn't exist yet (a step's very first
+ * invocation). Does not touch the broadcaster directly; any already-connected SSE client simply stops
+ * seeing old lines replayed on its <i>next</i> reconnect (the live tail is unaffected mid-connection,
+ * since {@code reset()} doesn't itself publish anything).
+ */
+ public synchronized void reset() {
+ try {
+ Files.write(file, new byte[0], StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING);
+ } catch (IOException e) {
+ throw isex(e, "Cannot reset log %s", file);
+ }
+ }
+
+ /** A {@link Consumer} suitable for {@code ProcessRunner.run(..., lineSink)}. */
+ public Consumer<String> lineSink() {
+ return this::append;
+ }
+
+ /** Current byte size of the log file (used for {@link StepState#logOffset}). */
+ public long size() {
+ try {
+ return Files.isRegularFile(file) ? Files.size(file) : 0L;
+ } catch (IOException e) {
+ return 0L;
+ }
+ }
+
+ public Path file() {
+ return file;
+ }
+
+ public LogBroadcaster broadcaster() {
+ return broadcaster;
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/log/SseLogServlet.java b/src/main/java/org/apache/juneau/releng/log/SseLogServlet.java
new file mode 100644
index 0000000000..49ece78dec
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/log/SseLogServlet.java
@@ -0,0 +1,149 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.log;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Optional;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.TimeUnit;
+import java.util.function.BiFunction;
+import jakarta.servlet.http.HttpServlet;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+
+/**
+ * Streams one step's current-RC log as {@code text/event-stream}: replays that step's on-disk log on
+ * connect, then tails that step's {@link LogBroadcaster} live. One stream per step, matching the UI's
+ * one-console-at-a-time rule. Registered via
+ * {@link org.springframework.boot.web.servlet.ServletRegistrationBean} alongside {@code RootRest} —
+ * deliberately NOT a Juneau {@code @Rest} resource (no serializer in the way).
+ *
+ * <p>Mapped at {@code /events/*}; the two trailing path segments are {@code {version}/{stepId}}.
+ */
+public class SseLogServlet extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+ private static final long HEARTBEAT_MS = 25_000;
+
+ /** SSE comment frame sent when no log line arrives within the heartbeat interval (keeps the connection alive). */
+ public static final String HEARTBEAT = ": heartbeat\n\n";
+
+ /** (version, stepId) -> that step's current-RC log Path (from RunStateStore's StepState.logRef). */
+ private final transient BiFunction<String, String, Optional<Path>> logPathForStep;
+ /** (version, stepId) -> that step's LogBroadcaster. */
+ private final transient BiFunction<String, String, Optional<LogBroadcaster>> broadcasterForStep;
+
+ public SseLogServlet(BiFunction<String, String, Optional<Path>> logPathForStep,
+ BiFunction<String, String, Optional<LogBroadcaster>> broadcasterForStep) {
+ this.logPathForStep = logPathForStep;
+ this.broadcasterForStep = broadcasterForStep;
+ }
+
+ /** SSE frame for a (possibly multi-line) payload: each physical line gets its own {@code data:} prefix. */
+ public static String sse(String payload) {
+ var sb = new StringBuilder();
+ for (var line : payload.split("\n", -1))
+ sb.append("data: ").append(line).append('\n');
+ // The split adds a trailing empty element for a payload ending in \n; normalize to one blank-line terminator.
+ return sb.toString().stripTrailing() + "\n\n";
+ }
+
+ @Override
+ @SuppressWarnings({ "resource" // The servlet container owns the response writer's lifecycle; closing it here would break SSE streaming/tailing.
+ })
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp) {
+ var seg = trailingTwoSegments(req.getPathInfo());
+ var version = seg[0];
+ var stepId = seg[1];
+ resp.setContentType("text/event-stream");
+ resp.setCharacterEncoding("UTF-8");
+ resp.setHeader("Cache-Control", "no-cache");
+ resp.setHeader("Connection", "keep-alive");
+
+ try {
+ var out = resp.getWriter();
+
+ // 1) Replay this step's on-disk log (handles reload, step reselection, restart, and post-vote
+ // reconnect). Each step's log is dedicated to that step alone, so replay is always
+ // small/bounded, never a whole-RC file.
+ var logPath = logPathForStep.apply(version, stepId).orElse(null);
+ if (logPath != null && Files.isRegularFile(logPath)) {
+ for (var line : Files.readAllLines(logPath))
+ out.print(sse(line));
+ out.flush();
+ }
+
+ // 2) Tail live via that step's broadcaster.
+ var bc = broadcasterForStep.apply(version, stepId).orElse(null);
+ if (bc == null) {
+ out.print(sse("(no active run/step for " + version + "/" + stepId + ")"));
+ out.flush();
+ return;
+ }
+ tail(bc, out);
+ } catch (IOException e) {
+ // SSE is one-way and best-effort: a broken pipe (client navigated away) or an unreadable log
+ // file just ends the stream. There's nothing to retry, so close quietly instead of letting the
+ // exception escape doGet as a 500.
+ if (!resp.isCommitted())
+ resp.setStatus(HttpServletResponse.SC_NO_CONTENT);
+ }
+ }
+
+ /** Tails {@code bc} to {@code out}, emitting a heartbeat when idle, until the client disconnects. */
+ private void tail(LogBroadcaster bc, PrintWriter out) {
+ var queue = new LinkedBlockingQueue<String>();
+ var subscription = bc.subscribe(queue::offer);
+ try {
+ var running = true;
+ while (running) {
+ String line = null;
+ try {
+ line = queue.poll(HEARTBEAT_MS, TimeUnit.MILLISECONDS);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ running = false;
+ }
+ if (running) {
+ out.print(line == null ? HEARTBEAT : sse(line));
+ out.flush();
+ running = !out.checkError(); // client disconnected
+ }
+ }
+ } finally {
+ // AutoCloseable.close() declares `throws Exception`; this subscription's impl never actually
+ // throws, so swallow defensively rather than widen the method's checked-exception signature.
+ try {
+ subscription.close();
+ } catch (Exception ignored) {
+ /* best-effort unsubscribe */ }
+ }
+ }
+
+ /** Splits {@code /{version}/{stepId}} into {@code [version, stepId]}; either may be empty if absent. */
+ private static String[] trailingTwoSegments(String pathInfo) {
+ if (pathInfo == null || pathInfo.isBlank())
+ return new String[] { "", "" };
+ var p = pathInfo.startsWith("/") ? pathInfo.substring(1) : pathInfo;
+ var parts = p.split("/", 2);
+ return parts.length == 2 ? parts : new String[] { parts[0], "" };
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/log/VoteDeadlineTimer.java b/src/main/java/org/apache/juneau/releng/log/VoteDeadlineTimer.java
new file mode 100644
index 0000000000..7cfdfbfa96
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/log/VoteDeadlineTimer.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.log;
+
+import java.time.Duration;
+import java.time.Instant;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import org.apache.juneau.releng.util.ProcessRunner;
+
+/** Fires an optional Slack ping at a run's vote deadline. Re-armed from persisted deadline on boot. */
+public class VoteDeadlineTimer {
+
+ private final ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(r -> {
+ var t = new Thread(r, "vote-deadline-timer");
+ t.setDaemon(true);
+ return t;
+ });
+ private final ProcessRunner runner;
+ private final String slackWebhook;
+
+ public VoteDeadlineTimer(ProcessRunner runner, String slackWebhook) {
+ this.runner = runner;
+ this.slackWebhook = slackWebhook;
+ }
+
+ /** Arm (or re-arm) a ping for the given version at {@code deadline}. No-op if webhook empty or deadline past. */
+ public void arm(String version, Instant deadline) {
+ if (slackWebhook == null || slackWebhook.isBlank())
+ return;
+ var delay = Duration.between(Instant.now(), deadline).toMillis();
+ if (delay <= 0)
+ return;
+ scheduler.schedule(() -> ping(version), delay, TimeUnit.MILLISECONDS);
+ }
+
+ private void ping(String version) {
+ var payload = "{\"text\":\"Juneau " + version + " vote window has closed — tally the result.\"}";
+ runner.run(List.of("curl", "-sf", "-X", "POST", "-H", "Content-Type: application/json", "-d", payload,
+ slackWebhook), null, Map.of());
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/milestone/ChangelogEntry.java b/src/main/java/org/apache/juneau/releng/milestone/ChangelogEntry.java
new file mode 100644
index 0000000000..e8638daa61
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/milestone/ChangelogEntry.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.milestone;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/** One grouped "** Changes" line (a dependency bump aggregated across PRs). */
+public class ChangelogEntry {
+ public final String dependency; // "spring.version" (may include " in /juneau-docs")
+ public final String fromVersion;
+ public final String toVersion;
+ public final List<Integer> prNumbers;
+
+ public ChangelogEntry(String dependency, String fromVersion, String toVersion, List<Integer> prNumbers) {
+ this.dependency = dependency;
+ this.fromVersion = fromVersion;
+ this.toVersion = toVersion;
+ this.prNumbers = prNumbers;
+ }
+
+ /** Renders e.g. " * Bump spring.version from 4.0.1 to 4.0.6 #308, #316." */
+ public String toLine() {
+ var refs = new StringBuilder();
+ for (var i = 0; i < prNumbers.size(); i++) {
+ if (i > 0)
+ refs.append(", ");
+ refs.append('#').append(prNumbers.get(i));
+ }
+ return " * Bump " + dependency + " from " + fromVersion + " to " + toVersion + " " + refs + ".";
+ }
+
+ /** Accumulates PRs for one dependency; from = oldest, to = newest (by PR order). */
+ public static final class Builder {
+ private final String dependency;
+ private String fromVersion;
+ private String toVersion;
+ private final List<Integer> prNumbers = new ArrayList<>();
+
+ public Builder(String dependency) {
+ this.dependency = dependency;
+ }
+
+ public void add(String from, String to, int prNumber) {
+ if (fromVersion == null)
+ fromVersion = from; // first (lowest PR#) sets the floor
+ toVersion = to; // last (highest PR#) sets the ceiling
+ prNumbers.add(prNumber);
+ }
+
+ public ChangelogEntry build() {
+ return new ChangelogEntry(dependency, fromVersion, toVersion, List.copyOf(prNumbers));
+ }
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/milestone/GithubPrSource.java b/src/main/java/org/apache/juneau/releng/milestone/GithubPrSource.java
new file mode 100644
index 0000000000..49a9d90e09
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/milestone/GithubPrSource.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.milestone;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import org.apache.juneau.marshall.marshaller.Json;
+import org.apache.juneau.releng.util.ProcessRunner;
+
+/** Fetches merged PRs attached to a milestone via {@code gh pr list}. */
+public class GithubPrSource {
+
+ private final ProcessRunner runner;
+ private final String repoSlug;
+
+ public GithubPrSource(ProcessRunner runner, String repoSlug) {
+ this.runner = runner;
+ this.repoSlug = repoSlug;
+ }
+
+ @SuppressWarnings({ "unchecked" // Parsed JSON is assigned/cast to its known generic shape.
+ })
+ public List<PullRequest> forMilestone(String milestoneTitle) {
+ var json = runner.runText(List.of("gh", "pr", "list", "--repo", repoSlug, "--state", "merged", "--search",
+ "milestone:\"" + milestoneTitle + "\"", "--json", "number,title,author", "--limit", "500"));
+ if (json.isBlank())
+ return List.of();
+ List<Map<String, Object>> parsed = Json.DEFAULT.read(json, List.class);
+ var out = new ArrayList<PullRequest>();
+ for (var m : parsed) {
+ var pr = new PullRequest();
+ pr.number = ((Number) m.getOrDefault("number", 0)).intValue();
+ pr.title = String.valueOf(m.getOrDefault("title", ""));
+ var author = (Map<String, Object>) m.get("author");
+ pr.authorLogin = author == null ? "" : String.valueOf(author.getOrDefault("login", ""));
+ out.add(pr);
+ }
+ return out;
+ }
+
+ /**
+ * Resolves the GitHub milestone number whose title exactly matches {@code versionTitle} (e.g. "10.0.0"),
+ * via {@code gh api repos/<slug>/milestones?state=all}. Returns null if none matches (§8.1) — the
+ * New-Release form field is then left blank for the human to fill in manually.
+ */
+ @SuppressWarnings({ "unchecked" // Parsed JSON is assigned/cast to its known generic shape.
+ })
+ public Integer resolveMilestoneNumber(String versionTitle) {
+ var json = runner.runText(List.of("gh", "api", "repos/" + repoSlug + "/milestones?state=all"));
+ if (json.isBlank())
+ return null;
+ List<Map<String, Object>> parsed = Json.DEFAULT.read(json, List.class);
+ for (var m : parsed)
+ if (versionTitle.equals(String.valueOf(m.getOrDefault("title", ""))))
+ return ((Number) m.get("number")).intValue();
+ return null;
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/milestone/MilestoneService.java b/src/main/java/org/apache/juneau/releng/milestone/MilestoneService.java
new file mode 100644
index 0000000000..dbb11a5435
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/milestone/MilestoneService.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.milestone;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.regex.Pattern;
+import org.apache.juneau.releng.release.ReleaseVersion;
+
+/** Milestone helpers: previous-tag selection and "** Changes" changelog generation. */
+public class MilestoneService {
+
+ // "Bump <dep> from <old> to <new>" with optional trailing " in <path>".
+ private static final Pattern BUMP = Pattern
+ .compile("^Bump (?<dep>.+?) from (?<from>\\S+) to (?<to>\\S+?)(?: in (?<path>\\S+))?$");
+
+ /** The release tag immediately preceding {@code version} (prereleases excluded). */
+ public String previousTag(List<String> tags, String version) {
+ var prev = ReleaseVersion.highestReleasedBelow(tags, version);
+ return prev == null ? null : "juneau-" + prev.version();
+ }
+
+ /** Groups Dependabot bump PRs into one {@link ChangelogEntry} per dependency, sorted by dependency. */
+ public List<ChangelogEntry> generateChanges(List<PullRequest> prs) {
+ // Preserve encounter order within a group, but iterate PRs by ascending number for stable from/to + refs.
+ var sorted = new ArrayList<>(prs);
+ sorted.sort((a, b) -> Integer.compare(a.number, b.number));
+
+ var groups = new LinkedHashMap<String, ChangelogEntry.Builder>();
+ for (var pr : sorted) {
+ var m = BUMP.matcher(pr.title == null ? "" : pr.title.strip());
+ if (!m.matches())
+ continue; // non-bump / human PR -> excluded from ** Changes
+ var dep = m.group("dep");
+ var path = m.group("path");
+ var key = path == null ? dep : dep + " in " + path;
+ groups.computeIfAbsent(key, ChangelogEntry.Builder::new).add(m.group("from"), m.group("to"), pr.number);
+ }
+
+ var out = new ArrayList<ChangelogEntry>();
+ for (var b : groups.values())
+ out.add(b.build());
+ out.sort((a, b) -> a.dependency.compareToIgnoreCase(b.dependency));
+ return out;
+ }
+
+ /** Renders the full "** Changes" section text. */
+ public String renderChangesSection(List<PullRequest> prs) {
+ var sb = new StringBuilder("** Changes\n\n");
+ for (var e : generateChanges(prs))
+ sb.append(e.toLine()).append('\n');
+ return sb.toString();
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/milestone/PullRequest.java b/src/main/java/org/apache/juneau/releng/milestone/PullRequest.java
new file mode 100644
index 0000000000..2be79d56bf
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/milestone/PullRequest.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.milestone;
+
+/** Minimal merged-PR record used for changelog generation. */
+public class PullRequest {
+ public int number;
+ public String title;
+ public String authorLogin;
+
+ public PullRequest() {
+ }
+
+ public PullRequest(int number, String title, String authorLogin) {
+ this.number = number;
+ this.title = title;
+ this.authorLogin = authorLogin;
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/nexus/MavenSettingsCredentials.java b/src/main/java/org/apache/juneau/releng/nexus/MavenSettingsCredentials.java
new file mode 100644
index 0000000000..2cbb0fcdf0
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/nexus/MavenSettingsCredentials.java
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.nexus;
+
+import static org.apache.juneau.commons.utils.Shorts.*;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+/**
+ * Resolves {@code {username, password}} for a named {@code <server>} id out of {@code ~/.m2/settings.xml}.
+ * A minimal standalone XML parse rather than pulling in the full Maven settings-builder dependency. Does
+ * not attempt {@code settings-security.xml} master-password decryption; an encrypted password (wrapped in
+ * {@code {...}}) is surfaced as a clear failure rather than silently mis-resolved.
+ */
+public final class MavenSettingsCredentials {
+
+ /** Resolved credentials for a {@code <server>} entry. */
+ public record Credentials(String username, String password) {
+ }
+
+ private MavenSettingsCredentials() {
+ }
+
+ /** Resolve from the default {@code ~/.m2/settings.xml}. */
+ public static Credentials resolve(String serverId) {
+ return resolve(serverId, Path.of(System.getProperty("user.home"), ".m2", "settings.xml"));
+ }
+
+ /** Resolve from an explicit settings.xml path (test seam). */
+ public static Credentials resolve(String serverId, Path settingsXml) {
+ if (!Files.isRegularFile(settingsXml))
+ throw isex("Maven settings file not found: %s", settingsXml);
+ try {
+ var factory = DocumentBuilderFactory.newInstance();
+ factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
+ var doc = factory.newDocumentBuilder().parse(settingsXml.toFile());
+ var servers = doc.getElementsByTagName("server");
+ for (int i = 0; i < servers.getLength(); i++) {
+ var server = (Element) servers.item(i);
+ if (!serverId.equals(childText(server, "id")))
+ continue;
+ var username = childText(server, "username");
+ var password = childText(server, "password");
+ if (password != null && password.startsWith("{") && password.endsWith("}"))
+ throw isex("Encrypted <password> for server '%s' is not supported; "
+ + "decrypt via settings-security.xml master password is not implemented", serverId);
+ if (username == null || password == null)
+ throw isex("Server '%s' is missing username/password in %s", serverId, settingsXml);
+ return new Credentials(username, password);
+ }
+ throw isex("No <server id=\"%s\"> entry found in %s", serverId, settingsXml);
+ } catch (IOException | ParserConfigurationException | SAXException e) {
+ throw isex(e, "Cannot parse Maven settings file: %s", settingsXml);
+ }
+ }
+
+ private static String childText(Element parent, String tag) {
+ NodeList nodes = parent.getElementsByTagName(tag);
+ if (nodes.getLength() == 0)
+ return null;
+ var text = nodes.item(0).getTextContent();
+ return text == null ? null : text.trim();
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/nexus/NexusMockModel.java b/src/main/java/org/apache/juneau/releng/nexus/NexusMockModel.java
new file mode 100644
index 0000000000..a016a0a61c
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/nexus/NexusMockModel.java
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.nexus;
+
+import static org.apache.juneau.commons.utils.Shorts.*;
+
+import java.util.List;
+import java.util.Map;
+import org.apache.juneau.marshall.marshaller.Json;
+
+/**
+ * A stateful, in-memory model of the parts of the Nexus 2 staging lifecycle the real {@link NexusStagingClient}
+ * exercises: profile-scoped repo discovery, single-repo detail, and the {@code bulk/close}, {@code bulk/promote}
+ * and {@code bulk/drop} transitions ({@code OPEN → CLOSED → RELEASED}, with {@code DROPPED} reachable from OPEN
+ * or CLOSED).
+ *
+ * <p>Because a SAFE {@code release-perform} is command-logged rather than executed, no real staging repo is
+ * ever created; this model therefore <b>lazily synthesizes</b> the OPEN {@code orgapachejuneau-NNNN} repo that
+ * {@code release-perform} would have created, on the first discovery call. After a repo reaches a terminal
+ * state a fresh OPEN repo is synthesized on the next discovery so a later run starts clean.
+ *
+ * <p>Only the fields the client parses are faked ({@code repositoryId}, {@code profileId}, state, and the
+ * {@code transitioning} flag), plus a Nexus-shaped error envelope for illegal transitions.
+ */
+public class NexusMockModel {
+
+ static final String OPEN = "open";
+ static final String CLOSED = "closed";
+ static final String RELEASED = "released";
+ static final String DROPPED = "dropped";
+
+ private final String profileId;
+ private int counter = 1041;
+ private String repoId;
+ private String state;
+
+ public NexusMockModel(String profileId) {
+ this.profileId = profileId;
+ }
+
+ /** Clears state so the next discovery synthesizes a fresh OPEN repo (called on run-start). */
+ public synchronized void reset() {
+ repoId = null;
+ state = null;
+ }
+
+ public synchronized String currentRepoId() {
+ return repoId;
+ }
+
+ public synchronized String currentState() {
+ return state;
+ }
+
+ private void seedIfNeeded() {
+ if (repoId == null || RELEASED.equals(state) || DROPPED.equals(state)) {
+ counter++;
+ repoId = "orgapachejuneau-" + counter;
+ state = OPEN;
+ }
+ }
+
+ /** {@code GET /profile_repositories/{profileId}} — the discovery list (lazily seeded). */
+ public synchronized String profileRepositories() {
+ seedIfNeeded();
+ return Json.DEFAULT.write(List.of(repoView()));
+ }
+
+ /** {@code GET /repository/{repoId}} — single-repo detail. */
+ public synchronized String repository(String id) {
+ if (repoId == null || !repoId.equals(id))
+ throw isex("No such staging repository: %s", id);
+ return Json.DEFAULT.write(repoView());
+ }
+
+ public synchronized void close(String id) {
+ requireRepo(id);
+ if (!OPEN.equals(state))
+ throw illegal("close", id);
+ state = CLOSED;
+ }
+
+ public synchronized void promote(String id) {
+ requireRepo(id);
+ if (!CLOSED.equals(state))
+ throw illegal("promote", id);
+ state = RELEASED;
+ }
+
+ public synchronized void drop(String id) {
+ requireRepo(id);
+ if (!OPEN.equals(state) && !CLOSED.equals(state))
+ throw illegal("drop", id);
+ state = DROPPED;
+ }
+
+ /** Extracts the single staged repository id from a Nexus {@code bulk/*} request body. */
+ @SuppressWarnings({ "unchecked" // Parsed JSON is assigned to its known generic shape.
+ })
+ static String repoIdFromBody(String body) {
+ if (body == null || body.isBlank())
+ return null;
+ Map<String, Object> parsed = Json.DEFAULT.read(body, Map.class);
+ var data = (Map<String, Object>) parsed.get("data");
+ if (data == null)
+ return null;
+ var ids = (List<Object>) data.get("stagedRepositoryIds");
+ return (ids == null || ids.isEmpty()) ? null : String.valueOf(ids.get(0));
+ }
+
+ private void requireRepo(String id) {
+ if (repoId == null || !repoId.equals(id))
+ throw isex("No such staging repository: %s", id);
+ }
+
+ private RuntimeException illegal(String op, String id) {
+ return isex("illegalTransition: cannot %s repository %s in state %s", op, id, state);
+ }
+
+ private Map<String, Object> repoView() {
+ return Map.of("repositoryId", repoId, "profileId", profileId, "type", state, "state", state, "transitioning",
+ Boolean.FALSE, "created", "2026-08-16T12:00:00.000Z", "description", "juneau-release-manager");
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/nexus/NexusMockRest.java b/src/main/java/org/apache/juneau/releng/nexus/NexusMockRest.java
new file mode 100644
index 0000000000..0efdd65cab
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/nexus/NexusMockRest.java
@@ -0,0 +1,119 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.nexus;
+
+import static org.apache.juneau.commons.utils.Shorts.*;
+
+import java.util.function.Supplier;
+import org.apache.juneau.http.Content;
+import org.apache.juneau.http.Path;
+import org.apache.juneau.http.response.BadRequest;
+import org.apache.juneau.rest.server.Rest;
+import org.apache.juneau.rest.server.RestGet;
+import org.apache.juneau.rest.server.RestPost;
+import org.apache.juneau.rest.server.servlet.BasicRestServlet;
+
+/**
+ * A SAFE-only in-app loopback mock of the Apache Nexus 2 staging suite, mounted at {@code /mock/nexus/*}. It
+ * lets the real {@link NexusStagingClient} run its full discovery/close/promote/drop HTTP flow against a
+ * stateful in-memory model ({@link NexusMockModel}) with zero canonical side effects. Registered only when
+ * {@code rm.mode=safe} so it can never serve a LIVE run.
+ *
+ * <p>All request routing is centralized in {@link #route} so the same mapping backs both this servlet and the
+ * in-process transport tests exercise.
+ *
+ * @serial exclude
+ */
+@Rest(path = "/mock/nexus/*", title = "Nexus staging loopback mock (SAFE only)")
+public class NexusMockRest extends BasicRestServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ private final transient NexusMockModel model;
+
+ public NexusMockRest(String profileId) {
+ this.model = new NexusMockModel(profileId);
+ }
+
+ /** The backing model, for run-start reset wiring and tests. */
+ public NexusMockModel model() {
+ return model;
+ }
+
+ @RestGet(path = "/service/local/staging/profile_repositories/{profileId}", produces = "application/json")
+ public String profileRepositories(@Path("profileId") String profileId) {
+ return guarded(() -> route(model, "GET", "/service/local/staging/profile_repositories/" + profileId, null));
+ }
+
+ @RestGet(path = "/service/local/staging/repository/{repoId}", produces = "application/json")
+ public String repository(@Path("repoId") String repoId) {
+ return guarded(() -> route(model, "GET", "/service/local/staging/repository/" + repoId, null));
+ }
+
+ @RestPost(path = "/service/local/staging/bulk/close", produces = "application/json")
+ public String close(@Content String body) {
+ return guarded(() -> route(model, "POST", "/service/local/staging/bulk/close", body));
+ }
+
+ @RestPost(path = "/service/local/staging/bulk/promote", produces = "application/json")
+ public String promote(@Content String body) {
+ return guarded(() -> route(model, "POST", "/service/local/staging/bulk/promote", body));
+ }
+
+ @RestPost(path = "/service/local/staging/bulk/drop", produces = "application/json")
+ public String drop(@Content String body) {
+ return guarded(() -> route(model, "POST", "/service/local/staging/bulk/drop", body));
+ }
+
+ /**
+ * The single request-routing table, shared by the servlet endpoints and the transport-level tests. Model
+ * transition failures surface as a runtime exception (mapped to a Nexus-shaped 400 by {@link #guarded}).
+ */
+ public static String route(NexusMockModel model, String method, String path, String body) {
+ if ("GET".equals(method) && path.contains("/profile_repositories/"))
+ return model.profileRepositories();
+ if ("GET".equals(method) && path.contains("/repository/"))
+ return model.repository(lastSegment(path));
+ if ("POST".equals(method) && path.endsWith("/bulk/close")) {
+ model.close(NexusMockModel.repoIdFromBody(body));
+ return "";
+ }
+ if ("POST".equals(method) && path.endsWith("/bulk/promote")) {
+ model.promote(NexusMockModel.repoIdFromBody(body));
+ return "";
+ }
+ if ("POST".equals(method) && path.endsWith("/bulk/drop")) {
+ model.drop(NexusMockModel.repoIdFromBody(body));
+ return "";
+ }
+ throw isex("Unmapped Nexus mock request: %s %s", method, path);
+ }
+
+ private static String lastSegment(String path) {
+ var i = path.lastIndexOf('/');
+ return i < 0 ? path : path.substring(i + 1);
+ }
+
+ private String guarded(Supplier<String> op) {
+ try {
+ return op.get();
+ } catch (RuntimeException e) {
+ throw new BadRequest("{\"errors\":[{\"id\":\"*\",\"msg\":\"" + e.getMessage() + "\"}]}");
+ }
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/nexus/NexusStagingClient.java b/src/main/java/org/apache/juneau/releng/nexus/NexusStagingClient.java
new file mode 100644
index 0000000000..ad65183f04
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/nexus/NexusStagingClient.java
@@ -0,0 +1,176 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.nexus;
+
+import static org.apache.juneau.commons.utils.Shorts.*;
+
+import java.net.URI;
+import java.net.http.HttpClient;
+import java.net.http.HttpRequest;
+import java.net.http.HttpResponse;
+import java.nio.charset.StandardCharsets;
+import java.util.Base64;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import org.apache.juneau.marshall.marshaller.Json;
+
+/**
+ * In-process HTTPS client for the Apache Nexus staging suite. No CLI, no argv exposure — Basic auth built
+ * in-process, normally from the committer's Keychain-backed Apache LDAP credentials (see
+ * {@link #create(String, String)}), falling back to {@code ~/.m2/settings.xml}'s {@code apache.releases.https}
+ * server entry (see {@link #create(String)}) only when that Keychain entry is absent.
+ */
+public class NexusStagingClient {
+
+ /** Test seam: (method, path, jsonBody) -> jsonResponse. */
+ public interface Transport {
+ String send(String method, String path, String body);
+ }
+
+ /** The default {@code org.apache.juneau} staging profile id. */
+ public static final String JUNEAU_PROFILE_ID = "1a24bc7f954a70";
+
+ private final Transport transport;
+ private final String profileId;
+
+ private NexusStagingClient(Transport transport, String profileId) {
+ this.transport = transport;
+ this.profileId = profileId;
+ }
+
+ /**
+ * Production factory: real HTTPS with Basic auth against {@code baseUrl}, credentials supplied directly —
+ * normally the committer's Apache LDAP availid + password, resolved through the
+ * {@link org.apache.juneau.commons.secret.SecretStore} SPI (see
+ * {@code AppConfiguration.secretResolver()}'s {@code nexus()}), not hardcoded to any particular backend
+ * here. Under SAFE mode {@code baseUrl} is the in-app loopback mock and the credential is a placeholder.
+ */
+ public static NexusStagingClient create(String baseUrl, String profileId, String username, String password) {
+ var http = HttpClient.newHttpClient();
+ var basic = "Basic "
+ + Base64.getEncoder().encodeToString((username + ":" + password).getBytes(StandardCharsets.UTF_8));
+ return new NexusStagingClient(transport(http, basic, baseUrl), profileId);
+ }
+
+ /**
+ * Fallback factory: credentials resolved from the named {@code ~/.m2/settings.xml} {@code <server>}
+ * entry ({@code serverId="apache.releases.https"}). Used only when the Keychain-backed
+ * {@link #create(String, String, String, String)} path has no stored Apache LDAP credential yet — see
+ * {@code AppConfiguration.secretResolver()}. Resolution mirrors how {@code mvn deploy}/the release
+ * plugin itself reads that same entry (a minimal local settings.xml parse, rather than pulling in the
+ * full Maven settings-builder dependency). Does not handle settings-security.xml-encrypted passwords
+ * (see {@link MavenSettingsCredentials}).
+ */
+ public static NexusStagingClient create(String baseUrl, String profileId, String serverId) {
+ var creds = MavenSettingsCredentials.resolve(serverId); // {username, password} from the <server> entry
+ return create(baseUrl, profileId, creds.username(), creds.password());
+ }
+
+ private static Transport transport(HttpClient http, String basic, String baseUrl) {
+ return (method, path, body) -> {
+ try {
+ var b = HttpRequest.newBuilder(URI.create(baseUrl + path)).header("Authorization", basic)
+ .header("Accept", "application/json").header("Content-Type", "application/json");
+ var req = (body == null) ? b.method(method, HttpRequest.BodyPublishers.noBody()).build()
+ : b.method(method, HttpRequest.BodyPublishers.ofString(body)).build();
+ var resp = http.send(req, HttpResponse.BodyHandlers.ofString());
+ if (resp.statusCode() / 100 != 2)
+ throw isex("Nexus %s %s -> %s: %s", method, path, resp.statusCode(), resp.body());
+ return resp.body();
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw isex(e, "Nexus call failed: %s %s", method, path);
+ } catch (Exception e) {
+ throw isex(e, "Nexus call failed: %s %s", method, path);
+ }
+ };
+ }
+
+ /** Test factory (default juneau profile id). */
+ public static NexusStagingClient forTests(Transport transport) {
+ return new NexusStagingClient(transport, JUNEAU_PROFILE_ID);
+ }
+
+ /** Test factory pinned to a specific profile id. */
+ public static NexusStagingClient forTests(Transport transport, String profileId) {
+ return new NexusStagingClient(transport, profileId);
+ }
+
+ /**
+ * Discover the most-recently-created staging repo for the juneau profile. Uses the profile-scoped
+ * endpoint ({@code /profile_repositories/{profileId}}) rather than the unscoped global list, since the
+ * account otherwise sees every ASF project's staging repos.
+ */
+ @SuppressWarnings({ "unchecked" // Parsed JSON is assigned to its known generic shape (unchecked conversion from the raw parse result).
+ })
+ public Optional<StagingRepo> findLatestRepo() {
+ var json = transport.send("GET", "/service/local/staging/profile_repositories/" + profileId, null);
+ if (json == null || json.isBlank())
+ return Optional.empty();
+ List<Map<String, Object>> parsed = Json.DEFAULT.read(json, List.class);
+ return parsed.stream().map(m -> {
+ var r = new StagingRepo();
+ r.id = str(m.get("repositoryId"));
+ r.profileId = profileId;
+ // The raw status field may be named "type" or "state" depending on the endpoint; fall back
+ // to "state" when "type" is absent.
+ r.status = str(m.getOrDefault("type", m.get("state")));
+ r.transitioning = Boolean.TRUE.equals(m.get("transitioning"));
+ r.created = str(m.get("created"));
+ r.description = str(m.get("description"));
+ return r;
+ }).sorted(Comparator.comparing((StagingRepo r) -> r.created == null ? "" : r.created).reversed()).findFirst();
+ }
+
+ /** Single-repo detail read (state model OPEN/CLOSED/RELEASED + transitioning flag). */
+ @SuppressWarnings({ "unchecked" // Parsed JSON is assigned to its known generic shape (unchecked conversion from the raw parse result).
+ })
+ public StagingRepo getRepo(String repoId) {
+ var json = transport.send("GET", "/service/local/staging/repository/" + repoId, null);
+ Map<String, Object> m = Json.DEFAULT.read(json, Map.class);
+ var r = new StagingRepo();
+ r.id = str(m.get("repositoryId"));
+ r.profileId = str(m.get("profileId"));
+ r.status = str(m.getOrDefault("type", m.get("state")));
+ r.transitioning = Boolean.TRUE.equals(m.get("transitioning"));
+ return r;
+ }
+
+ // Close and promote/release are separate, deliberate calls — no auto-release-on-close.
+ public void close(String repoId) {
+ transport.send("POST", "/service/local/staging/bulk/close", body(repoId));
+ }
+
+ public void drop(String repoId) {
+ transport.send("POST", "/service/local/staging/bulk/drop", body(repoId));
+ }
+
+ public void promote(String repoId) {
+ transport.send("POST", "/service/local/staging/bulk/promote", body(repoId));
+ }
+
+ private static String body(String repoId) {
+ return "{\"data\":{\"stagedRepositoryIds\":[\"" + repoId + "\"],\"description\":\"juneau-release-manager\"}}";
+ }
+
+ private static String str(Object o) {
+ return o == null ? null : String.valueOf(o);
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/nexus/StagingRepo.java b/src/main/java/org/apache/juneau/releng/nexus/StagingRepo.java
new file mode 100644
index 0000000000..2457388a57
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/nexus/StagingRepo.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.nexus;
+
+/**
+ * A Nexus staging repository (subset of fields). Profile id for {@code org.apache.juneau}:
+ * {@code 1a24bc7f954a70}. {@code status} is normalized to lowercase open/closed/released regardless of
+ * whether the raw JSON field is named {@code type} or {@code state}.
+ */
+public class StagingRepo {
+ public String id; // repositoryId, e.g. "orgapachejuneau-1042"
+ public String profileId;
+ public String description;
+ public String status; // normalized: "open" | "closed" | "released"
+ public boolean transitioning; // true while Nexus is still processing a close/promote/drop call
+ public String created;
+
+ public StagingRepo() {
+ }
+
+ public StagingRepo(String id, String status) {
+ this.id = id;
+ this.status = status;
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/release/GitTagReleaseSource.java b/src/main/java/org/apache/juneau/releng/release/GitTagReleaseSource.java
new file mode 100644
index 0000000000..eec3c7e5dc
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/release/GitTagReleaseSource.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.release;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+import org.apache.juneau.releng.util.ProcessRunner;
+
+/** Produces historical RELEASED rows from {@code git tag juneau-*} (prereleases excluded). */
+public class GitTagReleaseSource {
+
+ private final ProcessRunner runner;
+ private final String repoDir;
+
+ public GitTagReleaseSource(ProcessRunner runner, String repoDir) {
+ this.runner = runner;
+ this.repoDir = repoDir;
+ }
+
+ public List<Release> list() {
+ var tags = runner.runLines(List.of("git", "-C", repoDir, "tag", "--list", "juneau-*"));
+ var out = new ArrayList<Release>();
+ for (var tag : tags) {
+ var v = ReleaseVersion.ofTag(tag);
+ if (v.isPrerelease())
+ continue;
+ var r = new Release(v.version(), "RELEASED", "tag");
+ r.stage = "Distributed";
+ out.add(r);
+ }
+ out.sort(Comparator.comparing((Release r) -> ReleaseVersion.of(r.version)).reversed());
+ return out;
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/release/GithubReleaseSource.java b/src/main/java/org/apache/juneau/releng/release/GithubReleaseSource.java
new file mode 100644
index 0000000000..cb9dd05c61
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/release/GithubReleaseSource.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.release;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import org.apache.juneau.marshall.marshaller.Json;
+import org.apache.juneau.releng.util.ProcessRunner;
+
+/** Produces rows from GitHub Releases via {@code gh release list --repo <slug>}. */
+public class GithubReleaseSource {
+
+ private final ProcessRunner runner;
+ private final String repoSlug;
+
+ public GithubReleaseSource(ProcessRunner runner, String repoSlug) {
+ this.runner = runner;
+ this.repoSlug = repoSlug;
+ }
+
+ @SuppressWarnings({ "unchecked" // Parsed JSON is cast to its known generic shape.
+ })
+ public List<Release> list() {
+ var json = runner.runText(List.of("gh", "api", "repos/" + repoSlug + "/releases", "--paginate"));
+ if (json.isBlank())
+ return List.of();
+ List<Map<String, Object>> parsed = Json.DEFAULT.read(json, List.class);
+ var out = new ArrayList<Release>();
+ for (var m : parsed) {
+ var tag = String.valueOf(m.getOrDefault("tag_name", ""));
+ var v = ReleaseVersion.ofTag(tag);
+ var draft = Boolean.TRUE.equals(m.get("draft"));
+ var r = new Release(v.version(), draft ? "DRAFT" : "RELEASED", "github");
+ r.stage = "Distributed";
+ r.githubReleaseUrl = str(m.get("html_url"));
+ var published = str(m.get("published_at"));
+ r.released = published == null ? "—" : published.substring(0, Math.min(10, published.length()));
+ out.add(r);
+ }
+ return out;
+ }
+
+ private static String str(Object o) {
+ return o == null ? null : String.valueOf(o);
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/release/LocalStateReleaseSource.java b/src/main/java/org/apache/juneau/releng/release/LocalStateReleaseSource.java
new file mode 100644
index 0000000000..afde115eaa
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/release/LocalStateReleaseSource.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.release;
+
+import static org.apache.juneau.commons.utils.Shorts.*;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.juneau.marshall.marshaller.Json;
+
+/** Produces in-progress rows from JSON state files under the state dir. */
+public class LocalStateReleaseSource {
+
+ private final Path stateDir;
+
+ public LocalStateReleaseSource(Path stateDir) {
+ this.stateDir = stateDir;
+ }
+
+ public List<Release> list() {
+ var out = new ArrayList<Release>();
+ if (!Files.isDirectory(stateDir))
+ return out;
+ try (var files = Files.list(stateDir)) {
+ files.filter(p -> p.toString().endsWith(".json")).sorted().forEach(p -> {
+ try {
+ var r = Json.DEFAULT.read(Files.readString(p), Release.class);
+ if (r.source == null)
+ r.source = "state";
+ out.add(r);
+ } catch (IOException e) {
+ throw isex(e, "Unreadable state file: %s", p);
+ }
+ });
+ } catch (IOException e) {
+ throw isex(e, "Cannot list state dir: %s", stateDir);
+ }
+ return out;
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/release/Release.java b/src/main/java/org/apache/juneau/releng/release/Release.java
new file mode 100644
index 0000000000..e78e473c0d
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/release/Release.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.release;
+
+/** One row in the Releases tab. */
+public class Release {
+ public String version; // "9.2.1"
+ public String stage; // "Awaiting vote" | "Distributed" | "Cancelled"
+ public String rc; // "RC1" or "—"
+ public String status; // "VOTING" | "RELEASED" | "DROPPED" | "DRAFT"
+ public String voteCloses; // ISO datetime or "—"
+ public String released; // date or "—"
+ public String milestoneUrl; // may be null
+ public String githubReleaseUrl; // may be null
+ public String source; // "github" | "tag" | "state"
+
+ public Release() {
+ }
+
+ public Release(String version, String status, String source) {
+ this.version = version;
+ this.status = status;
+ this.source = source;
+ this.stage = "—";
+ this.rc = "—";
+ this.voteCloses = "—";
+ this.released = "—";
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/release/ReleaseListService.java b/src/main/java/org/apache/juneau/releng/release/ReleaseListService.java
new file mode 100644
index 0000000000..3a75480425
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/release/ReleaseListService.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.release;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.function.Supplier;
+
+/** Merges historical (git-tag), promoted (GitHub Releases), and in-progress (local state) rows. */
+public class ReleaseListService {
+
+ private final Supplier<List<Release>> tags;
+ private final Supplier<List<Release>> github;
+ private final Supplier<List<Release>> state;
+
+ public ReleaseListService(Supplier<List<Release>> tags, Supplier<List<Release>> github,
+ Supplier<List<Release>> state) {
+ this.tags = tags;
+ this.github = github;
+ this.state = state;
+ }
+
+ public List<Release> list() {
+ // 1. Released rows keyed by version; git tags first, then enriched by GitHub Releases.
+ var released = new LinkedHashMap<String, Release>();
+ for (var r : tags.get())
+ released.put(r.version, r);
+ for (var g : github.get()) {
+ var existing = released.get(g.version);
+ if (existing == null) {
+ released.put(g.version, g);
+ continue;
+ }
+ existing.githubReleaseUrl = g.githubReleaseUrl;
+ if (g.released != null && !"—".equals(g.released))
+ existing.released = g.released;
+ if (existing.milestoneUrl == null)
+ existing.milestoneUrl = g.milestoneUrl;
+ }
+
+ // 2. In-progress rows (local state) are kept as distinct rows (an RC/DROPPED attempt can
+ // coexist with a later RELEASED row of the same version — see the design mockup).
+ var out = new ArrayList<Release>(released.values());
+ out.addAll(state.get());
+
+ // 3. Sort: version desc; within a version, in-progress (non-RELEASED) rows first.
+ out.sort(Comparator.comparing((Release r) -> ReleaseVersion.of(r.version)).reversed()
+ .thenComparing(r -> "RELEASED".equals(r.status) ? 1 : 0));
+ return out;
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/release/ReleaseVersion.java b/src/main/java/org/apache/juneau/releng/release/ReleaseVersion.java
new file mode 100644
index 0000000000..efcfd0e0b9
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/release/ReleaseVersion.java
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.release;
+
+import java.util.List;
+
+/** Parsed, comparable Juneau release version derived from a git tag or version string. */
+public final class ReleaseVersion implements Comparable<ReleaseVersion> {
+
+ private final String version; // numeric core, e.g. "9.2.0" or "9.0"
+ private final String rc; // "RC3" or null
+ private final boolean prerelease; // RC or B (beta)
+ private final int[] parts; // numeric core split for comparison
+
+ private ReleaseVersion(String version, String rc, boolean prerelease, int[] parts) {
+ this.version = version;
+ this.rc = rc;
+ this.prerelease = prerelease;
+ this.parts = parts;
+ }
+
+ public static ReleaseVersion ofTag(String tag) {
+ var s = tag.startsWith("juneau-") ? tag.substring("juneau-".length()) : tag;
+ return of(s);
+ }
+
+ public static ReleaseVersion of(String s) {
+ String rc = null;
+ boolean pre = false;
+ var idxRc = s.indexOf("-RC");
+ if (idxRc >= 0) {
+ rc = s.substring(idxRc + 1);
+ pre = true;
+ s = s.substring(0, idxRc);
+ }
+ var idxB = s.indexOf("-B");
+ if (idxB >= 0) {
+ pre = true;
+ s = s.substring(0, idxB);
+ }
+ var core = s;
+ var split = core.split("\\.");
+ var parts = new int[split.length];
+ for (var i = 0; i < split.length; i++)
+ parts[i] = Integer.parseInt(split[i].replaceAll("\\D", ""));
+ return new ReleaseVersion(core, rc, pre, parts);
+ }
+
+ public String version() {
+ return version;
+ }
+
+ public String rc() {
+ return rc;
+ }
+
+ public boolean isPrerelease() {
+ return prerelease;
+ }
+
+ /** Numeric component {@code i} (0-based) of the version core, or 0 if absent. */
+ public int part(int i) {
+ return i < parts.length ? parts[i] : 0;
+ }
+
+ /** Major (x in x.y.z). */
+ public int major() {
+ return part(0);
+ }
+
+ /** Minor (y in x.y.z). */
+ public int minor() {
+ return part(1);
+ }
+
+ /** Maintenance (z in x.y.z); 0 for a two-part or major/minor version. */
+ public int maintenance() {
+ return part(2);
+ }
+
+ @Override
+ public int compareTo(ReleaseVersion o) {
+ var n = Math.max(parts.length, o.parts.length);
+ for (var i = 0; i < n; i++) {
+ var a = i < parts.length ? parts[i] : 0;
+ var b = i < o.parts.length ? o.parts[i] : 0;
+ if (a != b)
+ return Integer.compare(a, b);
+ }
+ return 0;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ return this == o || (o instanceof ReleaseVersion o2 && compareTo(o2) == 0);
+ }
+
+ @Override
+ public int hashCode() {
+ // Consistent with compareTo: absent and explicit trailing-zero components are equivalent
+ // (e.g. "9.2" == "9.2.0"), so hash only the significant leading numeric components.
+ var last = parts.length;
+ while (last > 0 && parts[last - 1] == 0)
+ last--;
+ var h = 1;
+ for (var i = 0; i < last; i++)
+ h = 31 * h + parts[i];
+ return h;
+ }
+
+ /** Highest non-prerelease version strictly below {@code ceiling} (exclusive). */
+ public static ReleaseVersion highestReleasedBelow(List<String> tags, String ceiling) {
+ var cap = of(ceiling);
+ ReleaseVersion best = null;
+ for (var t : tags) {
+ var v = ofTag(t);
+ if (v.isPrerelease() || v.compareTo(cap) >= 0)
+ continue;
+ if (best == null || v.compareTo(best) > 0)
+ best = v;
+ }
+ return best;
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/rest/CredentialRest.java b/src/main/java/org/apache/juneau/releng/rest/CredentialRest.java
new file mode 100644
index 0000000000..fa3b625b6c
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/rest/CredentialRest.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.rest;
+
+import java.util.List;
+import org.apache.juneau.commons.inject.Bean;
+import org.apache.juneau.http.Content;
+import org.apache.juneau.http.Path;
+import org.apache.juneau.rest.server.Rest;
+import org.apache.juneau.rest.server.RestDelete;
+import org.apache.juneau.rest.server.RestGet;
+import org.apache.juneau.rest.server.RestPost;
+import org.apache.juneau.rest.server.servlet.BasicRestResource;
+import org.apache.juneau.rest.server.view.View;
+import org.apache.juneau.rest.server.view.freemarker.FreemarkerMixin;
+import org.apache.juneau.rest.server.view.freemarker.FreemarkerView;
+import org.apache.juneau.rest.server.view.freemarker.FreemarkerViewRenderer;
+import org.apache.juneau.releng.credential.CredentialService;
+import org.apache.juneau.releng.credential.CredentialStatus;
+import org.apache.juneau.releng.credential.Validator.ValidationResult;
+
+/** Credentials tab: store + live-validate Apache/GPG/GitHub secrets. Never returns secret values. */
+@Rest(path = "/credentials", title = "Credentials", responseProcessors = FreemarkerViewRenderer.class)
+public class CredentialRest extends BasicRestResource {
+
+ private final CredentialService service;
+
+ public CredentialRest(CredentialService service) {
+ this.service = service;
+ }
+
+ @Bean
+ public FreemarkerMixin freemarker() {
+ return FreemarkerMixin.create().basePath("/templates/").templateSuffix(".ftlh").build();
+ }
+
+ /** Human page. */
+ @RestGet("/")
+ public View page() {
+ return FreemarkerView.of("credentials").attr("credentials", service.status());
+ }
+
+ /** JSON status for all credentials (no secrets). */
+ @RestGet("/status")
+ public List<CredentialStatus> status() {
+ return service.status();
+ }
+
+ /** Store/update a credential. Body: {account?, secret}. Apache/GPG send account (availid/keyId). */
+ @RestPost("/{name}")
+ public CredentialStatus set(@Path("name") String name, @Content StoreRequest body) {
+ service.store(name, body.account, body.secret);
+ return service.status().stream().filter(c -> c.name.equals(name)).findFirst().orElseThrow();
+ }
+
+ /** Run the live validation. */
+ @RestPost("/{name}/validate")
+ public ValidationResult validate(@Path("name") String name) {
+ return service.validate(name);
+ }
+
+ /** Remove a credential from the Keychain. */
+ @RestDelete("/{name}")
+ public CredentialStatus remove(@Path("name") String name) {
+ service.delete(name);
+ return service.status().stream().filter(c -> c.name.equals(name)).findFirst().orElseThrow();
+ }
+
+ /** POST body for storing a credential. */
+ public static class StoreRequest {
+ public String account; // availid (Apache) or key ID (GPG); ignored for GitHub
+ public String secret;
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/rest/HomeRest.java b/src/main/java/org/apache/juneau/releng/rest/HomeRest.java
new file mode 100644
index 0000000000..13eb2b32ba
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/rest/HomeRest.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.rest;
+
+import org.apache.juneau.commons.inject.Bean;
+import org.apache.juneau.rest.server.Rest;
+import org.apache.juneau.rest.server.RestGet;
+import org.apache.juneau.rest.server.servlet.BasicRestResource;
+import org.apache.juneau.rest.server.view.View;
+import org.apache.juneau.rest.server.view.freemarker.FreemarkerMixin;
+import org.apache.juneau.rest.server.view.freemarker.FreemarkerView;
+import org.apache.juneau.rest.server.view.freemarker.FreemarkerViewRenderer;
+
+/** Home tab: default landing page with basic usage instructions. */
+@Rest(path = "/home", title = "Home", responseProcessors = FreemarkerViewRenderer.class)
+public class HomeRest extends BasicRestResource {
+
+ @Bean
+ public FreemarkerMixin freemarker() {
+ return FreemarkerMixin.create().basePath("/templates/").templateSuffix(".ftlh").build();
+ }
+
+ /** Human page. */
+ @RestGet("/")
+ public View page() {
+ return FreemarkerView.of("home");
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/rest/MilestoneRest.java b/src/main/java/org/apache/juneau/releng/rest/MilestoneRest.java
new file mode 100644
index 0000000000..eef149e266
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/rest/MilestoneRest.java
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.rest;
+
+import java.util.List;
+import org.apache.juneau.http.Path;
+import org.apache.juneau.rest.server.Rest;
+import org.apache.juneau.rest.server.RestGet;
+import org.apache.juneau.rest.server.servlet.BasicRestResource;
+import org.apache.juneau.releng.milestone.GithubPrSource;
+import org.apache.juneau.releng.milestone.MilestoneService;
+import org.apache.juneau.releng.milestone.PullRequest;
+import org.apache.juneau.releng.util.ProcessRunner;
+
+/** Milestone tab: preview the "** Changes" section for a version. */
+@Rest(path = "/milestones", title = "Milestones")
+public class MilestoneRest extends BasicRestResource {
+
+ private final MilestoneService service;
+ private final GithubPrSource prSource;
+ private final ProcessRunner runner;
+ private final String repoDir;
+
+ public MilestoneRest(MilestoneService service, GithubPrSource prSource, ProcessRunner runner, String repoDir) {
+ this.service = service;
+ this.prSource = prSource;
+ this.runner = runner;
+ this.repoDir = repoDir;
+ }
+
+ /** Dry-run preview: the generated "** Changes" section for the given version's milestone. */
+ @RestGet(path = "/{version}/changelog", produces = "text/plain")
+ public String changelog(@Path("version") String version) {
+ var prs = prSource.forMilestone(version);
+ return service.renderChangesSection(prs);
+ }
+
+ /** JSON list of merged PRs for the version's milestone (curl/CLI). */
+ @RestGet("/{version}/prs")
+ public List<PullRequest> prs(@Path("version") String version) {
+ return prSource.forMilestone(version);
+ }
+
+ /** The previous release tag the changelog is computed against (diagnostic). */
+ @RestGet(path = "/{version}/previous-tag", produces = "text/plain")
+ public String previousTag(@Path("version") String version) {
+ var tags = runner.runLines(List.of("git", "-C", repoDir, "tag", "--list", "juneau-*"));
+ var prev = service.previousTag(tags, version);
+ return prev == null ? "(none)" : prev;
+ }
+
+ /**
+ * §8.1 milestone form pre-fill: resolves the milestone number by title-matching {@code version}, for the
+ * New-Release page to populate its (user-overridable) milestone field before starting a run.
+ */
+ @RestGet("/{version}/resolve")
+ public MilestoneResolution resolve(@Path("version") String version) {
+ var out = new MilestoneResolution();
+ out.milestoneNumber = prSource.resolveMilestoneNumber(version);
+ return out;
+ }
+
+ public static class MilestoneResolution {
+ public Integer milestoneNumber;
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/rest/ReleaseRest.java b/src/main/java/org/apache/juneau/releng/rest/ReleaseRest.java
new file mode 100644
index 0000000000..9de8300624
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/rest/ReleaseRest.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.rest;
+
+import java.util.List;
+import org.apache.juneau.commons.inject.Bean;
+import org.apache.juneau.rest.server.Rest;
+import org.apache.juneau.rest.server.RestGet;
+import org.apache.juneau.rest.server.servlet.BasicRestResource;
+import org.apache.juneau.rest.server.view.View;
+import org.apache.juneau.rest.server.view.freemarker.FreemarkerMixin;
+import org.apache.juneau.rest.server.view.freemarker.FreemarkerView;
+import org.apache.juneau.rest.server.view.freemarker.FreemarkerViewRenderer;
+import org.apache.juneau.releng.release.Release;
+import org.apache.juneau.releng.release.ReleaseListService;
+
+/** Releases tab: server-rendered HTML page + JSON data endpoint. */
+@Rest(path = "/releases", title = "Releases", responseProcessors = FreemarkerViewRenderer.class)
+public class ReleaseRest extends BasicRestResource {
+
+ private final ReleaseListService service;
+
+ public ReleaseRest(ReleaseListService service) {
+ this.service = service;
+ }
+
+ @Bean
+ public FreemarkerMixin freemarker() {
+ return FreemarkerMixin.create().basePath("/templates/").templateSuffix(".ftlh").build();
+ }
+
+ /** Human page — server-rendered releases table, enhanced by DataTables. */
+ @RestGet("/")
+ public View page() {
+ return FreemarkerView.of("releases").attr("releases", service.list());
+ }
+
+ /** Machine endpoint — bare JSON array for curl/CLI/DataTables ajax. */
+ @RestGet("/data")
+ public List<Release> data() {
+ return service.list();
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/rest/ReleaseRunRest.java b/src/main/java/org/apache/juneau/releng/rest/ReleaseRunRest.java
new file mode 100644
index 0000000000..3e3be896dc
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/rest/ReleaseRunRest.java
@@ -0,0 +1,204 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.rest;
+
+import java.util.Map;
+import org.apache.juneau.commons.inject.Bean;
+import org.apache.juneau.http.Content;
+import org.apache.juneau.http.Path;
+import org.apache.juneau.http.response.Conflict;
+import org.apache.juneau.http.response.NotFound;
+import org.apache.juneau.rest.server.Rest;
+import org.apache.juneau.rest.server.RestGet;
+import org.apache.juneau.rest.server.RestPost;
+import org.apache.juneau.rest.server.servlet.BasicRestResource;
+import org.apache.juneau.rest.server.view.View;
+import org.apache.juneau.rest.server.view.freemarker.FreemarkerMixin;
+import org.apache.juneau.rest.server.view.freemarker.FreemarkerView;
+import org.apache.juneau.rest.server.view.freemarker.FreemarkerViewRenderer;
+import org.apache.juneau.releng.engine.DropRcService;
+import org.apache.juneau.releng.engine.Preview;
+import org.apache.juneau.releng.engine.ReleaseEngine;
+import org.apache.juneau.releng.engine.RunState;
+import org.apache.juneau.releng.engine.StepResult;
+
+/** New Release tab: pipeline control panel (View) plus JSON run/step/vote/drop-RC actions. */
+@Rest(path = "/runs", title = "New Release", responseProcessors = FreemarkerViewRenderer.class)
+public class ReleaseRunRest extends BasicRestResource {
+
+ private final ReleaseEngine engine;
+ private final DropRcService dropRc;
+
+ public ReleaseRunRest(ReleaseEngine engine, DropRcService dropRc) {
+ this.engine = engine;
+ this.dropRc = dropRc;
+ }
+
+ @Bean
+ public FreemarkerMixin freemarker() {
+ return FreemarkerMixin.create().basePath("/templates/").templateSuffix(".ftlh").build();
+ }
+
+ /** Human page — the pipeline control panel for the active run (or an empty start form). */
+ @RestGet("/")
+ public View page() {
+ var view = FreemarkerView.of("new-release").attr("steps", engine.registry().steps()).attr("mode",
+ engine.mode().name());
+ // FreemarkerView.attr() rejects null values by design; the template only checks run??
+ // (attribute presence), so omit the attribute entirely when there's no active run.
+ var active = engine.activeRun().orElse(null);
+ return active == null ? view
+ : view.attr("run", active).attr("armed", Boolean.valueOf(engine.isArmed(active.version)));
+ }
+
+ /** JSON RunState for polling / initial page data. */
+ @RestGet("/{version}")
+ public RunState state(@Path("version") String version) {
+ return requireRun(version);
+ }
+
+ /**
+ * Start a new run. Body: {version, developmentVersion?, milestoneNumber?}. {@code milestoneNumber} is
+ * the New-Release form field — pre-filled client-side by title-match resolution (§8.1), user-overridable.
+ * Rejects a second concurrent run with 409.
+ */
+ @RestPost("/")
+ public RunState start(@Content StartRequest body) {
+ try {
+ return engine.start(body.version, body.developmentVersion, body.milestoneNumber);
+ } catch (IllegalStateException e) {
+ throw new Conflict(e.getMessage());
+ }
+ }
+
+ @RestPost("/{version}/steps/{stepId}/preview")
+ public Preview preview(@Path("version") String version, @Path("stepId") String stepId,
+ @Content Map<String, String> form) {
+ requireRun(version);
+ return engine.preview(version, stepId, form == null ? Map.of() : form);
+ }
+
+ @RestPost("/{version}/steps/{stepId}/apply")
+ public StepResult apply(@Path("version") String version, @Path("stepId") String stepId,
+ @Content Map<String, String> form) {
+ requireRun(version);
+ // Extra friction for the irreversible nexus-release.
+ if (stepId.equals("nexus-release")) {
+ var confirm = form == null ? null : form.get("confirmVersion");
+ if (confirm == null || !confirm.equals(version))
+ return StepResult.fail("Type the version string to confirm this irreversible release.");
+ }
+ return engine.apply(version, stepId, form == null ? Map.of() : form);
+ }
+
+ /**
+ * Resume (a failed step) or Re-run (an already-succeeded/skipped step) — both are the same call:
+ * re-invoke that step's apply() from scratch, overwriting status and log in place with no separate
+ * history. The UI picks the button label from the step's current status; the engine doesn't care which
+ * label was clicked.
+ */
+ @RestPost("/{version}/steps/{stepId}/resume")
+ public StepResult resume(@Path("version") String version, @Path("stepId") String stepId,
+ @Content Map<String, String> form) {
+ requireRun(version);
+ return engine.apply(version, stepId, form == null ? Map.of() : form);
+ }
+
+ @RestPost("/{version}/steps/{stepId}/skip")
+ public StepResult skip(@Path("version") String version, @Path("stepId") String stepId) {
+ requireRun(version);
+ return engine.skip(version, stepId);
+ }
+
+ /**
+ * Arm this run for LIVE mutation. Requires a typed confirm phrase ({@code "<version> LIVE"}) and is
+ * rejected outright in SAFE mode. Arming is in-memory on the engine and drops on any restart.
+ */
+ @RestPost("/{version}/arm")
+ public StepResult arm(@Path("version") String version, @Content ArmRequest body) {
+ requireRun(version);
+ return engine.arm(version, body == null ? null : body.confirm);
+ }
+
+ /** Advance a review-gate step held in {@code AWAITING_REVIEW} once the human has confirmed the read-only work. */
+ @RestPost("/{version}/steps/{stepId}/confirm-review")
+ public StepResult confirmReview(@Path("version") String version, @Path("stepId") String stepId) {
+ requireRun(version);
+ return engine.confirmReview(version, stepId);
+ }
+
+ /** Record the vote outcome; 'rejected' triggers Drop-RC. */
+ @RestPost("/{version}/vote-result")
+ public StepResult voteResult(@Path("version") String version, @Content VoteResultRequest body) {
+ requireRun(version);
+ return engine.apply(version, "tally-vote-result",
+ Map.of("voteOutcome", body.outcome, "tally", body.tally == null ? "" : body.tally));
+ // UI reads outcome; if 'rejected', UI then calls drop-rc/preview + apply.
+ }
+
+ @RestPost("/{version}/drop-rc/preview")
+ public Preview dropRcPreview(@Path("version") String version) {
+ requireRun(version);
+ return dropRc.preview(version);
+ }
+
+ @RestPost("/{version}/drop-rc/apply")
+ public StepResult dropRcApply(@Path("version") String version, @Content DropRcRequest body) {
+ var rs = requireRun(version);
+ if (body.confirmRc == null || !body.confirmRc.equals("RC" + rs.rc))
+ return StepResult.fail("Type the RC identifier (e.g. RC1) to confirm this destructive action.");
+ var secrets = engine.secrets();
+ try {
+ dropRc.apply(version, body.reason, secrets::availid, secrets::ldapPassword);
+ } catch (IllegalStateException e) {
+ return StepResult.fail(e.getMessage()); // the LIVE-unarmed guard refusal
+ }
+ return StepResult.ok("RC dropped; bumped to the next RC.");
+ }
+
+ /**
+ * All run-scoped endpoints 404 (rather than the engine's raw {@code IllegalStateException} propagating
+ * as a 500) when there's no persisted run for {@code version}.
+ */
+ private RunState requireRun(String version) {
+ var rs = engine.state(version);
+ if (rs == null)
+ throw new NotFound("No run for %s", version);
+ return rs;
+ }
+
+ public static class StartRequest {
+ public String version;
+ public String developmentVersion;
+ public Integer milestoneNumber;
+ }
+
+ public static class VoteResultRequest {
+ public String outcome;
+ public String tally;
+ }
+
+ public static class DropRcRequest {
+ public String reason;
+ public String confirmRc;
+ }
+
+ public static class ArmRequest {
+ public String confirm;
+ }
+}
diff --git a/src/main/java/org/apache/juneau/releng/util/ProcessRunner.java b/src/main/java/org/apache/juneau/releng/util/ProcessRunner.java
new file mode 100644
index 0000000000..e3d1b94a09
--- /dev/null
+++ b/src/main/java/org/apache/juneau/releng/util/ProcessRunner.java
@@ -0,0 +1,173 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng.util;
+
+import static org.apache.juneau.commons.utils.Shorts.*;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Consumer;
+
+public interface ProcessRunner {
+
+ /** Runs a command and returns stdout split into trimmed non-empty lines. */
+ List<String> runLines(List<String> command);
+
+ /** Runs a command and returns the full stdout as one string. */
+ String runText(List<String> command);
+
+ /** Result of a raw run: exit code + combined stdout/stderr (never throws on non-zero). */
+ record ProcResult(int exitCode, String output) {
+ public boolean ok() {
+ return exitCode == 0;
+ }
+ }
+
+ /**
+ * Runs a command with optional stdin and extra environment variables, returning the exit code and
+ * output without throwing. Keeps secrets off argv (pass them via {@code stdin} or {@code env}).
+ */
+ ProcResult run(List<String> command, String stdin, Map<String, String> env);
+
+ /**
+ * Streaming variant of {@link #run(List, String, Map)}: invokes {@code lineSink} for each
+ * combined stdout/stderr line as it arrives (for live SSE tailing), and also accumulates the
+ * full output into the returned {@link ProcResult}. Never throws on non-zero exit. Default delegates to a
+ * buffered run then replays lines; the real implementation overrides for true line-at-a-time tailing.
+ */
+ default ProcResult run(List<String> command, String stdin, Map<String, String> env, Consumer<String> lineSink) {
+ return runStreamingDefault(command, stdin, env, lineSink);
+ }
+
+ /** Default streaming impl for stubs that don't override it: falls back to a buffered run then replays. */
+ default ProcResult runStreamingDefault(List<String> command, String stdin, Map<String, String> env,
+ Consumer<String> lineSink) {
+ var res = run(command, stdin, env);
+ if (lineSink != null && res.output() != null)
+ for (var line : res.output().split("\n", -1))
+ if (!line.isEmpty())
+ lineSink.accept(line);
+ return res;
+ }
+
+ /** Default real implementation using {@link ProcessBuilder}. */
+ class Default implements ProcessRunner {
+ private static final String MSG_INTERRUPTED = "Interrupted running: %s";
+ private static final String MSG_ERROR = "Error running: %s";
+
+ @Override
+ public List<String> runLines(List<String> command) {
+ var out = new ArrayList<String>();
+ for (var line : runText(command).split("\n")) {
+ var t = line.strip();
+ if (!t.isEmpty())
+ out.add(t);
+ }
+ return out;
+ }
+
+ @Override
+ public String runText(List<String> command) {
+ try {
+ var p = new ProcessBuilder(command).redirectErrorStream(true).start();
+ String text;
+ try (var r = new BufferedReader(new InputStreamReader(p.getInputStream(), StandardCharsets.UTF_8))) {
+ var sb = new StringBuilder();
+ String line;
+ while ((line = r.readLine()) != null)
+ sb.append(line).append('\n');
+ text = sb.toString();
+ }
+ var code = p.waitFor();
+ if (code != 0)
+ throw isex("Command failed (exit %s): %s\n%s", code, command, text);
+ return text;
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw isex(e, MSG_INTERRUPTED, command);
+ } catch (Exception e) {
+ throw isex(e, MSG_ERROR, command);
+ }
+ }
+
+ @Override
+ public ProcResult run(List<String> command, String stdin, Map<String, String> env) {
+ try {
+ var pb = new ProcessBuilder(command).redirectErrorStream(true);
+ if (env != null)
+ pb.environment().putAll(env);
+ var p = pb.start();
+ if (stdin != null) {
+ try (var os = p.getOutputStream()) {
+ os.write(stdin.getBytes(StandardCharsets.UTF_8));
+ }
+ }
+ String text;
+ try (var r = new BufferedReader(new InputStreamReader(p.getInputStream(), StandardCharsets.UTF_8))) {
+ var sb = new StringBuilder();
+ String line;
+ while ((line = r.readLine()) != null)
+ sb.append(line).append('\n');
+ text = sb.toString();
+ }
+ var code = p.waitFor();
+ return new ProcResult(code, text);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw isex(e, MSG_INTERRUPTED, command);
+ } catch (Exception e) {
+ throw isex(e, MSG_ERROR, command);
+ }
+ }
+
+ @Override
+ public ProcResult run(List<String> command, String stdin, Map<String, String> env, Consumer<String> lineSink) {
+ try {
+ var pb = new ProcessBuilder(command).redirectErrorStream(true);
+ if (env != null)
+ pb.environment().putAll(env);
+ var p = pb.start();
+ if (stdin != null) {
+ try (var os = p.getOutputStream()) {
+ os.write(stdin.getBytes(StandardCharsets.UTF_8));
+ }
+ }
+ var sb = new StringBuilder();
+ try (var r = new BufferedReader(new InputStreamReader(p.getInputStream(), StandardCharsets.UTF_8))) {
+ String line;
+ while ((line = r.readLine()) != null) {
+ sb.append(line).append('\n');
+ if (lineSink != null)
+ lineSink.accept(line);
+ }
+ }
+ var code = p.waitFor();
+ return new ProcResult(code, sb.toString());
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw isex(e, MSG_INTERRUPTED, command);
+ } catch (Exception e) {
+ throw isex(e, MSG_ERROR, command);
+ }
+ }
+ }
+}
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
new file mode 100644
index 0000000000..b23e2978ff
--- /dev/null
+++ b/src/main/resources/application.properties
@@ -0,0 +1,27 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+server.address=127.0.0.1
+server.port=8790
+spring.application.name=juneau-release-manager
+rm.repo.dir=${user.home}/git/apache/juneau
+rm.repo.slug=apache/juneau
+rm.state.dir=${user.home}/.juneau-release-manager/state
+rm.staging.dir=${user.home}/.juneau-release-manager/staging
+rm.git.committer.email=jamesbognar@apache.org
+rm.slack.webhook=
+# Execution mode: safe (default) simulates all mutations + routes Nexus to the in-app loopback mock;
+# live executes real mutations (and still requires per-run arming at the guard chokepoint).
+rm.mode=safe
diff --git a/src/main/resources/static/css/chrome.css b/src/main/resources/static/css/chrome.css
new file mode 100644
index 0000000000..76220ffb22
--- /dev/null
+++ b/src/main/resources/static/css/chrome.css
@@ -0,0 +1,738 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* ==========================================================================
+ Apache Juneau · Release Manager — shared "chrome" stylesheet
+ ==========================================================================
+
+ PURPOSE
+ This file defines the admin-console app shell (header, primary nav, card,
+ DataTable, tag/pill system) using only open, redistributable assets. It is
+ designed to evolve into the *real* shared chrome CSS for the Release
+ Manager UI.
+
+ SWAPPABLE THEME TOKENS
+ All brand-specific bits are expressed as CSS custom properties on :root
+ so a sibling app can re-skin the exact same markup/CSS by overriding a
+ small token block — no other rule in this file should need to change.
+
+ Default theme = "Apache" (this file, below) — open assets only.
+ ========================================================================== */
+
+:root {
+ /* ---- Swappable brand tokens (override per-app) ---- */
+ --rm-font: 'Inter', 'Source Sans 3', system-ui, -apple-system, sans-serif;
+ --rm-logo: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA0OCA0OCc+PHJlY3Qgd2lkdGg9JzQ4JyBoZWlnaHQ9JzQ4JyByeD0nMTAnIGZpbGw9JyMxNTg5RUUnLz48cGF0aCBkPSdNMjQgOGMtNyA2LTExIDEzLTExIDE5YTExIDExIDAgMCAwIDIyIDBjMC02LTQtMTMtMTEtMTl6JyBmaWxsPScjZmZmZmZmJyBmaWxsLW9wYWNpdHk9JzAuOTUnLz48cGF0aCBkPSdNMjQgMTR2MjAnIHN0cm9rZT0nIzE1ODlFRScgc3Ryb2tlLXdpZHRoPScxLjYnIHN0cm9rZS1saW5lY2FwPSdyb3VuZCcvPjwvc3ZnPgo=");
+ --rm-logo-size: 26px 26px;
+ --rm-page-bg: linear-gradient(180deg, #b0c4df 0%, #c7d5e8 22%, #e4eaf2 55%, #f5f6f9 100%);
+ --rm-header-icon-color: #747474;
+
+ /* ---- Brand accent ---- */
+ --rm-accent: #1589EE;
+ --rm-accent-2: #1589ed;
+ --rm-accent-wash: #1589ee1a;
+
+ /* ---- Text ---- */
+ --rm-link: #0174d3;
+ --rm-text: #080707;
+ --rm-text-soft: #080707cc;
+ --rm-text-muted: #706e6b;
+ --rm-text-muted-2: #3e3e3c;
+
+ /* ---- Borders / surfaces ---- */
+ --rm-border: #dddbda;
+ --rm-border-2: #ced4da;
+ --rm-card-bg: #f5f6f9;
+ --rm-chrome-bg: #f3f2f2;
+ --rm-white: #ffffff;
+
+ /* ---- Buttons / status ---- */
+ --rm-btn-primary: #1a5297;
+ --rm-btn-primary-hover: #005fb2;
+ --rm-danger: #c23934;
+ --rm-success: #2e844a;
+
+ /* ---- Tag / pill palette ---- */
+ --rm-tag-green-bg: #b8e6c4;
+ --rm-tag-green-text: #155724;
+ --rm-tag-green-border: #9fd6ad;
+
+ --rm-tag-blue-bg: #dceefb;
+ --rm-tag-blue-text: #0c5460;
+ --rm-tag-blue-border: #c3e0f3;
+
+ --rm-tag-amber-bg: #fff3cd;
+ --rm-tag-amber-text: #856404;
+ --rm-tag-amber-border: #ffe69c;
+
+ --rm-tag-neutral-bg: #e2e3e5;
+ --rm-tag-neutral-text: #383d41;
+ --rm-tag-neutral-border: #c6c8ca;
+
+ --rm-radius: 0.25rem;
+}
+
+/* ==========================================================================
+ Base / page
+ ========================================================================== */
+
+* { box-sizing: border-box; }
+
+html, body {
+ margin: 0;
+ padding: 0;
+ font-family: var(--rm-font);
+ color: var(--rm-text);
+ background: var(--rm-page-bg);
+ min-height: 100vh;
+}
+
+body {
+ display: flex;
+ flex-direction: column;
+}
+
+a { color: var(--rm-link); text-decoration: none; }
+a:hover { text-decoration: underline; }
+
+/* ==========================================================================
+ Header
+ ========================================================================== */
+
+.rm-header {
+ display: flex;
+ align-items: center;
+ height: 68px;
+ background: var(--rm-white);
+ position: sticky;
+ top: 0;
+ z-index: 20;
+}
+
+.rm-brand {
+ display: flex;
+ align-items: center;
+ flex: 1 1 auto;
+ min-width: 0;
+}
+
+.rm-brand-mark {
+ width: 48px;
+ height: 48px;
+ margin: 10px 20px;
+ flex: 0 0 auto;
+ border-radius: var(--rm-radius);
+ background-color: var(--rm-white);
+ background-image: var(--rm-logo);
+ background-repeat: no-repeat;
+ background-position: center;
+ background-size: var(--rm-logo-size);
+}
+
+.rm-brand-title {
+ font-size: 1.125rem;
+ font-weight: 600;
+ color: var(--rm-text-soft);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.rm-brand-title .rm-brand-sep {
+ margin: 0 6px;
+ color: var(--rm-text-muted);
+ font-weight: 400;
+}
+
+.rm-header-actions {
+ display: flex;
+ align-items: center;
+ gap: 4px;
+ padding-right: 16px;
+ flex: 0 0 auto;
+}
+
+.rm-icon-btn {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 32px;
+ height: 32px;
+ border-radius: 50%;
+ color: var(--rm-header-icon-color);
+ background: transparent;
+ border: none;
+ cursor: pointer;
+}
+
+.rm-icon-btn:hover { background: var(--rm-chrome-bg); }
+
+.rm-icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
+
+.rm-avatar {
+ width: 30px;
+ height: 30px;
+ border-radius: 50%;
+ background: linear-gradient(135deg, var(--rm-accent), var(--rm-btn-primary));
+ color: var(--rm-white);
+ font-size: 0.75rem;
+ font-weight: 700;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin-left: 8px;
+}
+
+/* ==========================================================================
+ Primary navigation
+ ========================================================================== */
+
+.nav {
+ display: flex;
+ align-items: stretch;
+ background: var(--rm-white);
+ border-bottom: 3px solid var(--rm-accent);
+ padding: 0 16px;
+ position: sticky;
+ top: 68px;
+ z-index: 19;
+}
+
+.nav-tab {
+ display: flex;
+ align-items: center;
+ font-size: 0.8125rem;
+ font-weight: 600;
+ color: var(--rm-text-soft);
+ padding: 8px 10px;
+ margin-right: 2px;
+ border-top: 3px solid transparent;
+ border-bottom: none;
+ cursor: pointer;
+ transition: background-color 0.1s ease-in;
+}
+
+.nav-tab:hover {
+ background: var(--rm-accent-wash);
+ text-decoration: none;
+}
+
+.nav-tab.active {
+ background: var(--rm-accent-wash);
+ border-top-color: var(--rm-accent);
+ color: var(--rm-text);
+}
+
+/* ==========================================================================
+ Page scaffolding
+ ========================================================================== */
+
+.rm-main {
+ flex: 1 1 auto;
+ padding: 20px 24px 40px;
+}
+
+.rm-page-header {
+ display: flex;
+ align-items: baseline;
+ justify-content: space-between;
+ max-width: 1180px;
+ margin: 0 auto 14px;
+ flex-wrap: wrap;
+ gap: 10px;
+}
+
+.rm-page-header h1 {
+ font-size: 1.375rem;
+ font-weight: 700;
+ color: var(--rm-text);
+ margin: 0;
+}
+
+.rm-page-header .rm-page-sub {
+ font-size: 0.8125rem;
+ color: var(--rm-text-muted);
+ margin-top: 2px;
+}
+
+.rm-breadcrumb {
+ font-size: 0.75rem;
+ color: var(--rm-text-muted);
+ margin-bottom: 4px;
+}
+
+.rm-breadcrumb a { color: var(--rm-text-muted); }
+.rm-breadcrumb .sep { margin: 0 6px; }
+
+/* ==========================================================================
+ Card
+ ========================================================================== */
+
+.rm-card {
+ max-width: 1180px;
+ margin: 0 auto;
+ background: var(--rm-card-bg);
+ border: 1px solid var(--rm-border);
+ border-radius: var(--rm-radius);
+ padding: 18px 20px 8px;
+}
+
+.rm-card-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: 12px;
+ flex-wrap: wrap;
+ gap: 10px;
+}
+
+.rm-card-header h2 {
+ font-size: 1rem;
+ font-weight: 700;
+ color: var(--rm-text);
+ margin: 0;
+}
+
+/* ==========================================================================
+ Buttons
+ ========================================================================== */
+
+.btn {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ font-family: var(--rm-font);
+ font-size: 0.8125rem;
+ font-weight: 600;
+ padding: 7px 14px;
+ border-radius: var(--rm-radius);
+ border: 1px solid transparent;
+ cursor: pointer;
+ line-height: 1.2;
+}
+
+.btn-primary {
+ background: var(--rm-btn-primary);
+ color: var(--rm-white);
+}
+.btn-primary:hover { background: var(--rm-btn-primary-hover); }
+
+.btn-outline {
+ background: var(--rm-white);
+ color: var(--rm-text-soft);
+ border-color: var(--rm-border-2);
+}
+.btn-outline:hover { background: var(--rm-chrome-bg); }
+
+.btn-danger {
+ background: var(--rm-white);
+ color: var(--rm-danger);
+ border-color: var(--rm-border-2);
+}
+.btn-danger:hover { background: #fdeceb; }
+
+/* ==========================================================================
+ Tag / pill system
+ ========================================================================== */
+
+.tag {
+ display: inline-block;
+ padding: 1px 6px;
+ border-radius: 3px;
+ font-size: 10px;
+ font-weight: 700;
+ letter-spacing: 0.5px;
+ text-transform: uppercase;
+ border: 1px solid transparent;
+ white-space: nowrap;
+ line-height: 1.5;
+ /* Neutral default so any value outside the known domain vocabulary below
+ (e.g. free-text release "stage" values this app has beyond the mockup's
+ controlled vocabulary) still renders as a filled pill. */
+ background: var(--rm-tag-neutral-bg);
+ color: var(--rm-tag-neutral-text);
+ border-color: var(--rm-tag-neutral-border);
+}
+
+/* domain: status */
+.tag.status.released,
+.tag.stage.released { background: var(--rm-tag-green-bg); color: var(--rm-tag-green-text); border-color: var(--rm-tag-green-border); }
+
+.tag.status.voting,
+.tag.status.rc,
+.tag.stage.voting,
+.tag.stage.rc { background: var(--rm-tag-blue-bg); color: var(--rm-tag-blue-text); border-color: var(--rm-tag-blue-border); }
+
+.tag.status.draft,
+.tag.status.pending,
+.tag.stage.draft,
+.tag.stage.pending,
+.tag.stage.building { background: var(--rm-tag-amber-bg); color: var(--rm-tag-amber-text); border-color: var(--rm-tag-amber-border); }
+
+.tag.status.dropped,
+.tag.status.unknown,
+.tag.stage.dropped,
+.tag.stage.unknown,
+.tag.stage.archived,
+.tag.stage.cancelled { background: var(--rm-tag-neutral-bg); color: var(--rm-tag-neutral-text); border-color: var(--rm-tag-neutral-border); }
+
+/* Release Manager app's own "stage" vocabulary (Release.stage — not part of
+ the mockup's controlled vocabulary above, but slotted into the same
+ green/blue/neutral domains for visual consistency). */
+.tag.stage.distributed { background: var(--rm-tag-green-bg); color: var(--rm-tag-green-text); border-color: var(--rm-tag-green-border); }
+.tag.stage.awaiting-vote { background: var(--rm-tag-blue-bg); color: var(--rm-tag-blue-text); border-color: var(--rm-tag-blue-border); }
+
+/* ==========================================================================
+ Data table (DataTables integration)
+ ========================================================================== */
+
+.rm-table-toolbar {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ font-size: 0.8125rem;
+ color: var(--rm-text-muted-2);
+ padding: 6px 2px 10px;
+ flex-wrap: wrap;
+ gap: 10px;
+}
+
+.rm-table-length,
+.rm-table-search {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+}
+
+.rm-table-length select,
+.rm-table-search input {
+ font-family: var(--rm-font);
+ font-size: 0.8125rem;
+ padding: 4px 8px;
+ border: 1px solid var(--rm-border-2);
+ border-radius: var(--rm-radius);
+ background: var(--rm-white);
+ color: var(--rm-text);
+}
+
+.rm-table-search input { width: 200px; }
+
+/* Horizontal-scroll container so wide tables stay inside the card
+ instead of bleeding past its border on narrow viewports. */
+.rm-table-scroll {
+ overflow-x: auto;
+ -webkit-overflow-scrolling: touch;
+}
+
+table.rm-table {
+ width: 100%;
+ min-width: 720px;
+ border-collapse: collapse;
+ background: var(--rm-white);
+ border: 1px solid var(--rm-border);
+ border-radius: var(--rm-radius);
+ overflow: hidden;
+}
+
+table.rm-table thead th {
+ font-size: 0.75rem;
+ font-weight: 700;
+ letter-spacing: 0.3px;
+ text-transform: uppercase;
+ color: var(--rm-text-muted-2);
+ text-align: left;
+ padding: 10px 12px;
+ border-bottom: 2px solid var(--rm-border);
+ background: var(--rm-chrome-bg);
+ white-space: nowrap;
+}
+
+table.rm-table thead th.sortable { cursor: pointer; position: relative; }
+table.rm-table thead th.sortable::after {
+ content: '\2195';
+ margin-left: 5px;
+ color: var(--rm-border-2);
+ font-weight: 400;
+}
+
+table.rm-table tbody td {
+ font-size: 0.8125rem;
+ color: var(--rm-text);
+ padding: 9px 12px;
+ border-bottom: 1px solid var(--rm-border);
+ vertical-align: middle;
+}
+
+table.rm-table tbody tr:nth-child(odd) { background: #fbfbfc; }
+table.rm-table tbody tr:hover { background: var(--rm-accent-wash); }
+table.rm-table tbody tr:last-child td { border-bottom: none; }
+
+td.details-control {
+ width: 28px;
+ text-align: center;
+ cursor: pointer;
+ color: var(--rm-text-muted);
+}
+
+td.details-control .chevron {
+ display: inline-block;
+ width: 16px;
+ height: 16px;
+ border-radius: 50%;
+ border: 1px solid var(--rm-border-2);
+ color: var(--rm-text-muted-2);
+ font-size: 10px;
+ line-height: 15px;
+ text-align: center;
+ transition: transform 0.15s ease;
+}
+
+tr.row-expanded td.details-control .chevron { transform: rotate(90deg); }
+
+tr.detail-row td {
+ background: var(--rm-card-bg);
+ padding: 14px 18px;
+ border-bottom: 1px solid var(--rm-border);
+}
+
+tr.detail-row .detail-grid {
+ display: grid;
+ grid-template-columns: repeat(3, minmax(160px, 1fr));
+ gap: 10px 24px;
+ font-size: 0.8125rem;
+}
+
+tr.detail-row dt {
+ font-size: 0.6875rem;
+ text-transform: uppercase;
+ letter-spacing: 0.3px;
+ color: var(--rm-text-muted);
+ margin: 0 0 2px;
+}
+
+tr.detail-row dd {
+ margin: 0;
+ color: var(--rm-text);
+}
+
+.rm-table-info {
+ font-size: 0.75rem;
+ color: var(--rm-text-muted);
+ padding: 10px 2px 4px;
+}
+
+.version-cell {
+ font-weight: 700;
+ color: var(--rm-text);
+}
+
+.rc-cell { color: var(--rm-text-muted-2); }
+
+.links-cell a { margin-right: 10px; font-size: 0.8125rem; }
+.links-cell a:last-child { margin-right: 0; }
+
+/* ==========================================================================
+ Footer
+ ========================================================================== */
+
+.rm-footer {
+ text-align: center;
+ font-size: 0.75rem;
+ color: var(--rm-text-muted);
+ padding: 24px 0 32px;
+}
+
+/* ==========================================================================
+ DataTables integration (Release Manager app only — not part of the mockup)
+ ==========================================================================
+
+ The app keeps its real vendored jQuery + DataTables (static/datatables/*)
+ and existing per-tab init JS; nothing below changes DataTables' markup,
+ classes, or behavior. These rules only restyle DataTables' own generated
+ controls (div.dt-container, .dt-length, .dt-search, .dt-info, .dt-paging —
+ the DataTables 2.x class names) with the chrome tokens so the enhanced
+ grid matches the mockup. table.rm-table's rules above already apply to
+ the DataTables-enhanced table itself, since DataTables adds its own
+ "dataTable" class alongside — not instead of — the "rm-table" class this
+ app puts on the <table> element.
+ ========================================================================== */
+
+div.dt-container {
+ font-family: var(--rm-font);
+ color: var(--rm-text-muted-2);
+ font-size: 0.8125rem;
+}
+
+div.dt-container .dt-length,
+div.dt-container .dt-search,
+div.dt-container .dt-info,
+div.dt-container .dt-paging {
+ color: var(--rm-text-muted-2);
+ padding: 6px 2px;
+}
+
+div.dt-container .dt-search input,
+div.dt-container .dt-length select,
+div.dt-container select.dt-input,
+div.dt-container input.dt-input {
+ font-family: var(--rm-font);
+ font-size: 0.8125rem;
+ padding: 4px 8px;
+ border: 1px solid var(--rm-border-2);
+ border-radius: var(--rm-radius);
+ background: var(--rm-white);
+ color: var(--rm-text);
+}
+
+div.dt-container .dt-search input { width: 200px; }
+
+table.dataTable.rm-table thead > tr > th {
+ background: var(--rm-chrome-bg);
+ color: var(--rm-text-muted-2);
+}
+
+table.dataTable.rm-table thead > tr > th.dt-orderable-asc,
+table.dataTable.rm-table thead > tr > th.dt-orderable-desc {
+ cursor: pointer;
+}
+
+table.dataTable.rm-table thead > tr > th .dt-column-order:before,
+table.dataTable.rm-table thead > tr > th .dt-column-order:after {
+ color: var(--rm-border-2);
+}
+
+table.dataTable.rm-table thead > tr > th.dt-ordering-asc .dt-column-order:before,
+table.dataTable.rm-table thead > tr > th.dt-ordering-desc .dt-column-order:after {
+ color: var(--rm-accent);
+}
+
+div.dt-container .dt-paging .dt-paging-button {
+ font-family: var(--rm-font);
+ border-radius: var(--rm-radius);
+}
+
+div.dt-container .dt-paging .dt-paging-button.current,
+div.dt-container .dt-paging .dt-paging-button.current:hover {
+ background: var(--rm-accent) !important;
+ border-color: var(--rm-accent) !important;
+ color: var(--rm-white) !important;
+}
+
+div.dt-container .dt-paging .dt-paging-button:not(.current):not(.disabled):hover {
+ background: var(--rm-accent-wash) !important;
+ border-color: var(--rm-accent) !important;
+ color: var(--rm-text) !important;
+}
+
+/* ==========================================================================
+ Home tab (welcome / instructions)
+ ========================================================================== */
+
+.rm-home-steps,
+.rm-home-prereqs {
+ margin: 0;
+ padding: 4px 0 4px 20px;
+ font-size: 0.8125rem;
+ color: var(--rm-text);
+ line-height: 1.6;
+}
+
+.rm-home-steps li,
+.rm-home-prereqs li {
+ margin-bottom: 8px;
+}
+
+.rm-home-steps li:last-child,
+.rm-home-prereqs li:last-child {
+ margin-bottom: 4px;
+}
+
+.rm-home-steps code,
+.rm-home-prereqs code,
+.rm-page-sub code {
+ font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
+ font-size: 0.75rem;
+ background: var(--rm-chrome-bg);
+ border: 1px solid var(--rm-border);
+ border-radius: 3px;
+ padding: 1px 5px;
+}
+
+/* ==========================================================================
+ Credential cards (Credentials tab)
+ ==========================================================================
+
+ Not shown in the design mockup (which only covers the Releases tab), so
+ this restyles the app's existing .cred/.pill/.row/.msg markup with the
+ same chrome tokens rather than inventing new markup/classes — the
+ Credentials tab JS (static/js/credentials.js) looks up elements by these
+ exact class names and rewrites .pill's className directly, so the names
+ themselves must stay put.
+ ========================================================================== */
+
+.cred {
+ border: 1px solid var(--rm-border);
+ border-radius: var(--rm-radius);
+ background: var(--rm-white);
+ padding: 16px 18px;
+ margin-bottom: 14px;
+}
+
+.cred:last-child { margin-bottom: 0; }
+
+.cred h3 {
+ margin: 0 0 8px;
+ font-size: 0.9375rem;
+ font-weight: 700;
+ color: var(--rm-text);
+}
+
+.cred .row {
+ display: flex;
+ gap: 8px;
+ margin-top: 8px;
+ align-items: center;
+ flex-wrap: wrap;
+}
+
+.cred input {
+ font-family: var(--rm-font);
+ font-size: 0.8125rem;
+ padding: 6px 10px;
+ border: 1px solid var(--rm-border-2);
+ border-radius: var(--rm-radius);
+ background: var(--rm-white);
+ color: var(--rm-text);
+}
+
+.cred .msg {
+ font-size: 0.75rem;
+ color: var(--rm-text-muted);
+ margin-top: 8px;
+}
+
+.pill {
+ display: inline-block;
+ padding: 1px 10px;
+ border-radius: 10px;
+ font-size: 0.75rem;
+ font-weight: 600;
+}
+
+.pill.valid { background: var(--rm-tag-green-bg); color: var(--rm-tag-green-text); }
+.pill.invalid { background: #fdeceb; color: var(--rm-danger); }
+.pill.unset { background: var(--rm-tag-neutral-bg); color: var(--rm-tag-neutral-text); }
diff --git a/src/main/resources/static/css/new-release.css b/src/main/resources/static/css/new-release.css
new file mode 100644
index 0000000000..903622c511
--- /dev/null
+++ b/src/main/resources/static/css/new-release.css
@@ -0,0 +1,532 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* ==========================================================================
+ Apache Juneau · Release Manager — "New Release" page, layout-specific CSS
+ ==========================================================================
+
+ Loaded AFTER chrome.css. Never redefines header/nav/card/table/tag rules
+ that already exist there — only adds:
+ 1. A shared run-header/meta bar + vote-gate banner (used by all 3 options).
+ 2. A handful of NEW `.tag.status.*` values the 24-step pipeline needs
+ that the Releases tab never used (running / succeeded / skipped /
+ failed / awaiting-vote) — each mapped onto the SAME color tokens as
+ chrome.css's existing tag domains, per the design note in §current
+ (succeeded→green, running→blue, skipped/awaiting-vote→neutral,
+ failed→red). `pending` is intentionally NOT redefined here — it
+ already exists in chrome.css's amber group and is reused as-is.
+ 3. Per-step console styling (shared by all 3 options).
+ 4. Layout-specific rules for option A (rail), B (stepper), C (datatable),
+ clearly namespaced/commented per section.
+ ========================================================================== */
+
+/* ==========================================================================
+ New step-status tag values (extends chrome.css's tag system; see header)
+ ========================================================================== */
+
+.tag.status.succeeded { background: var(--rm-tag-green-bg); color: var(--rm-tag-green-text); border-color: var(--rm-tag-green-border); }
+.tag.status.running { background: var(--rm-tag-blue-bg); color: var(--rm-tag-blue-text); border-color: var(--rm-tag-blue-border); }
+.tag.status.skipped,
+.tag.status.awaiting-vote,
+.tag.status.neutral { background: var(--rm-tag-neutral-bg); color: var(--rm-tag-neutral-text); border-color: var(--rm-tag-neutral-border); }
+.tag.status.failed { background: #fdeceb; color: var(--rm-danger); border-color: #f3c6c2; }
+
+.tag.status.running::before { content: '\25CF'; margin-right: 4px; font-size: 8px; position: relative; top: -1px; animation: rm-pulse 1.4s ease-in-out infinite; }
+.tag.status.awaiting-vote::before { content: '\23F8'; margin-right: 3px; font-size: 9px; position: relative; top: 0; }
+
+@keyframes rm-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
+
+/* ==========================================================================
+ Run header + vote banner (shared across all 3 options)
+ ========================================================================== */
+
+.rm-run-header {
+ max-width: 1180px;
+ margin: 0 auto 16px;
+ background: var(--rm-card-bg);
+ border: 1px solid var(--rm-border);
+ border-radius: var(--rm-radius);
+ padding: 16px 20px;
+}
+
+.rm-run-header-top {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ flex-wrap: wrap;
+ gap: 12px;
+}
+
+.rm-run-title-group {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ flex-wrap: wrap;
+}
+
+.rm-run-title {
+ font-size: 1.0625rem;
+ font-weight: 700;
+ color: var(--rm-text);
+ margin: 0;
+}
+
+.rm-run-meta {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ flex-wrap: wrap;
+}
+
+.rm-meta-chip {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ font-size: 0.75rem;
+ color: var(--rm-text-muted-2);
+ background: var(--rm-white);
+ border: 1px solid var(--rm-border-2);
+ border-radius: 999px;
+ padding: 3px 10px;
+}
+
+.rm-meta-chip b { color: var(--rm-text); font-weight: 700; }
+
+.rm-run-actions {
+ display: flex;
+ gap: 8px;
+ flex-wrap: wrap;
+}
+
+.rm-vote-banner {
+ margin-top: 12px;
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ font-size: 0.8125rem;
+ color: var(--rm-text-muted-2);
+ background: var(--rm-tag-neutral-bg);
+ border: 1px solid var(--rm-tag-neutral-border);
+ border-radius: var(--rm-radius);
+ padding: 9px 14px;
+}
+
+.rm-vote-banner b { color: var(--rm-text); }
+
+.rm-vote-banner .rm-vote-countdown {
+ margin-left: auto;
+ font-weight: 700;
+ color: var(--rm-text);
+ white-space: nowrap;
+}
+
+/* ==========================================================================
+ Per-step console (shared by all 3 options)
+ ========================================================================== */
+
+.rm-console {
+ background: #1e1e1e;
+ color: #d4d4d4;
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
+ font-size: 0.75rem;
+ line-height: 1.65;
+ padding: 12px 14px;
+ border-radius: var(--rm-radius);
+ max-height: 240px;
+ overflow-y: auto;
+ white-space: pre-wrap;
+ word-break: break-word;
+}
+
+.rm-console .l-cmd { color: #7ec9ff; }
+.rm-console .l-ok { color: #8fd19e; }
+.rm-console .l-warn { color: #e8c766; }
+.rm-console .l-muted { color: #9a9a9a; }
+
+.rm-console .rm-cursor {
+ display: inline-block;
+ width: 6px;
+ height: 12px;
+ background: #8fd19e;
+ vertical-align: text-bottom;
+ margin-left: 1px;
+ animation: rm-blink 1s steps(1) infinite;
+}
+
+@keyframes rm-blink { 50% { opacity: 0; } }
+
+.rm-console-empty {
+ color: #8a8a8a;
+ font-style: italic;
+ font-size: 0.75rem;
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
+}
+
+.rm-console-label {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ font-size: 0.6875rem;
+ text-transform: uppercase;
+ letter-spacing: 0.3px;
+ color: var(--rm-text-muted);
+ margin: 14px 0 6px;
+}
+
+.rm-console-label .rm-console-hint {
+ text-transform: none;
+ letter-spacing: 0;
+ font-size: 0.6875rem;
+ color: var(--rm-text-muted);
+}
+
+/* ==========================================================================
+ Shared step-detail bits (title row, description, action buttons)
+ ========================================================================== */
+
+.rm-step-title-row {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ flex-wrap: wrap;
+ margin-bottom: 4px;
+}
+
+.rm-step-title-row h3 {
+ font-size: 0.9375rem;
+ font-weight: 700;
+ color: var(--rm-text);
+ margin: 0;
+}
+
+.rm-step-num {
+ color: var(--rm-text-muted);
+ font-weight: 600;
+ font-size: 0.8125rem;
+}
+
+.rm-step-desc {
+ font-size: 0.8125rem;
+ color: var(--rm-text-muted-2);
+ margin: 0 0 12px;
+ max-width: 62ch;
+}
+
+.rm-step-times {
+ font-size: 0.75rem;
+ color: var(--rm-text-muted);
+ margin-bottom: 12px;
+}
+
+.rm-actions-row {
+ display: flex;
+ gap: 8px;
+ flex-wrap: wrap;
+ margin-bottom: 4px;
+}
+
+.btn-sm {
+ font-size: 0.75rem;
+ padding: 5px 10px;
+}
+
+.btn[disabled] {
+ opacity: 0.45;
+ cursor: not-allowed;
+}
+
+.rm-step-note {
+ font-size: 0.75rem;
+ color: var(--rm-text-muted);
+ margin-top: 8px;
+}
+
+/* ==========================================================================
+ OPTION A — left rail + right detail/console
+ ========================================================================== */
+
+.rm-rail-layout {
+ display: flex;
+ align-items: flex-start;
+ gap: 16px;
+ max-width: 1180px;
+ margin: 0 auto;
+}
+
+.rm-rail-col {
+ flex: 0 0 340px;
+ background: var(--rm-white);
+ border: 1px solid var(--rm-border);
+ border-radius: var(--rm-radius);
+ overflow: hidden;
+ max-height: 640px;
+ overflow-y: auto;
+}
+
+.rm-rail-item {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ padding: 9px 12px;
+ border-bottom: 1px solid var(--rm-border);
+ cursor: pointer;
+}
+
+.rm-rail-item:last-child { border-bottom: none; }
+.rm-rail-item:hover { background: var(--rm-accent-wash); }
+
+.rm-rail-item.selected {
+ background: var(--rm-accent-wash);
+ box-shadow: inset 3px 0 0 var(--rm-accent);
+}
+
+.rm-rail-num {
+ flex: 0 0 auto;
+ width: 18px;
+ text-align: right;
+ font-size: 0.6875rem;
+ color: var(--rm-text-muted);
+}
+
+.rm-rail-name {
+ flex: 1 1 auto;
+ min-width: 0;
+ font-size: 0.8125rem;
+ font-weight: 600;
+ color: var(--rm-text);
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.rm-rail-item .tag { flex: 0 0 auto; }
+
+.rm-detail-col {
+ flex: 1 1 auto;
+ min-width: 0;
+ background: var(--rm-white);
+ border: 1px solid var(--rm-border);
+ border-radius: var(--rm-radius);
+ padding: 18px 20px;
+}
+
+/* ==========================================================================
+ OPTION B — vertical stepper / accordion
+ ========================================================================== */
+
+.rm-stepper {
+ max-width: 1180px;
+ margin: 0 auto;
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+}
+
+.rm-step-row {
+ background: var(--rm-white);
+ border: 1px solid var(--rm-border);
+ border-radius: var(--rm-radius);
+ overflow: hidden;
+}
+
+.rm-step-row-head {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ padding: 11px 16px;
+ cursor: pointer;
+}
+
+.rm-step-row-head:hover { background: var(--rm-accent-wash); }
+
+.rm-step-row.expanded .rm-step-row-head {
+ border-bottom: 1px solid var(--rm-border);
+ background: var(--rm-accent-wash);
+}
+
+.rm-step-chevron {
+ flex: 0 0 auto;
+ display: inline-block;
+ width: 16px;
+ height: 16px;
+ border-radius: 50%;
+ border: 1px solid var(--rm-border-2);
+ color: var(--rm-text-muted-2);
+ font-size: 10px;
+ line-height: 15px;
+ text-align: center;
+ transition: transform 0.15s ease;
+}
+
+.rm-step-row.expanded .rm-step-chevron { transform: rotate(90deg); }
+
+.rm-step-row-num {
+ flex: 0 0 auto;
+ width: 20px;
+ text-align: right;
+ font-size: 0.75rem;
+ color: var(--rm-text-muted);
+}
+
+.rm-step-row-name {
+ flex: 1 1 auto;
+ min-width: 0;
+ font-size: 0.8438rem;
+ font-weight: 600;
+ color: var(--rm-text);
+}
+
+.rm-step-row-body {
+ display: none;
+ padding: 14px 18px 18px 48px;
+}
+
+.rm-step-row.expanded .rm-step-row-body { display: block; }
+
+/* ==========================================================================
+ OPTION C — DataTable with expandable console rows
+ ========================================================================== */
+
+.rm-table td.step-num-cell {
+ color: var(--rm-text-muted-2);
+ width: 32px;
+}
+
+.rm-table td.step-name-cell {
+ font-weight: 600;
+ color: var(--rm-text);
+}
+
+.rm-table .step-actions-cell {
+ white-space: nowrap;
+ text-align: right;
+}
+
+.rm-table .step-actions-cell .btn { margin-left: 6px; }
+
+tr.step-detail-row td {
+ background: var(--rm-card-bg);
+ padding: 14px 18px;
+}
+
+/* ==========================================================================
+ Real-app additions — classes the wired new-release.ftlh/new-release.js use
+ that the static mockup above didn't need (start form, empty-detail hint,
+ the mutating-step marker tag). Follows the mockup's existing conventions
+ rather than introducing a parallel style system.
+ ========================================================================== */
+
+/* Generic form row for the "start a run" card (the mockup never showed this
+ state) — same look as .cred .row in chrome.css, just not scoped to .cred. */
+.row {
+ display: flex;
+ gap: 8px;
+ margin-top: 8px;
+ align-items: center;
+ flex-wrap: wrap;
+}
+
+.row input {
+ font-family: var(--rm-font);
+ font-size: 0.8125rem;
+ padding: 6px 10px;
+ border: 1px solid var(--rm-border-2);
+ border-radius: var(--rm-radius);
+ background: var(--rm-white);
+ color: var(--rm-text);
+}
+
+.hint {
+ font-size: 0.8125rem;
+ color: var(--rm-text-muted);
+ font-style: italic;
+}
+
+/* Marks a step whose apply() mutates remote state (spec §3.8), slotted into
+ the same amber domain chrome.css already uses for "pending"/in-progress. */
+.tag.mutating {
+ background: var(--rm-tag-amber-bg);
+ color: var(--rm-tag-amber-text);
+ border-color: var(--rm-tag-amber-border);
+}
+
+/* new-release.js renders the console into a <pre>, not the mockup's <div> —
+ reset the browser default block margin so .rm-console's own padding governs spacing. */
+pre.rm-console {
+ margin: 0;
+}
+
+/* A review-gate step held after its read-only work ran — reuses the same paused affordance as the
+ vote gate, since both are "done its work, awaiting a human". */
+.tag.status.awaiting-review {
+ background: var(--rm-tag-blue-bg);
+ color: var(--rm-tag-blue-text);
+ border-color: var(--rm-tag-blue-border);
+}
+
+.tag.status.awaiting-review::before { content: '\23F8'; margin-right: 3px; font-size: 9px; }
+
+/* ==========================================================================
+ Slice 3: run-level execution-mode banner + arming affordance.
+ ========================================================================== */
+
+.rm-mode-banner {
+ max-width: 1180px;
+ margin: 0 auto 16px;
+ padding: 10px 14px;
+ border: 1px solid var(--rm-tag-neutral-border);
+ border-radius: 8px;
+ font-size: 13px;
+ color: var(--rm-muted);
+ display: flex;
+ align-items: center;
+ gap: 10px;
+}
+
+.rm-mode-banner.safe { background: var(--rm-tag-green-bg); border-color: var(--rm-tag-green-border); }
+.rm-mode-banner.live { background: #fdeceb; border-color: #f3c6c2; }
+
+.rm-mode-chip {
+ display: inline-flex;
+ align-items: center;
+ font-weight: 800;
+ font-size: 11px;
+ letter-spacing: 0.06em;
+ padding: 2px 8px;
+ border-radius: 999px;
+ border: 1px solid transparent;
+}
+
+.rm-mode-chip.safe { background: var(--rm-tag-green-bg); color: var(--rm-tag-green-text); border-color: var(--rm-tag-green-border); }
+.rm-mode-chip.live { background: #fdeceb; color: var(--rm-danger); border-color: #f3c6c2; }
+
+/* The run is armed for live mutation (LIVE only). */
+.tag.armed {
+ background: #fdeceb;
+ color: var(--rm-danger);
+ border-color: #f3c6c2;
+ font-weight: 700;
+}
+
+/* "Arm this run" — a deliberately cautionary amber action distinct from the primary/danger buttons. */
+.btn-warning {
+ background: var(--rm-tag-amber-bg);
+ color: var(--rm-tag-amber-text);
+ border: 1px solid var(--rm-tag-amber-border);
+}
+
+.btn-warning:hover { filter: brightness(0.97); }
diff --git a/src/main/resources/static/datatables/dataTables.dataTables.min.css b/src/main/resources/static/datatables/dataTables.dataTables.min.css
new file mode 100644
index 0000000000..a16238fe78
--- /dev/null
+++ b/src/main/resources/static/datatables/dataTables.dataTables.min.css
@@ -0,0 +1 @@
+:root{--dt-row-selected: 13, 110, 253;--dt-row-selected-text: 255, 255, 255;--dt-row-selected-link: 9, 10, 11;--dt-row-stripe: 0, 0, 0;--dt-row-hover: 0, 0, 0;--dt-column-ordering: 0, 0, 0;--dt-html-background: white}:root.dark{--dt-html-background: rgb(33, 37, 41)}table.dataTable td.dt-control{text-align:center;cursor:pointer}table.dataTable td.dt-control:before{display:inline-block;box-sizing:border-box;content:"";border-top:5px solid transparent;border-left:10px solid rgba(0, 0, 0, 0. [...]
diff --git a/src/main/resources/static/datatables/dataTables.min.js b/src/main/resources/static/datatables/dataTables.min.js
new file mode 100644
index 0000000000..7ef0c676ec
--- /dev/null
+++ b/src/main/resources/static/datatables/dataTables.min.js
@@ -0,0 +1,4 @@
+/*! DataTables 2.1.8
+ * © SpryMedia Ltd - datatables.net/license
+ */
+!function(n){"use strict";var a;"function"==typeof define&&define.amd?define(["jquery"],function(t){return n(t,window,document)}):"object"==typeof exports?(a=require("jquery"),"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||a(t),n(e,t,t.document)}:module.exports=n(a,window,window.document)):window.DataTable=n(jQuery,window,document)}(function(H,W,_){"use strict";function f(t){var e=parseInt(t,10);return!isNaN(e)&&isFinite(t)?e:null}function s(t,e,n,a){var [...]
\ No newline at end of file
diff --git a/src/main/resources/static/datatables/jquery.min.js b/src/main/resources/static/datatables/jquery.min.js
new file mode 100644
index 0000000000..7f37b5d991
--- /dev/null
+++ b/src/main/resources/static/datatables/jquery.min.js
@@ -0,0 +1,2 @@
+/*! jQuery v3.7.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */
+!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(ie,e){"use strict";var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue [...]
diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html
new file mode 100644
index 0000000000..afd0fc96f1
--- /dev/null
+++ b/src/main/resources/static/index.html
@@ -0,0 +1,28 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>Apache Juneau Release Manager</title>
+ <script>location.replace('/rest/home');</script>
+</head>
+<body>
+ <noscript>Redirecting to <a href="/rest/home">the Release Manager</a>…</noscript>
+</body>
+</html>
diff --git a/src/main/resources/static/js/credentials.js b/src/main/resources/static/js/credentials.js
new file mode 100644
index 0000000000..12e805065b
--- /dev/null
+++ b/src/main/resources/static/js/credentials.js
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+async function rmSet(name, btn) {
+ const card = btn.closest('.cred');
+ const acctEl = card.querySelector('.acct');
+ const body = { account: acctEl ? acctEl.value : null, secret: card.querySelector('.secret').value };
+ const r = await fetch('/rest/credentials/' + name, {
+ method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body)
+ });
+ if (r.ok) { card.querySelector('.secret').value = ''; location.reload(); }
+ else { card.querySelector('.msg').textContent = 'Save failed'; }
+}
+
+async function rmValidate(name, btn) {
+ const card = btn.closest('.cred');
+ card.querySelector('.msg').textContent = 'Validating…';
+ const r = await fetch('/rest/credentials/' + name + '/validate', { method: 'POST' });
+ const res = await r.json();
+ card.querySelector('.msg').textContent = res.message;
+ const pill = card.querySelector('.pill');
+ pill.className = 'pill ' + (res.valid ? 'valid' : 'invalid');
+ pill.textContent = res.valid ? 'Valid' : 'Invalid';
+}
diff --git a/src/main/resources/static/js/new-release.js b/src/main/resources/static/js/new-release.js
new file mode 100644
index 0000000000..9948fde574
--- /dev/null
+++ b/src/main/resources/static/js/new-release.js
@@ -0,0 +1,175 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+(function () {
+ // Defined unconditionally so the start form (rendered when `run` is null, before `.rm-rail-layout`
+ // exists) always has it available.
+ globalThis.nrStart = async function () {
+ const v = document.getElementById('nr-version').value;
+ const dev = document.getElementById('nr-devversion').value;
+ const msEl = document.getElementById('nr-milestone');
+ const ms = msEl && msEl.value ? Number(msEl.value) : null;
+ await fetch('/rest/runs', {
+ method: 'POST', headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({ version: v, developmentVersion: dev, milestoneNumber: ms })
+ });
+ location.reload();
+ };
+
+ // §8.1: auto-resolve the milestone number by version-title match as soon as the operator finishes typing
+ // the version, so the New-Release form field arrives pre-filled (still user-overridable before Start).
+ const nrVersionInput = document.getElementById('nr-version');
+ if (nrVersionInput) {
+ nrVersionInput.addEventListener('blur', async () => {
+ const v = nrVersionInput.value.trim();
+ const msEl = document.getElementById('nr-milestone');
+ if (!v || !msEl || msEl.value) return; // don't clobber an already-filled/overridden value
+ try {
+ const r = await fetch('/rest/milestones/' + encodeURIComponent(v) + '/resolve');
+ const data = await r.json();
+ if (data && data.milestoneNumber != null) msEl.value = data.milestoneNumber;
+ } catch (e) {
+ // Best-effort pre-fill only; the operator can still type the milestone number manually.
+ }
+ });
+ }
+
+ const layout = document.querySelector('.rm-rail-layout');
+ if (!layout) return; // start form only; no active run yet
+
+ const version = layout.dataset.version;
+ const rc = layout.dataset.rc;
+ const mode = layout.dataset.mode || 'SAFE';
+ const metaEl = document.getElementById('nr-step-meta');
+ const STEP_META = metaEl ? JSON.parse(metaEl.textContent) : {};
+
+ // The apply affordance is mode-derived: SAFE simulates (command-log, no side effects), LIVE mutates.
+ const runLabel = mode === 'LIVE' ? 'Run (LIVE)' : 'Simulate (SAFE)';
+
+ // Exactly one EventSource at a time (spec §4/§7: one console visible at a time). Switching the selected
+ // step closes the old connection and opens a new one against that step's own /events/{version}/{stepId}.
+ let es = null;
+
+ function statusOf(stepId) {
+ const el = layout.querySelector('.rm-rail-item[data-step="' + stepId + '"]');
+ if (!el) return 'pending';
+ for (const c of el.classList) {
+ if (c !== 'rm-rail-item' && c !== 'selected') return c;
+ }
+ return 'pending';
+ }
+
+ // Mirrors the mockup's renderActions(step): button set is entirely a function of current status
+ // (spec §3 decisions #11/#12 — every button below is the SAME preview/apply call regardless of status).
+ function renderActions(stepId, status) {
+ const dryRun = '<button class="btn btn-outline btn-sm" onclick="nrDryRun(\'' + stepId + '\')">Dry-run</button>';
+ if (status === 'running')
+ return '<button class="btn btn-outline btn-sm" disabled>Dry-run</button> <button class="btn btn-primary btn-sm" disabled>Running…</button>';
+ if (status === 'failed')
+ return dryRun + ' <button class="btn btn-primary btn-sm" onclick="nrApply(\'' + stepId + '\')">Resume</button>';
+ if (status === 'awaiting-vote')
+ return '<span class="rm-step-note">Pipeline is paused pending the vote outcome. Use any step\u2019s own controls to re-check it individually while you wait.</span>';
+ if (status === 'awaiting-review')
+ return dryRun + ' <button class="btn btn-primary btn-sm" onclick="nrConfirmReview(\'' + stepId + '\')">Confirm review</button>';
+ if (status === 'succeeded')
+ return dryRun + ' <button class="btn btn-outline btn-sm" onclick="nrApply(\'' + stepId + '\')">Re-run</button>';
+ if (status === 'skipped')
+ return dryRun + ' <button class="btn btn-outline btn-sm" onclick="nrApply(\'' + stepId + '\')">Run anyway</button>';
+ return dryRun + ' <button class="btn btn-primary btn-sm" onclick="nrApply(\'' + stepId + '\')">' + runLabel + '</button>';
+ }
+
+ function connectConsole(stepId) {
+ if (es) es.close();
+ const consoleEl = document.getElementById('nr-console');
+ if (!consoleEl) return;
+ consoleEl.textContent = '';
+ // Replay-then-tail, scoped to this one step (SseLogServlet, Task 8).
+ es = new EventSource('/events/' + encodeURIComponent(version) + '/' + encodeURIComponent(stepId));
+ es.onmessage = (e) => { consoleEl.textContent += e.data + '\n'; consoleEl.scrollTop = consoleEl.scrollHeight; };
+ }
+
+ globalThis.nrSelect = function (stepId) {
+ layout.querySelectorAll('.rm-rail-item').forEach((el) => el.classList.toggle('selected', el.dataset.step === stepId));
+ const meta = STEP_META[stepId] || { title: stepId, mutating: false };
+ const status = statusOf(stepId);
+ document.getElementById('nr-detail').innerHTML =
+ '<div class="rm-step-title-row"><h3>' + meta.title + '</h3>' +
+ '<span class="tag status ' + status + '">' + status + '</span>' +
+ (meta.mutating ? ' <span class="tag mutating">mutating</span>' : '') + '</div>' +
+ '<div class="rm-actions-row" id="nr-actions">' + renderActions(stepId, status) + '</div>' +
+ '<div class="rm-console-label"><span>Console output — this step only</span></div>' +
+ '<pre id="nr-console" class="rm-console"></pre>';
+ connectConsole(stepId);
+ };
+
+ async function post(path, body) {
+ const r = await fetch('/rest/runs/' + version + path, {
+ method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body || {})
+ });
+ return r.json();
+ }
+
+ globalThis.nrDryRun = async function (stepId) {
+ const p = await post('/steps/' + stepId + '/preview', {});
+ // MVP surfacing of preview text; a richer inline preview panel (vs. this alert) is a fast follow, not
+ // required for the pipeline itself to work correctly.
+ alert((p.lines || []).join('\n'));
+ };
+
+ globalThis.nrApply = async function (stepId) {
+ // Steps needing inputs (developmentVersion, confirmVersion, voteOutcome, repoIdOverride, checklist) read here.
+ const form = {};
+ const dv = document.getElementById('nr-devversion');
+ if (dv?.value) form.developmentVersion = dv.value;
+ if (stepId === 'nexus-release') form.confirmVersion = prompt('Type the version to confirm release');
+ // Same call whether the button said Run / Resume / Re-run (spec decision #11/#12) — hits /apply, not
+ // /resume, for all three; /resume (Task 19) remains available as an equivalent alias.
+ await post('/steps/' + stepId + '/apply', form);
+ location.reload();
+ };
+
+ globalThis.nrArm = async function () {
+ const confirm = prompt('Type "' + version + ' LIVE" to arm this run for live mutation');
+ if (!confirm) return;
+ const res = await post('/arm', { confirm });
+ if (res && res.message) alert(res.message);
+ location.reload();
+ };
+
+ globalThis.nrConfirmReview = async function (stepId) {
+ await post('/steps/' + stepId + '/confirm-review', {});
+ location.reload();
+ };
+
+ globalThis.nrDropRc = async function () {
+ const preview = await post('/drop-rc/preview', {});
+ if (!confirm((preview.lines || []).join('\n'))) return;
+ const confirmRc = prompt('Type the RC identifier to confirm (e.g. RC' + rc + ')');
+ await post('/drop-rc/apply', { reason: 'vote rejected', confirmRc });
+ location.reload();
+ };
+
+ // Default selection on load: the running step is most informative (mirrors option-a-rail.html's mockup
+ // default); else the first failed step; else the first pending step; else the last (terminal) step.
+ const initial = layout.querySelector('.rm-rail-item.running')
+ || layout.querySelector('.rm-rail-item.failed')
+ || layout.querySelector('.rm-rail-item.pending');
+ const all = layout.querySelectorAll('.rm-rail-item');
+ const fallback = all.length ? all[all.length - 1] : null;
+ const toSelect = initial || fallback;
+ if (toSelect) nrSelect(toSelect.dataset.step);
+})();
diff --git a/src/main/resources/static/js/releases.js b/src/main/resources/static/js/releases.js
new file mode 100644
index 0000000000..919311ddb8
--- /dev/null
+++ b/src/main/resources/static/js/releases.js
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+document.addEventListener('DOMContentLoaded', function () {
+ if (globalThis.jQuery && document.getElementById('releases')) {
+ jQuery('#releases').DataTable({
+ order: [[0, 'desc']],
+ pageLength: 25,
+ columnDefs: [{ orderable: false, targets: 6 }]
+ });
+ }
+});
diff --git a/src/main/resources/templates/base.ftlh b/src/main/resources/templates/base.ftlh
new file mode 100644
index 0000000000..91a90aea7c
--- /dev/null
+++ b/src/main/resources/templates/base.ftlh
@@ -0,0 +1,71 @@
+<#--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>Apache Juneau · Release Manager</title>
+ <#if activeTab?? && activeTab == 'releases'>
+ <link rel="stylesheet" href="/datatables/dataTables.dataTables.min.css">
+ </#if>
+ <link rel="stylesheet" href="/css/chrome.css">
+</head>
+<body>
+ <header class="rm-header">
+ <div class="rm-brand">
+ <div class="rm-brand-mark" role="img" aria-label="Apache Juneau"></div>
+ <div class="rm-brand-title">Apache Juneau <span class="rm-brand-sep">·</span> Release Manager</div>
+ </div>
+ <div class="rm-header-actions">
+ <button class="rm-icon-btn" title="Help" aria-label="Help">
+ <svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="9" fill="none" stroke="currentColor" stroke-width="2"/><text x="12" y="16.5" text-anchor="middle" font-size="11" font-weight="700" fill="currentColor">?</text></svg>
+ </button>
+ <div class="rm-avatar" title="Release Manager">RM</div>
+ </div>
+ </header>
+
+ <#-- Primary nav: real tabs, each pointing at its actual /rest/* route.
+ Active tab is driven by the `activeTab` attribute each page template
+ assigns before including this layout — no hardcoded per-page string
+ compares here. -->
+ <nav class="nav">
+ <a class="nav-tab<#if activeTab?? && activeTab == 'home'> active</#if>" href="/rest/home">Home</a>
+ <a class="nav-tab<#if activeTab?? && activeTab == 'credentials'> active</#if>" href="/rest/credentials">Credentials</a>
+ <a class="nav-tab<#if activeTab?? && activeTab == 'releases'> active</#if>" href="/rest/releases">Releases</a>
+ <a class="nav-tab<#if activeTab?? && activeTab == 'new'> active</#if>" href="/rest/runs">New Release</a>
+ </nav>
+
+ <main class="rm-main">
+ <#-- child templates define the "content" macro, then <#include> this layout -->
+ <@content/>
+ </main>
+
+ <#if activeTab?? && activeTab == 'releases'>
+ <script src="/datatables/jquery.min.js"></script>
+ <script src="/datatables/dataTables.min.js"></script>
+ <script src="/js/releases.js"></script>
+ </#if>
+ <#if activeTab?? && activeTab == 'credentials'>
+ <script src="/js/credentials.js"></script>
+ </#if>
+ <#if activeTab?? && activeTab == 'new'>
+ <link rel="stylesheet" href="/css/new-release.css">
+ <script src="/js/new-release.js"></script>
+ </#if>
+</body>
+</html>
diff --git a/src/main/resources/templates/credentials.ftlh b/src/main/resources/templates/credentials.ftlh
new file mode 100644
index 0000000000..c4898d8ec2
--- /dev/null
+++ b/src/main/resources/templates/credentials.ftlh
@@ -0,0 +1,41 @@
+<#--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<#assign activeTab = "credentials">
+<#macro content>
+ <div class="rm-card">
+ <#list credentials as c>
+ <div class="cred" data-name="${c.name}">
+ <h3>${c.label}
+ <span class="pill ${c.present?string(c.lastValid!false?string('valid','invalid'),'unset')}">
+ <#if !c.present>Not set<#elseif c.lastValid??>${c.lastValid?string('Valid','Invalid')}<#else>Set (unvalidated)</#if>
+ </span>
+ </h3>
+ <div class="row">
+ <#if c.name != 'github'>
+ <input type="text" class="acct" placeholder="<#if c.name=='apache'>Apache availid<#else>GPG key ID</#if>">
+ </#if>
+ <input type="password" class="secret" placeholder="<#if c.name=='apache'>password<#elseif c.name=='gpg'>passphrase<#else>token</#if>">
+ <button class="btn btn-primary" onclick="rmSet('${c.name}', this)">Save</button>
+ <button class="btn btn-outline" onclick="rmValidate('${c.name}', this)">Validate</button>
+ </div>
+ <div class="msg">${c.lastMessage!''}</div>
+ </div>
+ </#list>
+ </div>
+</#macro>
+<#include "base.ftlh">
diff --git a/src/main/resources/templates/home.ftlh b/src/main/resources/templates/home.ftlh
new file mode 100644
index 0000000000..631075926d
--- /dev/null
+++ b/src/main/resources/templates/home.ftlh
@@ -0,0 +1,42 @@
+<#--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<#assign activeTab = "home">
+<#macro content>
+ <div class="rm-card">
+ <div class="rm-card-header">
+ <h2>Workflow</h2>
+ </div>
+ <ol class="rm-home-steps">
+ <li><strong><a href="/rest/credentials">Credentials</a></strong> — configure and validate your Apache LDAP password, GPG signing key, and GitHub token first. Everything else depends on these being set up correctly.</li>
+ <li><strong><a href="/rest/releases">Releases</a></strong> — review past and existing releases and their current status.</li>
+ <li><strong><a href="/rest/releases#new">New Release</a></strong> — start and drive a new release through its steps.</li>
+ </ol>
+ </div>
+
+ <div class="rm-card">
+ <div class="rm-card-header">
+ <h2>Prerequisites</h2>
+ </div>
+ <ul class="rm-home-prereqs">
+ <li>A local checkout of <code>apache/juneau</code>.</li>
+ <li><code>mvn</code>, <code>git</code>, <code>gh</code>, and <code>gpg</code> available on your <code>PATH</code>.</li>
+ <li>Valid <code>apache.releases.https</code> credentials in <code>~/.m2/settings.xml</code>.</li>
+ </ul>
+ </div>
+</#macro>
+<#include "base.ftlh">
diff --git a/src/main/resources/templates/new-release.ftlh b/src/main/resources/templates/new-release.ftlh
new file mode 100644
index 0000000000..9b31ea0fdf
--- /dev/null
+++ b/src/main/resources/templates/new-release.ftlh
@@ -0,0 +1,91 @@
+<#--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<#assign activeTab = "new">
+<#macro content>
+ <#assign modeLc = (mode!'SAFE')?lower_case>
+ <div class="rm-mode-banner ${modeLc}" data-mode="${mode!'SAFE'}">
+ <span class="rm-mode-chip ${modeLc}">${mode!'SAFE'}</span>
+ <#if (mode!'SAFE') == 'SAFE'>
+ Simulate mode — every mutation is command-logged with zero side effects, and Nexus staging is routed to the in-app loopback mock.
+ <#else>
+ Live mode — mutations hit real endpoints. Each run must be individually armed before it can mutate.
+ </#if>
+ </div>
+ <#if !(run??)>
+ <div class="rm-card">
+ <h2>Start a run</h2>
+ <div class="row">
+ <input id="nr-version" type="text" placeholder="version (e.g. 9.2.1)">
+ <input id="nr-devversion" type="text" placeholder="developmentVersion (required if x.y.0)">
+ <input id="nr-milestone" type="number" placeholder="milestone # (auto-resolved from version)">
+ <button class="btn btn-primary" onclick="nrStart()">Start</button>
+ </div>
+ </div>
+ <#else>
+ <div class="rm-run-header">
+ <div class="rm-run-header-top">
+ <div class="rm-run-title-group">
+ <h2 class="rm-run-title">${run.version} · RC${run.rc}</h2>
+ <span class="tag status ${run.status?lower_case?replace('_','-')}">${run.status}</span>
+ </div>
+ <div class="rm-run-actions">
+ <#if (mode!'SAFE') == 'LIVE'>
+ <#if armed!false>
+ <span class="tag armed" title="This run is armed for live mutation">ARMED</span>
+ <#else>
+ <button class="btn btn-warning" onclick="nrArm()">Arm this run</button>
+ </#if>
+ </#if>
+ <button class="btn btn-danger" onclick="nrDropRc()">Drop RC</button>
+ </div>
+ </div>
+ <div class="rm-run-meta" style="margin-top:10px;">
+ <span class="rm-meta-chip">Branch <b>${run.branch}</b></span>
+ <#if run.milestoneNumber??><span class="rm-meta-chip">Milestone <b>#${run.milestoneNumber}</b></span></#if>
+ </div>
+ </div>
+
+ <!-- Left column is the step list; right column shows the selected step's detail and console. -->
+ <div class="rm-rail-layout" data-version="${run.version}" data-rc="${run.rc}" data-mode="${mode!'SAFE'}" data-armed="${(armed!false)?c}">
+ <div class="rm-rail-col" id="nr-rail">
+ <#list run.steps as s>
+ <div class="rm-rail-item ${s.status?lower_case?replace('_','-')}" data-step="${s.id}"
+ onclick="nrSelect('${s.id}')">
+ <span class="rm-rail-num">${s?index + 1}</span>
+ <span class="rm-rail-name">${s.id}</span>
+ <span class="tag status ${s.status?lower_case?replace('_','-')}">${s.status}</span>
+ </div>
+ </#list>
+ </div>
+ <!-- Populated by nrSelect() in new-release.js — shows exactly one step's detail and console at a time. -->
+ <div class="rm-detail-col" id="nr-detail">
+ <p class="hint">Select a step to preview and run it.</p>
+ </div>
+ </div>
+
+ <!-- Step id -> {title, mutating} from the StepRegistry (page()'s "steps" attr, Task 19), for the
+ detail pane's title/mutating-tag rendering. Not RunState — that's already inline above. -->
+ <script id="nr-step-meta" type="application/json">
+ {
+ <#list steps as reg>"${reg.id()}": {"title": "${reg.title()}", "mutating": ${reg.mutating()?c}}<#if reg?has_next>,</#if>
+ </#list>
+ }
+ </script>
+ </#if>
+</#macro>
+<#include "base.ftlh">
diff --git a/src/main/resources/templates/releases.ftlh b/src/main/resources/templates/releases.ftlh
new file mode 100644
index 0000000000..e42ce5c28d
--- /dev/null
+++ b/src/main/resources/templates/releases.ftlh
@@ -0,0 +1,59 @@
+<#--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<#assign activeTab = "releases">
+<#macro content>
+ <div class="rm-card">
+ <div class="rm-card-header">
+ <h2>All Releases</h2>
+ </div>
+
+ <div class="rm-table-scroll">
+ <table id="releases" class="rm-table">
+ <thead>
+ <tr>
+ <th>Version</th><th>RC</th><th>Status</th><th>Stage</th>
+ <th>Vote closes</th><th>Released</th><th>Links</th>
+ </tr>
+ </thead>
+ <tbody>
+ <#list releases as r>
+ <tr>
+ <td class="version-cell">${r.version!'—'}</td>
+ <td class="rc-cell">${r.rc!'—'}</td>
+ <td><span class="tag status ${(r.status!'UNKNOWN')?lower_case}">${r.status!'—'}</span></td>
+ <td>
+ <#if !(r.stage??) || r.stage == '—'>
+ —
+ <#else>
+ <span class="tag stage ${r.stage?lower_case?replace(' ', '-')}">${r.stage}</span>
+ </#if>
+ </td>
+ <td>${r.voteCloses!'—'}</td>
+ <td>${r.released!'—'}</td>
+ <td class="links-cell">
+ <#if r.githubReleaseUrl??><a href="${r.githubReleaseUrl}">GitHub</a></#if>
+ <#if r.milestoneUrl??><a href="${r.milestoneUrl}">Milestone</a></#if>
+ </td>
+ </tr>
+ </#list>
+ </tbody>
+ </table>
+ </div>
+ </div>
+</#macro>
+<#include "base.ftlh">
diff --git a/src/test/java/org/apache/juneau/releng/AppConfigurationTest.java b/src/test/java/org/apache/juneau/releng/AppConfigurationTest.java
new file mode 100644
index 0000000000..0d40843ab2
--- /dev/null
+++ b/src/test/java/org/apache/juneau/releng/AppConfigurationTest.java
@@ -0,0 +1,134 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juneau.releng;
+
+import static org.junit.jupiter.api.Assertions.*;
+import java.nio.file.Path;
+import java.util.List;
+import java.util.Map;
+import org.apache.juneau.releng.config.TargetProfile;
+import org.apache.juneau.releng.engine.BranchResolver;
+import org.apache.juneau.releng.engine.ReleaseEngine;
+import org.apache.juneau.releng.engine.RunStateStore;
+import org.apache.juneau.releng.engine.StepRegistry;
+import org.apache.juneau.releng.nexus.NexusStagingClient;
+import org.apache.juneau.releng.util.ProcessRunner;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
+
+class AppConfigurationTest {
+
+ private ProcessRunner okRunner() {
+ return new ProcessRunner() {
+ @Override
+ public List<String> runLines(List<String> c) {
+ return List.of();
+ }
+
+ @Override
+ public String runText(List<String> c) {
+ return "";
+ }
+
+ @Override
+ public ProcResult run(List<String> c, String s, Map<String, String> e) {
+ if (c.contains("ls-remote"))
+ return new ProcResult(0, "sha\trefs/heads/juneau-9.2.1-branch\n");
+ return new ProcResult(0, "ok");
+ }
+
+ @Override
+ public ProcResult run(List<String> c, String s, Map<String, String> e,
+ java.util.function.Consumer<String> k) {
+ return run(c, s, e);
+ }
+ };
+ }
+
+ private ReleaseEngine engine(Path dir) {
+ var runner = okRunner();
+ var branches = new BranchResolver(runner, "/repo");
+ return ReleaseEngine.forTests(new RunStateStore(dir), StepRegistry.standard(branches), runner, branches, dir);
+ }
+
+ @Test
+ void broadcasterResolverIsEmptyForUnknownVersionAndStep(@TempDir Path dir) {
+ var store = new RunStateStore(dir);
+ var eng = engine(dir);
+ var resolver = AppConfiguration.broadcasterForStep(eng, store);
+ assertTrue(resolver.apply("nope", "nope").isEmpty());
+ }
+
+ @Test
... 3762 lines suppressed ...