Skip to content

Update Adoptium mirror to generically mirror Skara CSPU branches and feature branches - #93

Merged
andrew-m-leonard merged 27 commits into
adoptium:masterfrom
andrew-m-leonard:mirror_cspu
Sep 1, 2026
Merged

andrew-m-leonard merged 27 commits into
adoptium:masterfrom
andrew-m-leonard:mirror_cspu

Conversation

@andrew-m-leonard

@andrew-m-leonard andrew-m-leonard commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Fixes #92

Summary

This PR (mirror_cspu) delivers a full overhaul of the Skara mirroring
pipeline, covering dynamic branch discovery, expanded repo support, patch
management, correctness fixes to the tag/branch logic, and CI hardening.

The patches folder has been brought fully up to date, including for all the jdk8u variants, so that the complete patch-sets for jdk8u (base, alpine, aarch32) can be applied into new CSPU branches, and we are not reliant on patches only being persisted as ancient commits in existing branches.


Pipeline & CI (Jenkinsfile)

  • Dynamic branch mirroring — replaced the hardcoded JDK_VERSION /
    ADOPTIUM_MIRROR_REPO parameters with a fully dynamic approach that
    discovers all active upstream Skara branches automatically and mirrors
    each one per run.
  • Renamed parameterJDK_VERSION renamed to SKARA_REPO throughout
    to accurately reflect that it identifies the upstream Skara repository name
    (e.g. jdk17u, aarch32-port-jdk8u), not a JDK version number.
  • Skip upstream PR branchespr/* branches are filtered out before any
    processing; upstream Skara repos can have hundreds of these and they are
    never mirrored.
  • Staleness filtering — branches with no upstream activity in the past
    90 days are skipped automatically.
  • Branch discovery via git ls-remote — replaced GitHub API calls for
    default-branch and branch-list discovery with a temporary bare clone and
    git ls-remote --symref, removing the API token dependency entirely.
  • Clean workspace stage — added an optional CLEAN_MIRROR_WORKSPACE
    parameter to wipe the mirror workspace between runs.
  • Post-build handlers — expanded to cover all pipeline states (success,
    failure, unstable, aborted, changed, fixed, regression).
  • Sandbox-safe staleness check — replaced java.time.Instant ISO-8601
    parsing (not permitted in the Jenkins sandbox) with a plain shell
    date -d '90 days ago' +%s call.
  • Slack failure alerts — on job failure, a danger alert is sent to
    #build only during 09:00–11:59 UTC to avoid hourly spam. The message
    includes the SKARA_REPO name and, if specified, the ADOPTIUM_MIRROR_REPO
    target, plus a direct link to the console log.

Mirror Script (skaraMirror.sh)

New repo support

  • alpine-jdk8u — added full patch set for Alpine/musl libc support;
    wired Skara remote to the upstream jdk8u repo (alpine mirrors from jdk8u,
    not its own Skara repo).
  • aarch32-port-jdk8u — added dedicated patch set; corrected Adoptium
    target repo name mapping to aarch32-jdk8u (without the port- prefix);
    fixed VERSION extraction which was mangling the repo name.

Correctness fixes

  • aarch32-port-jdk8u tag isolation — the upstream Skara repo for this
    project inherits all plain jdk8u* tags from the parent repo. A
    grep 'aarch32' pre-filter is now prepended to jdk_sort_tags_cmd for
    this repo so non-aarch32 tags are never considered for branch-point
    selection, _adopt tagging, or merging into release/dev.
  • +0 / -b00 branch-point tag filtering — restored and hardened the
    filters that exclude branch-point tags from the merge loop:
    • JDK 11+: grep -v '\+0$' — branch-point tags (e.g. jdk-21.0.15+0)
      sort higher than any in-progress current-version build tags; including
      them would advance currentReleaseTag past not-yet-published builds,
      permanently locking them out of the merge loop.
    • JDK 8: grep -v '\-b00' — anchor removed (no $) to also match
      aarch32-style tags where -b00 appears mid-string
      (e.g. jdk8u504-b00-aarch32-20260731).
  • _adopt tag on new release branch — after Adoptium patches are applied
    to a freshly created release_BRANCH, the base build tag is now immediately
    tagged with _adopt so subsequent merge loop runs have a valid starting
    point.
  • Skara fetch before branch checkoutgit fetch skara is now performed
    before the branch checkout/creation logic so skara/$BRANCH is always
    available as a base when creating a new local branch.
  • Skip reset when origin branch absentgit reset --hard origin/$BRANCH
    is now gated on origin/$BRANCH actually existing, preventing a fatal error
    on first-run of a newly mirrored repo.
  • Dev branch base — when DEV_BRANCH does not yet exist it is created
    from $BRANCH (the up-to-date Skara mirror branch) rather than from
    whatever HEAD happens to be after performMergeIntoReleaseFromMaster.
  • Repo-specific patch override — patches in patches/<GITHUB_REPO>/
    take precedence over same-named top-level patches, allowing per-repo
    overrides without duplicating the full patch set.

Patch changes

  • Removed redundant ppc64le jdk8u patches (already upstream).
  • Added actions-ignore-branches.patch for jdk21u and alpine-jdk8u.
  • Consolidated the Alpine musl libc support patch across all jdk8u-based repos.

Test Reproducible build of Temurin jdk-21.0.12.1+1 x64 Linux

  • Rebuilt Temurin jdk-21.0.12.1+1 x64 Linux from a forked mirror created using new scripts
  • 100% Identical :
anleonar@anleonar-mac Downloads % diff -r jdk1 jdk2
diff -r jdk1/jdk-21.0.12.1+1/release jdk2/jdk-21.0.12.1+1/release
10c10
< SOURCE=".:git:417ed817d1fe"
---
> SOURCE=".:git:1c417fbfc2f7"
13c13
< SOURCE_REPO="https://github.com/andrew-m-leonard/adopt_jdk21u.git"
---
> SOURCE_REPO="https://github.com/adoptium/jdk21u.git"

Assisted-by: Bob bob@ibm.com

andrew-m-leonard and others added 21 commits August 24, 2026 15:36
…aleness check

Co-authored-by: Bob <bob@ibm.com>
…ox-safe staleness check

Co-authored-by: Bob <bob@ibm.com>
… correct base

Co-authored-by: Bob <bob@ibm.com>
…d bare clone for branch discovery

Co-authored-by: Bob <bob@ibm.com>
Signed-off-by: Andrew Leonard <andrew.m.leonard@ibm.com>
… aarch32-port-jdk8u

Co-authored-by: Bob <bob@ibm.com>
…add Slack failure alerts

Co-authored-by: Bob <bob@ibm.com>
@andrew-m-leonard andrew-m-leonard self-assigned this Aug 28, 2026
@andrew-m-leonard
andrew-m-leonard requested a balanced review from Copilot August 28, 2026 09:59
@andrew-m-leonard andrew-m-leonard changed the title Mirror cspu Update Adoptium mirror to generically mirror Skara CSPU branches and feature branches Aug 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Overhauls Skara mirroring to support CSPU branches, additional JDK 8 repositories, and repository-specific patching.

Changes:

  • Dynamically discovers and mirrors active upstream branches.
  • Corrects branch, tag, and patch handling.
  • Adds Alpine and AArch32 patch sets while removing obsolete PPC64LE patches.

Reviewed changes

Copilot reviewed 17 out of 19 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Jenkinsfile Adds dynamic branch mirroring and notifications.
skaraMirror.sh Revises repository, branch, tag, and patch logic.
patches/jdk8u/ppc64le_1.patch Removes obsolete PPC64LE changes.
patches/jdk8u/ppc64le_2.patch Removes obsolete JVM configuration patch.
patches/jdk8u/0001-Backport-8073139.patch Removes an upstreamed backport.
patches/jdk8u/0001-Set-vendor-information.patch Refreshes vendor metadata patch.
patches/jdk8u/company_name.patch Refreshes company-name support.
patches/jdk8u/actions-ignore-branches.patch Excludes mirror branches from Actions.
patches/jdk11u/actions-ignore-branches.patch Adds the JDK 11 override marker.
patches/jdk17u/actions-ignore-branches.patch Excludes mirror branches from Actions.
patches/jdk21u/actions-ignore-branches.patch Excludes mirror branches from Actions.
patches/alpine-jdk8u/0002-apply-PATCH-Allow-setting-company-name.patch Adds Alpine company metadata.
patches/alpine-jdk8u/0003-apply-0001-Set-vendor-information.patch.patch Adds Alpine vendor metadata.
patches/alpine-jdk8u/0004-skip-github-actions-builds-to-save-executors.patch Suppresses Alpine mirror builds.
patches/alpine-jdk8u/0005-alpine-musl-libc-support.patch Adds consolidated musl support.
patches/alpine-jdk8u/actions-ignore-branches.patch Adds another Actions exclusion patch.
patches/aarch32-port-jdk8u/company_name.patch Adds AArch32 company metadata.
patches/aarch32-port-jdk8u/0001-Set-vendor-information.patch Adds AArch32 vendor metadata.
patches/aarch32-port-jdk8u/actions-ignore-branches.patch Suppresses AArch32 mirror builds.
Suppressed comments (1)

Jenkinsfile:143

  • ADOPTIUM_MIRROR_REPO is interpolated directly into the shell program. An embedded single quote terminates the intended quoting and allows command injection. Pass both arguments through environment variables and expand them as quoted shell data instead.
                        withEnv(["BRANCH=${branch}"]) {
                            sh """
                                git --version
                                bash ./skaraMirror.sh '${params.SKARA_REPO}' ${mirrorRepoArg ? "'${mirrorRepoArg}'" : ''}
                            """

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Jenkinsfile
Comment thread Jenkinsfile Outdated
Comment thread skaraMirror.sh
Comment thread patches/alpine-jdk8u/actions-ignore-branches.patch
andrew-m-leonard and others added 2 commits August 28, 2026 11:11
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…led patch section

Co-authored-by: Bob <bob@ibm.com>
@andrew-m-leonard
andrew-m-leonard requested a balanced review from Copilot August 28, 2026 10:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 18 changed files in this pull request and generated 8 comments.

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

skaraMirror.sh:128

  • If git rebase --continue encounters another conflicting commit, this exits while leaving the repository in an active rebase. Subsequent hourly runs cannot check out $BRANCH, so the mirror remains stuck until manually cleaned. Abort the rebase before exiting when continuation fails.
  if ! git rebase "skara/$BRANCH" "$BRANCH" ; then
    if resolveGeneratedConfigureConflict ; then
      git rebase --continue || exit 1
    else
      git rebase --abort
      exit 1

Comment thread skaraMirror.sh
Comment thread Jenkinsfile Outdated
Comment thread Jenkinsfile Outdated
Comment thread patches/jdk8u/actions-ignore-branches.patch
Comment thread patches/jdk17u/actions-ignore-branches.patch
Comment thread patches/jdk21u/actions-ignore-branches.patch
Comment thread patches/alpine-jdk8u/actions-ignore-branches.patch
Comment thread patches/aarch32-port-jdk8u/actions-ignore-branches.patch
andrew-m-leonard and others added 3 commits August 28, 2026 13:38
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…enerated-configure.sh changes

Co-authored-by: Bob <bob@ibm.com>

@steelhead31 steelhead31 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@andrew-m-leonard
andrew-m-leonard merged commit 39da252 into adoptium:master Sep 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review mirroring behavior for CSPUs

4 participants