Skip to content

Add pipeline script for create_release_notes and link to master instead of backport issue - #229

Open
smlambert wants to merge 7 commits into
adoptium:masterfrom
smlambert:groovy
Open

Add pipeline script for create_release_notes and link to master instead of backport issue#229
smlambert wants to merge 7 commits into
adoptium:masterfrom
smlambert:groovy

Conversation

@smlambert

Copy link
Copy Markdown
Contributor

Fixes #228
Fixes #200

@smlambert

smlambert commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Testing via https://ci.adoptium.net/job/build-scripts/job/release/job/create_rel_notes_v2/

json produced the original job:
https://ci.adoptium.net/job/build-scripts/job/release/job/create_release_notes/172/artifact/generate-release-notes/generate-release-notes/OpenJDK11U-jdk-release-notes_11.0.32.1_01.json/*view*/

json produced via this PR:
https://ci.adoptium.net/job/build-scripts/job/release/job/create_rel_notes_v2/13/artifact/OpenJDK11-jdk-release-notes_11.0.32.1_1.json/*view*/

Not sure its quite right 'yet', when we link to the master issue, should we be changing type and backportOf values.

Old:
  {
    "id": "JDK-8390612",
    "title": "Update FreeType to 2.14.3",
    "priority": "3",
    "component": "client-libs",
    "subcomponent": "client-libs/2d",
    "link": "https://bugs.openjdk.java.net/browse/JDK-8390612",
    "type": "Backport",
    "backportOf": "JDK-8385390"
  }

New:
 {
    "id": "JDK-8385390",
    "title": "Update FreeType to 2.14.3",
    "priority": "3",
    "component": "client-libs",
    "subcomponent": "client-libs/2d",
    "link": "https://bugs.openjdk.org/browse/JDK-8385390",
    "type": "Backport",
    "backportOf": "JDK-8385390"
  }

karianna
karianna previously approved these changes Aug 30, 2026
@jiekang

jiekang commented Sep 1, 2026

Copy link
Copy Markdown

Testing via https://ci.adoptium.net/job/build-scripts/job/release/job/create_rel_notes_v2/

json produced the original job: https://ci.adoptium.net/job/build-scripts/job/release/job/create_release_notes/172/artifact/generate-release-notes/generate-release-notes/OpenJDK11U-jdk-release-notes_11.0.32.1_01.json/*view*/

json produced via this PR: https://ci.adoptium.net/job/build-scripts/job/release/job/create_rel_notes_v2/13/artifact/OpenJDK11-jdk-release-notes_11.0.32.1_1.json/*view*/

Not sure its quite right 'yet', when we link to the master issue, should we be changing type and backportOf values.

Old:
  {
    "id": "JDK-8390612",
    "title": "Update FreeType to 2.14.3",
    "priority": "3",
    "component": "client-libs",
    "subcomponent": "client-libs/2d",
    "link": "https://bugs.openjdk.java.net/browse/JDK-8390612",
    "type": "Backport",
    "backportOf": "JDK-8385390"
  }

New:
 {
    "id": "JDK-8385390",
    "title": "Update FreeType to 2.14.3",
    "priority": "3",
    "component": "client-libs",
    "subcomponent": "client-libs/2d",
    "link": "https://bugs.openjdk.org/browse/JDK-8385390",
    "type": "Backport",
    "backportOf": "JDK-8385390"
  }

Yeah, I think for the new format, it would ideally be:

{
"id": "JDK-8385390",
[...]
"backportedBy": "JDK-8390612"
}

And I think it's nicer to highlight the main issue as that is the ID used in the commit message. E.g. openjdk/jdk11u@9a1fbf6

has 8385390, the backport issue ID is not in the codebase anywhere.

Signed-off-by: smlambert <slambert@gmail.com>
Signed-off-by: smlambert <slambert@gmail.com>
@smlambert
smlambert requested a review from jerboaa September 1, 2026 19:58
@smlambert

Copy link
Copy Markdown
Contributor Author

@jerboaa jerboaa 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.

I cannot really say anything about the change. No idea what it does. I can say that I'm +1 on backportedBy.

@smlambert

Copy link
Copy Markdown
Contributor Author

Thanks @jerboaa - yes, I mainly wanted you to look at the json output and be okay with the update to use backportedBy. The rest of it takes the script that was previously not in source control and moves its functionality into a groovy script.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new Jenkinsfile likely fails at runtime due to an unguarded manager.createSummary(...) call, and the backport canonicalization sets backportedBy incorrectly and inconsistently across output entries.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR brings the create_release_notes Jenkins job into source control as a declarative Pipeline and updates release-notes generation to prefer the canonical bugs.openjdk.org links and (for backports) the master bug ID rather than the backport issue.

Changes:

  • Add a new generate-release-notes/Jenkinsfile pipeline to run commit fetching, release-note generation, and artifact archiving, and to emit a pre-populated “publish” URL.
  • Switch JIRA REST/search and browse links from bugs.openjdk.java.net to bugs.openjdk.org.
  • Adjust release-notes mapping to rewrite Backport entries to the master bug ID/link, and improve GitHub compare error messaging.
File summaries
File Description
generate-release-notes/Jenkinsfile New Jenkins Pipeline for generating and archiving release-notes artifacts and surfacing a publish link.
generate-release-notes/generate-release-notes/lib/fetchJiraIssues.js Update JIRA REST API base URL and browse links to bugs.openjdk.org.
generate-release-notes/generate-release-notes/lib/fetchGitHubCommits.js Add a more actionable hint for 404 errors when comparing tags.
generate-release-notes/generate-release-notes/fetchReleaseNotes.js Update browse links and rewrite Backport entries to use the master bug ID/link (with an added backport-tracking field).
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 5
  • Review effort level: Lite

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

Comment on lines +239 to +243
// Add a clickable summary badge to the Jenkins build page, matching the
// pattern used in ci-jenkins-pipelines/build_base_file.groovy.
def summary = manager.createSummary('document.svg')
appendSummaryText(summary, "<b>Release notes generated: ${env.RESOLVED_FILENAME}</b><br/>")
appendSummaryText(summary, "<a href='${releaseToolUrl}'>Publish release notes for ${params.JDK_TAG}</a>")
Comment thread generate-release-notes/generate-release-notes/fetchReleaseNotes.js
nvmIoJsOrgMirror: 'https://iojs.org/dist',
nvmInstallDir: '$HOME/.nvm') {
sh 'node --version'
sh 'npm install'
Comment on lines +210 to +213
// Build a pre-populated link to the release-tool publish job so the operator
// can publish the generated JSON with a single click.
// Mirrors the parambuild pattern used in ci-jenkins-pipelines/build_base_file.groovy.
def publishJobPath = 'build-scripts/release/refactor_openjdk_release_tool'
Comment on lines +54 to 66
} else if (releaseNote.type === 'Backport' && releaseNote.backportOf) {
// For backport issues, use the master bug ID and link so that the release
// notes refer to the canonical bug with a description rather than the
// backport ticket which is usually empty.
const canonicalId = releaseNote.backportOf;
releaseNote = {
...releaseNote,
id: canonicalId,
link: `https://bugs.openjdk.org/browse/${canonicalId}`,
type: null,
backportOf: null,
backportedBy: commit.id,
};
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@andrew-m-leonard andrew-m-leonard 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 to me

@Haroon-Khel Haroon-Khel left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM


// 4. Split version on '.' → [FEATURE, INTERIM, UPDATE] or [FEATURE, INTERIM, UPDATE, PATCH]
def versionParts = parts[0].tokenize('.')
if (versionParts.size() < 3) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment for function says jdk-26-ga is a supported format. However versionParts is size 1 (just 26) and this would error out on that input.

Maybe a special case is needed for versionParts size 1?

nvmInstallDir: '$HOME/.nvm') {
sh """
echo "Generating release notes for ${params.JDK_TAG}"
node ./fetchCommitList.js \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code review from IBM Bob:

Parameters passed directly into sh """...""" blocks without quoting are vulnerable to shell injection — and will also break for tags that contain special characters like +, which JEP-322 tags regularly do (e.g. jdk-21.0.1+12).

// Current — unsafe and fragile
node ./fetchCommitList.js \
    --repository ${env.RESOLVED_GITHUB_REPOSITORY} \
    --baseTag ${params.BASE_JDK_TAG} \
    --tag ${params.JDK_TAG} \
    --filename ${params.JDK_TAG}-commits.json

sh "cat ${params.JDK_TAG}-commits.json"

The + in jdk-21.0.1+12 will be treated by the shell as a no-op only by coincidence here, but $() or backtick sequences injected via parameters could execute arbitrary code. All parameter references inside sh blocks must be single-quoted shell variables or passed via withEnv.

// Recommended fix
withEnv([
    "JDK_TAG=${params.JDK_TAG}",
    "BASE_JDK_TAG=${params.BASE_JDK_TAG}",
    "GITHUB_REPO=${env.RESOLVED_GITHUB_REPOSITORY}"
]) {
    sh '''
        node ./fetchCommitList.js \
            --repository "$GITHUB_REPO" \
            --baseTag "$BASE_JDK_TAG" \
            --tag "$JDK_TAG" \
            --filename "${JDK_TAG}-commits.json"
    '''
    sh 'cat "${JDK_TAG}-commits.json"'
}

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.

Add create_release_notes Jenkins job to source control Release notes should use master bug as the primary JBS bug id

7 participants