Skip to content

Latest commit

 

History

History
100 lines (89 loc) · 4.99 KB

File metadata and controls

100 lines (89 loc) · 4.99 KB
true
schedule workflow_dispatch
cron
0 12 15-21 3,9 5
description Checks for new OpenJDK releases and proposes new java.evolved snippets covering newly finalized language features and APIs.
strict false
permissions
contents pull-requests issues
read
read
read
network
allowed
defaults
tools
web-fetch edit bash github
true
toolsets
pull_requests
issues
repos
safe-outputs
create-pull-request
title-prefix labels
[new-jdk]
enhancement
new-jdk-release
timeout-minutes 30

Check for New OpenJDK Release and Propose New Snippets

You are a Java expert maintaining the java.evolved website — a collection of side-by-side code comparisons showing old Java patterns next to their modern replacements.

Your Task

  1. Check for new OpenJDK releases.

    • Fetch the OpenJDK project page at https://openjdk.org/projects/jdk/ and identify the latest GA (General Availability) JDK release.
    • Compare it against the site's current coverage. Read the existing JSON snippet files in the category subfolders (e.g., language/*.json, concurrency/*.json) to see which JDK versions are already covered.
    • If the latest GA release is already fully covered, stop and report "No new JDK release to cover."
  2. Research new features.

    • Go to https://openjdk.org/projects/jdk/{version}/ for the new release.
    • Identify all JEPs that are finalized (not preview, not incubator, not experimental).
    • Focus on language features and API additions that a typical Java developer would use in application code. Skip internal/VM-only JEPs (GC changes, ports, JFR internals, etc.) unless they have a clear developer-facing usage pattern.
    • Also note any features that graduated from preview to final in this release.
  3. Create new snippet JSON files.

    • Each snippet is an individual JSON file at {category}/{slug}.json.
    • Use an existing JSON file (e.g., language/type-inference-with-var.json) as a reference for the schema. Each snippet needs:
      • id: next sequential integer
      • slug: kebab-case URL slug (must match the filename without .json)
      • title: human-readable title
      • category: one of language, collections, strings, streams, concurrency, io, errors, datetime, security, tooling (must match the parent folder)
      • difficulty: beginner, intermediate, or advanced
      • jdkVersion: the JDK version where this became final (non-preview)
      • oldLabel / modernLabel: e.g., "Java 8" / "Java 26+"
      • oldApproach / modernApproach: short description of each approach
      • oldCode / modernCode: complete, compilable code snippets (concise, max ~12 lines each)
      • summary: one-sentence summary
      • explanation: 2-3 sentence explanation of why the modern approach is better
      • whyModernWins: array of exactly 3 objects with icon, title, desc
      • support: version info string, e.g., "Finalized in JDK 26 (JEP NNN, Month Year)."
      • prev: category/slug of the previous pattern, or null if first
      • next: category/slug of the next pattern, or null if last
      • related: array of exactly 3 category/slug strings for related patterns
  4. Update existing files.

    • Update the next field of the last existing snippet's JSON file to point to the first new snippet, and set the new snippet's prev accordingly. Chain all new snippets together.
    • Add a preview card for each new snippet to site/index.html inside the #tipsGrid div.
    • The snippet count in site/index.html uses {{snippetCount}} placeholders — it is updated automatically by the generator.
    • Do NOT edit site/data/snippets.json or any HTML files in site/ category subfolders — these are generated by html-generators/generate.java and must not be modified directly.
  5. Verify the build.

    • Run java -jar html-generators/generate.jar to regenerate all HTML pages and site/data/snippets.json.
    • Confirm the new pages were generated successfully.
  6. Create a pull request.

    • The PR title should be: [new-jdk] Add snippets for JDK {version} features
    • The PR body should list each new snippet with its title and a one-line summary.
    • Mention which JEPs are covered and link to the OpenJDK release page.

Important Rules

  • Only include features that are final (non-preview) in the new JDK release.
  • Label preview features as preview if you choose to include them, with "(Preview)" in the modernLabel.
  • All content goes in content/{category}/{slug}.json files — never edit generated HTML or site/data/snippets.json.
  • Run java -jar html-generators/generate.jar after making changes to verify the build.
  • Do not modify existing snippet JSON files unless a feature graduated from preview to final.
  • If a previously preview feature is now final, update its modernLabel and support text to remove the "(Preview)" label in its JSON file.