Repository navigation
Verify pinned Gradle daemon artifacts independently of upstream rollout - #3306
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
There was a problem hiding this comment.
Hey - I've found 4 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="dev-tools/maintenance/refresh-gradle-daemon-jvm.py" line_range="268" />
<code_context>
- )
- with urllib.request.urlopen(request, timeout=30) as response:
- urls = select_downloads(json.load(response))
+ urls = select_refresh_downloads(check_only)
with tempfile.TemporaryDirectory(prefix="firemud-daemon-jdk-") as directory:
metadata_file = Path(directory) / "download-urls.json"
</code_context>
<issue_to_address>
**Untracked file contents are lost**
When a check-only run starts with an untracked file outside the generated artifact and Gradle modifies it, `outside_artifact_state()` records only untracked path names, so its before/after snapshots match and `refresh()` accepts the generation without reporting the change; the caller sees their file overwritten.
Include untracked file contents in the before/after snapshots used to detect out-of-artifact changes.
</issue_to_address>
### Comment 2
<location path="dev-tools/maintenance/refresh-gradle-daemon-jvm.py" line_range="252-253" />
<code_context>
+def select_refresh_downloads(check_only=False):
+ if not check_only:
+ return select_downloads(fetch_latest_metadata())
+ criteria_text = (ROOT / ARTIFACT).read_text()
+ release, _ = pinned_release_and_urls(criteria_text)
+ return select_pinned_downloads(criteria_text, fetch_release_metadata(release))
+
</code_context>
<issue_to_address>
**Newer pin is overwritten**
When a `--check-only` run reads the old pin before a concurrent explicit refresh generates a newer one, `select_refresh_downloads(check_only)` captures the old URLs before the check-only generator acquires the serialized Gradle invocation; it then writes those stale URLs and reports success, losing the newer pin.
Re-read the committed pin and select its URLs after the check-only run acquires the serialization lock.
Also at `dev-tools/maintenance/refresh-gradle-daemon-jvm.py:268`.
</issue_to_address>
### Comment 3
<location path="dev-tools/maintenance/refresh-gradle-daemon-jvm.py" line_range="203" />
<code_context>
+ "image_type": "jdk",
+ "jvm_impl": "hotspot",
+ "os": os_name,
+ "page_size": "100",
+ "vendor": "eclipse",
+ }
</code_context>
<issue_to_address>
**Valid older pins fail checks**
When the pinned Java 21 release is no longer among the first 100 results for a platform, `fetch_release_metadata` searches only the first 100 results, so `matches` is empty and the function raises instead of finding the still-available official release; `--check-only` fails for a valid committed pin.
Fetch additional result pages until the pinned release is found or the official metadata is exhausted.
Also at `dev-tools/maintenance/refresh-gradle-daemon-jvm.py:204`, `dev-tools/maintenance/refresh-gradle-daemon-jvm.py:206-218`.
</issue_to_address>
### Comment 4
<location path="dev-tools/maintenance/test_refresh_gradle_daemon_jvm.py" line_range="246-248" />
<code_context>
+ self.assertEqual(artifact.read_text(), criteria_text())
+ self.assertEqual(len(generator_calls), 1)
+ command = generator_calls[0]
+ self.assertIn("updateDaemonJvm", command)
+ self.assertIn("--jvm-version=21", command)
+ self.assertIn("--jvm-vendor=adoptium", command)
+
+ def test_check_only_rejects_generator_edits_outside_the_artifact(self):
</code_context>
<issue_to_address>
**URL handoff can be missing**
When `refresh` stops passing the validated URLs to Gradle through the download-URLs file, when `refresh` omits or mispoints the `-PdaemonJvmDownloadUrlsFile` argument, `test_check_only_preserves_preexisting_edits_outside_the_artifact` still passes: its mocked generator returns success without reading the handoff file, and the already-valid artifact satisfies the later criteria check. The test therefore does not catch a broken URL handoff.
Assert that the generator command includes the expected download-URLs-file argument and that the referenced file contains the selected URLs.
</issue_to_address>
[High impact] Changes Gradle daemon artifact verification and validation logic. The PR appears safe to merge, with a non-blocking gap in tests for the new metadata fetch path. Findings
Reviews (1) · Last reviewed commit: "Verify pinned daemon JDK independently o..." · Reviewed by Greptile |
Smoke Summary⏭️ Runtime smoke is not required
|
Static Analysis Summary✅ Static analysis checks passed
CodeQL breakdown
|
Security Summary✅ Security checks passed or were intentionally skipped
|
Validation Summary✅ All validation checks passed
Coverage reports and failure logs are available in the workflow artifacts. |
|
CodeRabbit CLI — 1 Found, 0/1/0 Accepted (Major/Minor/Trivial), 0 Routed |
|
CodeRabbit CLI — 1 Found, 0/1/0 Accepted (Major/Minor/Trivial), 0 Routed |
…novate-daemon-pin-proof-20261026
…novate-daemon-pin-proof-20261026
Summary
Repair the shared Gradle daemon JVM refresh used by Renovate. Adoptium’s latest metadata can contain platform releases that do not share one build; the refresh now selects one exact official release available across all six required platforms and verifies the URLs through Gradle’s native generator.
This is independent maintenance targeting
develop, with three changed files. The original Renovate upgrades remain in their own PRs.Changes
Review and validation
The two authorized CLI reviews are completed and their accepted findings are fixed; Hosted remains closed. The actual independent source review at
2fbedd52b2bedf9aead259f87819fdaff99b5bb8found no further issue. Its identity remains historical evidence: the later parent carries preserve all three owned file contents exactly.The current head
2c2c4f90d900cd041b404a598ae9bb3ea7b6b411receives the actual #3300 merge8ccf900f6930ca805ccc120b3181668e66831529once. R493 freshly passes compilation and CI-pinned Ruff 0.17.1 across all 62 tracked Python files, all 18 focused tests under normal umask and all 18 under umask 077, plus official metadata lookup and the actual native daemon generator. The worktree remains clean. Earlier CLI and Python-validation failures retain their original outcomes and later fix attribution.The current source refresh found zero unresolved current or outdated threads across all seven threads and verified the merge identity. Required current-candidate CI is still pending; earlier base/head success is not current CI proof.
FireMUD LOC impact
Compared
8ccf900f6930→2c2c4f90d900(PR merge-base → head).PR scope: 3 changed files · 832 added textual lines / 26 deleted textual lines.
Rows are hierarchical and overlapping views; do not add them together.
LOC means cloc code lines; blank and comment-only lines are excluded.