Skip to content

Verify pinned Gradle daemon artifacts independently of upstream rollout - #3306

Merged
benhook1013 merged 9 commits into
developfrom
codex/renovate-daemon-pin-proof-20261026
Oct 25, 2026
Merged

benhook1013 merged 9 commits into
developfrom
codex/renovate-daemon-pin-proof-20261026

Conversation

@benhook1013

@benhook1013 benhook1013 commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

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

  • Bounded official release lookup and explicit handling of exhausted metadata pages, with no mixed-platform build or source-budget bypass.
  • Verified resource-session handoff to the native generator and preservation of Git-visible source changes, file modes and the generated artifact during check-only proof.
  • Explicit generated file permissions under restrictive umask, focused regressions and the local daemon-proof workflow consequence.

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 2fbedd52b2bedf9aead259f87819fdaff99b5bb8 found no further issue. Its identity remains historical evidence: the later parent carries preserve all three owned file contents exactly.

The current head 2c2c4f90d900cd041b404a598ae9bb3ea7b6b411 receives the actual #3300 merge 8ccf900f6930ca805ccc120b3181668e66831529 once. 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.

Section Base LOC Head LOC Δ LOC Change
Overall 1,306,896 1,307,603 +707 +0.1%
 Source 1,214,029 1,214,736 +707 +0.1%
  ↳ Code 536,948 537,655 +707 +0.1%
  ↳ Tests 677,081 677,081 0 0.0%
 Markdown 61,487 61,487 0 0.0%
 Design 64,442 64,442 0 0.0%
  ↳ Architecture 45,753 45,753 0 0.0%
  ↳ Project management 6,054 6,054 0 0.0%
  ↳ Observability 2,147 2,147 0 0.0%
  ↳ Operator runbooks 579 579 0 0.0%
  ↳ gRPC API documentation 8,433 8,433 0 0.0%
  ↳ Product requirements and user journeys 926 926 0 0.0%
  ↳ Developer workflows 471 471 0 0.0%
  ↳ Other design 79 79 0 0.0%

Rows are hierarchical and overlapping views; do not add them together.
LOC means cloc code lines; blank and comment-only lines are excluded.

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai sourcery-ai Bot 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.

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>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@greptile-apps

greptile-apps Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[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

  1. P2 Fetch checks remain untested ▶

Reviews (1) · Last reviewed commit: "Verify pinned daemon JDK independently o..." · Reviewed by Greptile

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Smoke Summary

⏭️ Runtime smoke is not required

  • ✅ Changes detection: success
  • ✅ Smoke Gate: success
  • ⏭️ PR Full-Stack Smoke: skipped (run_smoke_full=false)

@benhook1013
benhook1013 enabled auto-merge October 25, 2026 12:30
@benhook1013
benhook1013 disabled auto-merge October 25, 2026 12:31
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Static Analysis Summary

✅ Static analysis checks passed

  • ✅ CodeQL gate: success
  • ✅ License gate: success

CodeQL breakdown

  • ⏭️ CodeQL analysis (java): skipped
  • ⏭️ CodeQL analysis (javascript-typescript): skipped

@github-actions

Copy link
Copy Markdown
Contributor

Security Summary

✅ Security checks passed or were intentionally skipped

  • ✅ Security gate: success
  • ✅ Trivy filesystem scan: success
  • ✅ Secret compliance validation: success

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Validation Summary

✅ All validation checks passed

  • ✅ Validation gate: success
  • ✅ Buf generation: success
  • ✅ Dockerfile lint: success
  • ✅ ShellCheck: success
  • ✅ Python script validation: success
  • ✅ Dev tool contract checks: success
  • ⏭️ Dev Tools README contract: skipped
  • ✅ YAML lint: success
  • ✅ Metrics cardinality policy check: success
  • ✅ Flyway migration sanity checks: success
  • ✅ gRPC transport configuration sanity checks: success
  • ✅ GitHub workflow lint: success
  • ✅ Helm chart lint: success
  • ✅ Helm render validation: success
  • ✅ Helm transaction proof: success
  • ✅ Validate Documentation: success
  • ⏭️ Frontend checks: skipped
  • ⏭️ Service build/test matrix: skipped

Coverage reports and failure logs are available in the workflow artifacts.

@sourcery-ai sourcery-ai Bot 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.

New security issues found

@benhook1013

Copy link
Copy Markdown
Owner Author

CodeRabbit CLI — 1 Found, 0/1/0 Accepted (Major/Minor/Trivial), 0 Routed
3 files · 1m 32s · c9f6e0d

@benhook1013

Copy link
Copy Markdown
Owner Author

CodeRabbit CLI — 1 Found, 0/1/0 Accepted (Major/Minor/Trivial), 0 Routed
3 files · 1m 38s · 045e2ca

@benhook1013
benhook1013 deleted the codex/renovate-daemon-pin-proof-20261026 branch November 1, 2026 10:59
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.

1 participant