Skip to content
Open
Changes from all commits
Commits
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
16 changes: 8 additions & 8 deletions bucket/microsoft-lts-jdk.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"description": "The Microsoft Build of OpenJDK is a no-cost long-term supported distribution and Microsoft's way to collaborate and contribute to the Java ecosystem.",
"description": "The Microsoft Build of OpenJDK is a new no-cost long-term supported distribution and Microsoft's new way to collaborate and contribute to the Java ecosystem",
"homepage": "https://www.microsoft.com/openjdk/",
"version": "21.0.10",
"version": "25.0.2",
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Please align PR metadata with the actual updated version.

Line 4 is 25.0.2, but the PR title still says 25.0.1. Please update the PR title/description to avoid release-note and review confusion.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bucket/microsoft-lts-jdk.json` at line 4, Update the PR title and description
to match the actual version in microsoft-lts-jdk.json: change any reference to
"25.0.1" in the PR title/description to "25.0.2" so metadata aligns with the
"version" field in the file.

"license": "GPL-2.0-only WITH Classpath-exception-2.0",
"architecture": {
"64bit": {
"url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.10-windows-x64.zip",
"hash": "45a44af1f832e720ea6ad90dd7b2c94a48b2e5bf2fab92b2403e975f78d7d5e1"
"url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.2-windows-x64.zip",
"hash": "38d1a42d189c50b24152014ef131931f25f4cc80400ce618f0477f5e4e5aa252"
},
"arm64": {
"url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.10-windows-aarch64.zip",
"hash": "924c7127929aeb90019c1982a26b0a88337aed00ef333afb0bec28c06a6b5767"
"url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.2-windows-aarch64.zip",
"hash": "e0d9380cf3d0b5efc675664fa0db22cc9eb5d77c4fd2a132f4b58df0608593cf"
}
},
"extract_to": "tmp",
Expand All @@ -25,8 +25,8 @@
"JAVA_HOME": "$dir"
},
"checkver": {
"url": "https://docs.microsoft.com/java/openjdk/download",
"regex": "(?<ms>microsoft-jdk-((?<ver>21[\\d.]*?).(?<build>[\\d]+).[\\d]+)-windows-x64).zip"
"url": "https://learn.microsoft.com/en-us/java/openjdk/download",
"regex": "(?<ms>microsoft-jdk-((?<ver>25[\\d.]*?).(?<build>[\\d]+).[\\d]+)-windows-x64).zip"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, verify the file exists and examine its structure
fd microsoft-lts-jdk.json

Repository: ScoopInstaller/Java

Length of output: 92


🏁 Script executed:

# Read the entire file to understand context
cat -n bucket/microsoft-lts-jdk.json

Repository: ScoopInstaller/Java

Length of output: 2060


🏁 Script executed:

# Run the validation script from the review to test the current regex
python - <<'PY'
import json, re, pathlib, urllib.request

manifest = json.loads(pathlib.Path("bucket/microsoft-lts-jdk.json").read_text())
rx = re.compile(manifest["checkver"]["regex"])

samples = [
    "microsoft-jdk-25.0.2-windows-x64.zip",
    "microsoft-jdk-25.0.2.8.1-windows-x64.zip",
]
print("=== Sample matches (CURRENT REGEX) ===")
for s in samples:
    m = rx.search(s)
    print(s, "=>", m.groupdict() if m else None)

print("\n=== checkver URL matches (CURRENT REGEX) ===")
url = manifest["checkver"]["url"]
try:
    html = urllib.request.urlopen(url, timeout=20).read().decode("utf-8", "ignore")
    hits = sorted(set(re.findall(r"microsoft-jdk-[^\"'\\s>]*windows-x64\\.zip", html)))
    print(f"found {len(hits)} candidate links")
    for h in hits[:20]:
        m = rx.search(h)
        print(h, "=>", m.groupdict() if m else None)
except Exception as e:
    print(f"Error fetching URL: {e}")
PY

Repository: ScoopInstaller/Java

Length of output: 1094


🏁 Script executed:

# Test the suggested fixed regex against the same samples
python - <<'PY'
import json, re, pathlib

suggested_regex = r"(?<ms>microsoft-jdk-((?<ver>25[\\d.]*?)\\.(?<build>[\\d]+)\\.[\\d]+)-windows-x64)\\.zip"

# Note: Python re module doesn't support named groups with (?<name>...) syntax
# It uses (?P<name>...) syntax, but let's construct it properly for testing
suggested_regex_python = r"(?P<ms>microsoft-jdk-((?P<ver>25[\d.]*?)\.(?P<build>[\d]+)\.[\d]+)-windows-x64)\.zip"
rx_suggested = re.compile(suggested_regex_python)

samples = [
    "microsoft-jdk-25.0.2-windows-x64.zip",
    "microsoft-jdk-25.0.2.8.1-windows-x64.zip",
]
print("=== Sample matches (SUGGESTED REGEX) ===")
for s in samples:
    m = rx_suggested.search(s)
    print(s, "=>", m.groupdict() if m else None)
PY

Repository: ScoopInstaller/Java

Length of output: 335


🏁 Script executed:

python - <<'PY'
import re

# Current regex converted to Python syntax
current_regex = r"(?P<ms>microsoft-jdk-((?P<ver>25[\d.]*?).(?P<build>[\d]+).[\d]+)-windows-x64).zip"
rx_current = re.compile(current_regex)

# Suggested regex
suggested_regex = r"(?P<ms>microsoft-jdk-((?P<ver>25[\d.]*?)\.(?P<build>[\d]+)\.[\d]+)-windows-x64)\.zip"
rx_suggested = re.compile(suggested_regex)

samples = [
    "microsoft-jdk-25.0.2-windows-x64.zip",
    "microsoft-jdk-25.0.2.8.1-windows-x64.zip",
    "microsoft-jdk-25-0-2-windows-x64.zip",  # edge case: different separator
]

print("=== CURRENT REGEX (unescaped dots) ===")
for s in samples:
    m = rx_current.search(s)
    result = m.groupdict() if m else None
    print(f"{s:40} => {result}")

print("\n=== SUGGESTED REGEX (escaped dots) ===")
for s in samples:
    m = rx_suggested.search(s)
    result = m.groupdict() if m else None
    print(f"{s:40} => {result}")

# Show the danger: current regex matches dashes too (unwanted)
print("\n=== DEMONSTRATING THE PROBLEM ===")
test = "microsoft-jdk-25-0-2-windows-x64.zip"
m = rx_current.search(test)
if m:
    print(f"CURRENT REGEX WRONGLY MATCHES: {test}")
    print(f"  Captures: {m.groupdict()}")
else:
    print(f"Current regex correctly rejects: {test}")

m = rx_suggested.search(test)
if m:
    print(f"SUGGESTED REGEX WRONGLY MATCHES: {test}")
    print(f"  Captures: {m.groupdict()}")
else:
    print(f"Suggested regex correctly rejects: {test}")
PY

Repository: ScoopInstaller/Java

Length of output: 1033


Escape literal dots in checkver.regex to prevent incorrect filename matches.

Line 29 uses unescaped dots (.) which act as wildcards, allowing the regex to incorrectly match filenames with alternative separators (e.g., microsoft-jdk-25-0-2-windows-x64.zip). This causes unstable ver/build captures that directly affect autoupdate on line 43.

Suggested regex fix
-        "regex": "(?<ms>microsoft-jdk-((?<ver>25[\\d.]*?).(?<build>[\\d]+).[\\d]+)-windows-x64).zip"
+        "regex": "(?<ms>microsoft-jdk-((?<ver>25[\\d.]*?)\\.(?<build>[\\d]+)\\.[\\d]+)-windows-x64)\\.zip"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"regex": "(?<ms>microsoft-jdk-((?<ver>25[\\d.]*?).(?<build>[\\d]+).[\\d]+)-windows-x64).zip"
"regex": "(?<ms>microsoft-jdk-((?<ver>25[\\d.]*?)\\.(?<build>[\\d]+)\\.[\\d]+)-windows-x64)\\.zip"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bucket/microsoft-lts-jdk.json` at line 29, The checkver.regex currently uses
unescaped dots which act as wildcards and allow incorrect matches (e.g.,
"microsoft-jdk-25-0-2-windows-x64.zip"); update the "regex" value so literal
dots in the version and filename parts are escaped (replace . with \. where you
expect a literal dot), preserving the named capture groups (?<ms>...),
(?<ver>...) and (?<build>...) so ver and build capture only numeric/dotted
version segments and not alternative separators.

},
"autoupdate": {
"architecture": {
Expand Down