Skip to content

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

Merged
wjxiz1992 merged 12 commits into
NVIDIA:mainfrom
gerashegalov:codex/with-resource-jython
Sep 15, 2026
Merged

wjxiz1992 merged 12 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 prioritizes new violations when annotating up to 50 source locations, 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.

This change was developed with AI assistance and reviewed by the author.

Validation performed:

  • 31 lint unit tests under Jython 2.7.3
  • 31 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, including raw annotation replay and preserved failure status
  • 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

RetriggerConfidence Score: 5/5

The PR appears safe to merge.

Summary

  • Runs the audit once from the canonical Scala 2.12 Maven reactor.
  • Publishes annotations, a job summary, and a complete JSON artifact.
  • Expands cross-runtime tests while preserving baseline and fingerprint behavior.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  PR[Pull request] --> Job[withResource nesting audit job]
  Job --> Maven[Maven antrun execution]
  Maven --> Tests[Jython lint unit tests]
  Tests --> Scan[Repository scanner]
  Scan --> Classify[Classify new and baselined scopes]
  Classify --> Summary[GitHub job summary]
  Classify --> Annotations[Source annotations]
  Classify --> Report[JSON report artifact]
  Classify --> Status{Audit failures?}
  Status -->|No| Pass[Pass]
  Status -->|Yes| Fail[Fail after publishing available reports]
Loading

Reviews (6) · Last reviewed commit: "Merge branch 'main' into codex/with-reso..."

@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

Comment thread scripts/check_with_resource_nesting.py Outdated
Comment thread scripts/check_with_resource_nesting.py Outdated
Signed-off-by: Gera Shegalov <gshegalov@nvidia.com>

@wjxiz1992 wjxiz1992 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-reviewed at 761ca16.

Comment thread .github/workflows/mvn-verify-check.yml
Comment thread scripts/check_with_resource_nesting.py
Signed-off-by: Gera Shegalov <gshegalov@nvidia.com>
@gerashegalov

Copy link
Copy Markdown
Collaborator Author

build

wjxiz1992
wjxiz1992 previously approved these changes Sep 14, 2026

@wjxiz1992 wjxiz1992 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM.

Signed-off-by: Gera Shegalov <gshegalov@nvidia.com>
@gerashegalov

Copy link
Copy Markdown
Collaborator Author

build

@gerashegalov

Copy link
Copy Markdown
Collaborator Author

build

@wjxiz1992 wjxiz1992 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, creative!

@NvTimLiu NvTimLiu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, so the mvn-very-check will fail if the depth of nesting resources is large than 4.

@wjxiz1992
wjxiz1992 merged commit 21038d0 into NVIDIA:main Sep 15, 2026
58 checks passed
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.

6 participants