Skip to content

Allow clean empty Java discovery inventories - #124

Merged
francoisl merged 1 commit into
mainfrom
rory/java-blocklist-empty-inventory
Oct 27, 2026
Merged

francoisl merged 1 commit into
mainfrom
rory/java-blocklist-empty-inventory

Conversation

@roryabraham

@roryabraham roryabraham commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Details

An employee laptop may legitimately have no Java installed. Make a clean --all scan with an empty inventory a successful no-op in both dry-run and apply modes, rather than forcing Toolkit to recognize an error string as success.

  • Keep JSON's report schema unchanged; return empty inventories and no errors. Text output explains that there is nothing to patch and omits the JVM restart reminder.
  • Add --require-java for VM/image provisioning that must fail when Java is unexpectedly absent.
  • Keep discovery/access errors and invalid explicitly selected JVMs failing. The selected-JVM composite action is unaffected.

AI Tests

  • Passed python3 -B -m unittest discover -s tests/python -v (32 tests), including empty discovery in both modes/formats, strict mode with/without Java, and actual discovery/inspection failures.
  • Passed git diff --check. Tests use isolated fixtures; no installed JVM blocklists were modified.

Related Issues

For https://github.com/Expensify/Expensify/issues/694722

Manual Tests

Tested locally.

Linked PRs

https://github.com/Expensify/Expensify-ToolKit/pull/205 can remove its empty-inventory exception after adopting the merged script revision and updated checksum. Keep that consumer pinned to the current behavior until then. VM/image callers can opt into --require-java when adopting the new revision.

A Java-free workstation needs no remediation. Return success for clean empty discovery while preserving real errors and offering --require-java for provisioning that expects a JVM.
@roryabraham
roryabraham requested a review from francoisl October 27, 2026 00:27
@roryabraham
roryabraham marked this pull request as ready for review October 27, 2026 00:28
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-27T00:28:25.783427Z 55f844d Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@francoisl francoisl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ran the script and it works for me, though I do have multiple local Java installs, so I'm probably the wrong person to test

@francoisl
francoisl merged commit 12adcaf into main Oct 27, 2026
20 of 21 checks passed
@francoisl
francoisl deleted the rory/java-blocklist-empty-inventory branch October 27, 2026 00:40
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.

2 participants