Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
22412f7
ci(mirror_cspu): add dynamic branch mirroring via GitHub API
andrew-m-leonard Aug 24, 2026
b7ae7c7
ci(mirror_cspu): expand post-build handlers with all pipeline states
andrew-m-leonard Aug 24, 2026
b3b5b8e
ci(mirror_cspu): filter branches by 3-month staleness threshold via API
andrew-m-leonard Aug 25, 2026
238d7c2
ci(mirror_cspu): remove static JDK_VERSION and ADOPTIUM_MIRROR_REPO p…
andrew-m-leonard Aug 25, 2026
490a4db
fix(mirror_cspu): use java.time.Instant for ISO-8601 date parsing
andrew-m-leonard Aug 25, 2026
5f8b66b
fix(mirror_cspu): replace epoch millis comparison with Instant for st…
andrew-m-leonard Aug 25, 2026
16581ca
fix(mirror_cspu): replace java.time.Instant with shell date for sandb…
andrew-m-leonard Aug 25, 2026
243e513
fix(mirror_cspu): fetch skara remote before branch checkout to ensure…
andrew-m-leonard Aug 25, 2026
2b54520
ci(mirror_cspu): add clean mirror workspace stage with conditional param
andrew-m-leonard Aug 25, 2026
9fd6c90
fix(mirror_cspu): skip reset when origin branch does not exist yet
andrew-m-leonard Aug 25, 2026
62ea72c
refactor(mirror_cspu): replace GitHub API calls with git ls-remote an…
andrew-m-leonard Aug 25, 2026
69d7158
Remove redundent ppc64le jdk8u patches
andrew-m-leonard Aug 25, 2026
9555a4c
fix(mirror_cspu): apply repo patches and handle missing dev branch
andrew-m-leonard Aug 26, 2026
ed684f6
chore(mirror_cspu): add alpine-jdk8u patches and musl libc support
andrew-m-leonard Aug 26, 2026
7b84fb4
chore(mirror_cspu): consolidate alpine musl libc support patch
andrew-m-leonard Aug 26, 2026
6372489
chore(mirror_cspu): add actions branch ignore patch for jdk21u
andrew-m-leonard Aug 26, 2026
23af0a6
fix(mirror_cspu): tag new release branch base with _adopt after patching
andrew-m-leonard Aug 26, 2026
fcf6725
chore(mirror_cspu): add aarch32 patches and fix repo name mapping for…
andrew-m-leonard Aug 27, 2026
a9927b6
fix(mirror_cspu): exclude +0 and -b00 fork tags and filter aarch32-on…
andrew-m-leonard Aug 28, 2026
3144e21
refactor(mirror_cspu): replace JDK_VERSION param with SKARA_REPO and …
andrew-m-leonard Aug 28, 2026
b4b10f1
fix(mirror_cspu): include mirror repo in Slack failure message
andrew-m-leonard Aug 28, 2026
0efc4b3
fix(mirror_cspu): skip upstream pr/ branches during mirror sync
andrew-m-leonard Aug 28, 2026
ec12523
Apply suggestions from code review
andrew-m-leonard Aug 28, 2026
69e2c01
chore(mirror_cspu): regenerate generated-configure.sh and remove bund…
andrew-m-leonard Aug 28, 2026
9d416d3
Apply suggestions from code review
andrew-m-leonard Aug 28, 2026
9fb233a
chore(mirror_cspu): update alpine musl libc patch to remove bundled g…
andrew-m-leonard Aug 28, 2026
808fd47
chore(mirror_cspu): add actions ignore branches patch for riscv-port-…
andrew-m-leonard Aug 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
205 changes: 205 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
/*
* 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
*
* https://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.
*/

pipeline {
agent { label 'worker' }

options {
buildDiscarder(logRotator(numToKeepStr: '30'))
}

triggers {
cron('H * * * *')
}

stages {
stage('Validate Parameters') {
steps {
script {
if (!params.SKARA_REPO?.trim()) {
error('SKARA_REPO parameter is required.')
}
if (!(params.SKARA_REPO ==~ /[A-Za-z0-9._-]+/)) {
error('SKARA_REPO must be a valid GitHub repository name.')
}
}
}
}

stage('Determine Branches') {
steps {
script {
def upstreamRepo = params.SKARA_REPO == 'alpine-jdk8u' ? 'jdk8u' : params.SKARA_REPO
def skaraRepo = "https://github.com/openjdk/${upstreamRepo}"
echo "Upstream SKARA_REPO: ${skaraRepo}"

// Determine default branch via git ls-remote --symref (no API token needed)
def symrefOutput = sh(
script: "git ls-remote --symref '${skaraRepo}' HEAD",
returnStdout: true
).trim()
def defaultBranchMatch = symrefOutput =~ /ref: refs\/heads\/(\S+)\s+HEAD/
if (!defaultBranchMatch) {
error("Could not determine default branch for ${skaraRepo} - git ls-remote --symref output was unexpected:\n${symrefOutput}")
}
def defaultBranch = defaultBranchMatch[0][1]
echo "Default branch: ${defaultBranch}"

// Do a temporary bare clone with --filter=blob:none to get branch refs and
// commit dates without downloading any file content.
def tmpBareClone = "${env.WORKSPACE}/tmp-bare-${params.SKARA_REPO}"
sh "rm -rf '${tmpBareClone}'"
sh "git clone --bare --filter=blob:none '${skaraRepo}' '${tmpBareClone}'"

try {
// Staleness threshold: 90 days ago as unix epoch
def threeMonthsAgoStr = sh(
script: "date -d '90 days ago' +%s",
returnStdout: true
).trim()
if (!threeMonthsAgoStr.isLong()) {
error("Failed to compute staleness threshold: unexpected output: '${threeMonthsAgoStr}'")
}
def threeMonthsAgoEpoch = threeMonthsAgoStr as long

// List all remote branches from the bare clone
def allBranchesRaw = sh(
script: "git -C '${tmpBareClone}' for-each-ref --format='%(refname:short)' refs/heads/",
returnStdout: true
).trim()
if (!allBranchesRaw) {
error("No branches found in ${skaraRepo}")
}

// Filter to active branches by checking last commit date
def branches = [] as Set
for (branch in allBranchesRaw.split('\n')) {
branch = branch.trim()
if (!branch) continue
// Skip upstream PR branches — there can be hundreds and they are not mirrored
if (branch.startsWith('pr/')) continue
def commitEpochStr = withEnv(["BRANCH_TO_CHECK=${branch}"]) {
sh(
script: "git -C '${tmpBareClone}' log -1 --format='%ct' -- \"\$BRANCH_TO_CHECK\"",
returnStdout: true
).trim()
}
if (!commitEpochStr.isLong()) {
error("Could not determine commit date for branch '${branch}': unexpected output: '${commitEpochStr}'")
}
def commitEpoch = commitEpochStr as long
if (commitEpoch >= threeMonthsAgoEpoch) {
echo "Active branch: ${branch} (epoch: ${commitEpoch})"
branches.add(branch)
} else {
echo "Stale branch (skipping): ${branch} (epoch: ${commitEpoch})"
}
}

// Ensure the default branch is always included
branches.add(defaultBranch)

echo "Active branches to mirror: ${branches.join(', ')}"
env.BRANCHES_TO_MIRROR = branches.join(' ')
env.DEFAULT_BRANCH = defaultBranch
} finally {
// Always clean up the temporary bare clone
sh "rm -rf '${tmpBareClone}'"
}
}
}
}

stage('Clean Mirror Workspace') {
when {
expression { return params.CLEAN_MIRROR_WORKSPACE == true }
}
steps {
script {
def workspaceDir = "${env.WORKSPACE}/workspace/${params.SKARA_REPO}"
echo "Cleaning mirror workspace: ${workspaceDir}"
sh "rm -rf '${workspaceDir}'"
}
}
}

stage('Mirror Branches') {
steps {
script {
def mirrorRepoArg = params.ADOPTIUM_MIRROR_REPO?.trim() ?: ''
def branchList = env.BRANCHES_TO_MIRROR.tokenize(' ')

for (branch in branchList) {
echo "--- Mirroring branch: ${branch} ---"
withEnv([
"BRANCH=${branch}",
"SKARA_REPO_ARG=${params.SKARA_REPO}",
"MIRROR_REPO_ARG=${mirrorRepoArg}"
]) {
sh '''
git --version
bash ./skaraMirror.sh "$SKARA_REPO_ARG" "$MIRROR_REPO_ARG"
'''
}
}
}
}
}
}

post {
always {
echo 'Mirror job finished.'
}
success {
echo 'All branches mirrored successfully.'
}
unstable {
echo 'Mirror job completed with an unstable result.'
}
failure {
echo 'Mirror job failed.'
script {
// Only notify Slack during 09:00–11:59 UTC to avoid hourly spam.
def utcHour = sh(script: "date -u +%H", returnStdout: true).trim().toInteger()
if (utcHour >= 9 && utcHour < 12) {
slackSend(
channel: '#build',
color: 'danger',
message: "Skara mirror job *FAILED* for `${params.SKARA_REPO ?: 'unknown'}`" +
(params.ADOPTIUM_MIRROR_REPO?.trim() ? " → `${params.ADOPTIUM_MIRROR_REPO}`" : '') +
" (<${env.BUILD_URL}console|Console>)"
)
} else {
echo "Outside Slack notification window (UTC hour: ${utcHour}) — skipping Slack alert."
}
}
}
aborted {
echo 'Mirror job was aborted.'
}
changed {
echo 'Mirror job result has changed since the last run.'
}
fixed {
echo 'Mirror job is back to success after a previous failure.'
}
regression {
echo 'Mirror job was previously successful but is now failing.'
}
cleanup {
echo 'Mirror job post-processing complete.'
}
}
}
32 changes: 32 additions & 0 deletions patches/aarch32-port-jdk8u/0001-Set-vendor-information.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From a170d74d4b72563fc70f227a6c7d3e64c4146631 Mon Sep 17 00:00:00 2001
From: John Oliver <johno@insightfullogic.com>
Date: Tue, 6 Nov 2018 10:47:15 +0000
Subject: [PATCH] Set vendor information

---
jdk/src/share/native/java/lang/System.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/jdk/src/share/native/java/lang/System.c b/jdk/src/share/native/java/lang/System.c
index 04ef657465..b06a38f87e 100644
--- a/jdk/src/share/native/java/lang/System.c
+++ b/jdk/src/share/native/java/lang/System.c
@@ -110,13 +110,13 @@ Java_java_lang_System_identityHashCode(JNIEnv *env, jobject this, jobject x)

/* Third party may overwrite these values. */
#ifndef VENDOR
-#define VENDOR "Oracle Corporation"
+#define VENDOR "Eclipse Foundation"
#endif
#ifndef VENDOR_URL
-#define VENDOR_URL "http://java.oracle.com/"
+#define VENDOR_URL "https://adoptium.net/"
#endif
#ifndef VENDOR_URL_BUG
-#define VENDOR_URL_BUG "http://bugreport.sun.com/bugreport/"
+#define VENDOR_URL_BUG "https://github.com/adoptium/adoptium-support/issues"
#endif

#define JAVA_MAX_SUPPORTED_VERSION 52
--
2.7.4
24 changes: 24 additions & 0 deletions patches/aarch32-port-jdk8u/actions-ignore-branches.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Adoptium <adoptium-mirrors@eclipse.org>
Date: Mon, 17 Sep 2001 00:00:00 +0000
Subject: [PATCH] skip github actions builds to save executors

---
.github/workflows/submit.yml | 2 ++
1 file changed, 2 insertions(+)

diff --git a/.github/workflows/submit.yml b/.github/workflows/submit.yml
index 72e619aa83..887a20c844 100644
--- a/.github/workflows/submit.yml
+++ b/.github/workflows/submit.yml
@@ -4,6 +4,8 @@ on:
push:
branches-ignore:
- master
+ - dev*
+ - release*
- pr/*
workflow_dispatch:
inputs:
--
2.39.0
91 changes: 91 additions & 0 deletions patches/aarch32-port-jdk8u/company_name.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
From fe098d6310075681475ffece69faf1e8e715b5e9 Mon Sep 17 00:00:00 2001
From: John Oliver <johno@insightfullogic.com>
Date: Thu, 30 Aug 2018 14:22:52 +0100
Subject: [PATCH] Allow setting company name

---
common/autoconf/jdk-options.m4 | 11 +++++++++++
jdk/make/gensrc/GensrcMisc.gmk | 6 ++++++
jdk/src/share/classes/sun/misc/Version.java.template | 7 +++++--
3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/common/autoconf/jdk-options.m4 b/common/autoconf/jdk-options.m4
index 18ba585209..ae9d5308f4 100644
--- a/common/autoconf/jdk-options.m4
+++ b/common/autoconf/jdk-options.m4
@@ -539,6 +539,17 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS],
AC_SUBST(MACOSX_BUNDLE_NAME_BASE)
AC_SUBST(MACOSX_BUNDLE_ID_BASE)

+ # The company name, if any
+ AC_ARG_WITH(company-name, [AS_HELP_STRING([--with-company-name],
+ [Set company name.])])
+ if test "x$with_company_name" = xyes; then
+ AC_MSG_ERROR([--with-company-name must have a value])
+ elif [ ! [[ $with_company_name =~ ^[[:print:]]*$ ]] ]; then
+ AC_MSG_ERROR([--with-company-name contains non-printing characters: $with_company_name])
+ elif test "x$with_company_name" != x; then
+ COMPANY_NAME="$with_company_name"
+ fi
+
# The vendor name, if any
AC_ARG_WITH(vendor-name, [AS_HELP_STRING([--with-vendor-name],
[Set vendor name. Among others, used to set the 'java.vendor'
diff --git a/jdk/make/gensrc/GensrcMisc.gmk b/jdk/make/gensrc/GensrcMisc.gmk
index 0e3dee5ca3..c137f371c7 100644
--- a/jdk/make/gensrc/GensrcMisc.gmk
+++ b/jdk/make/gensrc/GensrcMisc.gmk
@@ -30,6 +30,11 @@ include ProfileNames.gmk
# string and the runtime name into the Version.java file.
# To be printed by java -version

+company_name =
+ifneq ($(COMPANY_NAME),N/A)
+ company_name=($(COMPANY_NAME))
+endif
+
$(JDK_OUTPUTDIR)/gensrc/sun/misc/Version.java \
$(PROFILE_VERSION_JAVA_TARGETS): \
$(JDK_TOPDIR)/src/share/classes/sun/misc/Version.java.template
@@ -40,6 +45,7 @@ $(PROFILE_VERSION_JAVA_TARGETS): \
-e 's/@@java_version@@/$(RELEASE)/g' \
-e 's/@@java_runtime_version@@/$(FULL_VERSION)/g' \
-e 's/@@java_runtime_name@@/$(RUNTIME_NAME)/g' \
+ -e 's/@@company_name@@/$(company_name)/g' \
-e 's/@@java_profile_name@@/$(call profile_version_name, $@)/g' \
$< > $@.tmp
$(MV) $@.tmp $@
diff --git a/jdk/src/share/classes/sun/misc/Version.java.template b/jdk/src/share/classes/sun/misc/Version.java.template
index 32e2586e79..b1642d3f0a 100644
--- a/jdk/src/share/classes/sun/misc/Version.java.template
+++ b/jdk/src/share/classes/sun/misc/Version.java.template
@@ -44,6 +44,9 @@ public class Version {
private static final String java_runtime_version =
"@@java_runtime_version@@";

+ private static final String company_name =
+ "@@company_name@@";
+
static {
init();
}
@@ -103,7 +106,7 @@ public class Version {

/* Second line: runtime version (ie, libraries). */

- ps.print(java_runtime_name + " (build " + java_runtime_version);
+ ps.print(java_runtime_name + " " + company_name + "(build " + java_runtime_version);

if (java_profile_name.length() > 0) {
// profile name
@@ -120,7 +123,7 @@ public class Version {
String java_vm_name = System.getProperty("java.vm.name");
String java_vm_version = System.getProperty("java.vm.version");
String java_vm_info = System.getProperty("java.vm.info");
- ps.println(java_vm_name + " (build " + java_vm_version + ", " +
+ ps.println(java_vm_name + " " + company_name + "(build " + java_vm_version + ", " +
java_vm_info + ")");
}

--
2.7.4
Loading