Skip to content

Workflow: Java toolchain setup script + one preflight command (#3654) - #3668

Merged
squid-protocol merged 3 commits into
mainfrom
tools/preflight-3654
Sep 25, 2026
Merged

squid-protocol merged 3 commits into
mainfrom
tools/preflight-3654

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #3654.

scripts/setup_java_toolchain.sh

  • Installs Temurin JDK 17 + 21 and Gradle 8.10.2 into .tools/ (gitignored).
  • Idempotent and safe to interrupt. A component counts as installed only when its bin/javac / bin/gradle exists. Downloads land in a temp dir and are moved into place only when complete, and curl -f fails on HTTP errors.
  • --jdk17-from <dir> reuses an existing full JDK and rejects a JRE. --dry-run. eval "$(scripts/setup_java_toolchain.sh --print-env)" sets JDK_17 / JDK_21 / JAVA_HOME / PATH. Unknown arguments are an error.

tests/tools/preflight.py [--java] [--only NAME …] [--fail-fast]

One command for the local gates, with one table at the end and the output tail of each failure:

gate                   result     time  note
------------------------------------------------------------------------
ruff-format            PASS       0.0s
ruff-audit             PASS       0.0s
mypy-audit             PASS       0.2s
dead-key-audit         PASS       0.5s
field-testing          PASS       0.1s
refraction-snapshot    PASS       0.8s
java-carddemo          PASS      17.3s
java-cics-genapp       PASS       6.4s

That run was from /tmp, warm caches. ruff format runs only on the .py files changed vs origin/main, and git always runs at the repo root. The Java gates SKIP, with the reason, when no JDK or corpus is found.

The modernization skill references both, in "Done means" and in the audits gotcha.

Provenance

Drafted by an agy (Gemini 3.1 Pro) agent from a scoped brief, then reviewed and fixed:

  • its changed-files test failed (it asserted a set's order, on files that did not exist);
  • changed-file discovery ran git in the caller's cwd, so from /tmp it found "no changes";
  • a failed download left a directory that later counted as "installed";
  • curl lacked -f;
  • unknown arguments were silently ignored.
    Also: messy multi-line table cells, and a hard-coded corpora path. The tests now cover cwd-independence, missing-JDK and missing-corpus skips, and the table.

🤖 Generated with Claude Code

https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g

squid-protocol and others added 3 commits September 25, 2026 14:49
scripts/setup_java_toolchain.sh installs Temurin JDK 17 and 21 and
Gradle 8.10.2 into .tools/ (gitignored):
- idempotent: an install counts only when bin/javac or bin/gradle
  exists;
- each download goes to a temp dir and is moved into place when
  complete, and `curl -f` fails on HTTP errors;
- --jdk17-from reuses a full JDK (rejects a JRE); unknown arguments
  are an error;
- --dry-run; --print-env for `eval`.

tests/tools/preflight.py runs the local PR gates and prints one PASS /
FAIL / SKIP table, then the output tail of each failure:
- ruff format on the changed .py files; the ruff, mypy and dead-key
  audits; field_testing check; refraction_snapshot check;
- with --java, java_target_matrix --scan on CardDemo (3 configs) and
  GENAPP;
- works from any directory (git runs at the repo root);
- the Java gates SKIP with the reason when no JDK or corpus is found.

The modernization skill names both, in "Done means" and in the audits
gotcha.

Drafted by an agy (Gemini 3.1 Pro) agent. Review fixed:
- its changed-files test, which failed (a set order, and files that do
  not exist);
- changed-file discovery that depended on the caller's cwd (from /tmp it
  saw no changes);
- a partial download counting as installed;
- `curl` without -f;
- silently ignored arguments.
Run from /tmp, `preflight.py --java`: all 8 gates PASS.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
X-Ray failed #3668 in CI on a dense literal that no local gate ran. The
gate runs binary_anomaly_detector on the repo. It fails the pre-fix
script (1 anomaly, exit 1) and passes the fixed one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit a44bfaf into main Sep 25, 2026
29 checks passed
@squid-protocol
squid-protocol deleted the tools/preflight-3654 branch September 25, 2026 19:05
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.

Workflow: Java toolchain setup script + one preflight command for Java-conversion PRs

1 participant