Skip to content

Add pipeline to auto update jdk versions#850

Merged
ahmedmuhsin merged 9 commits into
devfrom
auto-update-jdk-versions
Jan 6, 2026
Merged

Add pipeline to auto update jdk versions#850
ahmedmuhsin merged 9 commits into
devfrom
auto-update-jdk-versions

Conversation

@ahmedmuhsin

Copy link
Copy Markdown
Contributor

This pull request introduces a new automated pipeline for checking and updating Java JDK versions used by the project. It adds a scheduled Azure Pipeline configuration and a Python script to detect, validate, and update Java versions for both Linux and Windows environments. The pipeline runs weekly, validates the latest JDK releases, updates the relevant YAML file, and automatically creates a pull request with changes.

CI Pipeline Automation:

  • Added eng/ci/java-version-check.yml Azure Pipeline to run weekly on the dev branch, detecting new Java JDK versions for both Linux and Windows, validating installations, and publishing artifacts. The pipeline triggers only on schedule or manually, not on PRs.
  • Automated merging of detected JDK versions into eng/ci/templates/java-versions.yml and creation of a pull request if changes are found, including logic to avoid duplicate PRs and provide review guidance.

Java Version Detection and Validation:

  • Added eng/scripts/check-java-versions.py, a Python script that:
    • Detects the latest JDK 8 version from Adoptium and JDK 11+ from Microsoft OpenJDK for both OS types.
    • Downloads and extracts JDK distributions, validates them using java -version, and updates the YAML file if newer versions are found.
    • Ensures only updated versions are committed, preserving formatting and comments in the YAML file.

Pipeline Integration and Artifact Handling:

  • Pipeline stages include validation jobs for Linux and Windows JDKs, merging version updates, and publishing pipeline artifacts for downstream usage.
  • Uses Python 3.11 for scripting tasks and handles YAML updates via regex, avoiding external dependencies. [1] [2]

jobs:
- job: ValidateLinuxJDKs
displayName: 'Detect and Validate Linux JDKs'
timeoutInMinutes: 60

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

DO you need timeout for pipeline, are you expecting to be syuck?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nothing specific to point out, this is just a failsafe to make sure that we don't run the job for 4 hours (the default timeout) in case it hangs anywhere.

@@ -0,0 +1,270 @@
schedules:
- cron: "0 8 * * MON" # Weekly on Monday at 8 AM UTC
displayName: Weekly Java Version Check

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sometime JDK versions has the breaking changes, are you ensuring and running the unit tests and integration tests?.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, all tests are run as a part of the PR that gets generated. See this example: #849

@ahmedmuhsin
ahmedmuhsin merged commit 81191d0 into dev Jan 6, 2026
22 checks passed
@ahmedmuhsin
ahmedmuhsin deleted the auto-update-jdk-versions branch January 6, 2026 21:13
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.

2 participants