Skip to content

Run and report withResource nesting lint with Jython [reduced-it] - #15879

Open
gerashegalov wants to merge 8 commits into
NVIDIA:mainfrom
gerashegalov:codex/with-resource-jython
Open

Run and report withResource nesting lint with Jython [reduced-it]#15879
gerashegalov wants to merge 8 commits into
NVIDIA:mainfrom
gerashegalov:codex/with-resource-jython

Conversation

@gerashegalov

@gerashegalov gerashegalov commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Related to #11713.

Description

The repository-wide withResource nesting lint currently requires a host Python 3 executable and is repeated by both generated Scala root builds. This change ports the lint and its unit tests to code compatible with Jython 2.7.3 while retaining Python 3 compatibility.

Maven now launches the tests and repository scan through its existing managed Jython dependency. A dedicated root execution runs only from the canonical Scala 2.12 reactor; the generated Scala 2.13 POM keeps its Scala-specific checks but does not repeat this repository-wide scan.

A new pull-request check publishes every detected deep scope in the GitHub job summary and a JSON artifact. It annotates the first 50 source locations, GitHub Actions annotation limit used by the check, while the complete set remains available in both reports. Baselined scopes are visible existing debt and do not fail the check. New violations, stale baseline entries, invalid exemptions, or report-generation errors remain failures.

The depth-four policy, exemption behavior, CLI flags, diagnostics, exit codes, baseline schema, and all 59 existing fingerprints remain unchanged. Ordered JSON serialization and normalized source traversal keep generated baselines byte-for-byte identical across Jython and Python 3.

This PR contains no deprecation-policy or deprecation-audit changes.

Validation performed:

  • 27 lint unit tests under Jython 2.7.3
  • 27 lint unit tests under Python 3
  • repository lint and complete report generation under both runtimes: 59 baselined violations, maximum depth 4
  • generated baseline, Markdown summary, and JSON report output matched across Jython and Python 3
  • standalone Maven withResource audit execution
  • root Scala 2.12 Maven verification with the Jython tests, report, and lint
  • root Scala 2.13 Maven verification confirming the resource lint is not repeated
  • Scala 2.13 POM regeneration
  • git diff --check

Performance testing is not required because this changes build-time lint tooling only and does not modify production runtime code.

Checklists

Documentation

  • Updated for new or modified user-facing features or behaviors
  • No user-facing change

Testing

  • Added or modified tests to cover new code paths
  • Covered by existing tests
    (Please provide the names of the existing tests in the PR description.)
  • Not required

Performance

  • Tests ran and results are added in the PR description
  • Issue filed with a link in the PR description
  • Not required

Signed-off-by: Gera Shegalov <gshegalov@nvidia.com>
Signed-off-by: Gera Shegalov <gshegalov@nvidia.com>
Signed-off-by: Gera Shegalov <gshegalov@nvidia.com>
Signed-off-by: Gera Shegalov <gshegalov@nvidia.com>
Signed-off-by: Gera Shegalov <gshegalov@nvidia.com>
Signed-off-by: Gera Shegalov <gshegalov@nvidia.com>
@gerashegalov
gerashegalov requested a review from a team as a code owner September 2, 2026 18:41
@greptile-apps

greptile-apps Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR ports the withResource nesting lint and tests to Jython 2.7-compatible Python while retaining Python 3 compatibility.

  • Runs the repository-wide lint and its unit tests through Maven-managed Jython from the canonical Scala 2.12 root reactor.
  • Adds complete Markdown, JSON, and GitHub annotation reporting.
  • Keeps the generated Scala 2.13 reactor from repeating the repository-wide scan.
  • Adds cross-runtime serialization, source-discovery, reporting, and failure-path tests.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
pom.xml Adds the root-only Maven/Jython audit execution and report output properties while removing the duplicated host-Python scan from Scalastyle.
scala2.13/pom.xml Preserves the generated Scala 2.13 build view while conditionally disabling the repository-wide audit execution.
scripts/check_with_resource_nesting.py Ports the lint to Python 2.7-compatible constructs and adds deterministic Markdown, JSON, and GitHub annotation reporting.
scripts/tests/test_check_with_resource_nesting.py Ports tests to Jython-compatible utilities and expands coverage for traversal, serialization, reports, annotations, and report-write failures.
.github/workflows/mvn-verify-check.yml Adds a pull-request audit job that publishes a summary and uploads the complete JSON report.
scripts/README.md Documents runtime compatibility, Maven execution scope, reporting behavior, and audit failure conditions.

Reviews (2): Last reviewed commit: "Publish withResource nesting audit repor..." | Re-trigger Greptile

@gerashegalov gerashegalov changed the title Run withResource nesting lint with Jython [reduced-it] Run and report withResource nesting lint with Jython [reduced-it] Sep 2, 2026
@gerashegalov

Copy link
Copy Markdown
Collaborator Author

build

@gerashegalov gerashegalov self-assigned this Sep 2, 2026
@sameerz sameerz added the reliability Features to improve reliability or bugs that severly impact the reliability of the plugin label Sep 3, 2026
@gerashegalov

Copy link
Copy Markdown
Collaborator Author

Here is the direct link to the report. @wjxiz1992

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

reliability Features to improve reliability or bugs that severly impact the reliability of the plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants