Skip to content

Disable automatic test file validation and add validate button. - #729

Merged
timja merged 5 commits into
jenkinsci:masterfrom
tiago-espinha-img:te/disable-automatic-file-validation
Oct 29, 2026
Merged

timja merged 5 commits into
jenkinsci:masterfrom
tiago-espinha-img:te/disable-automatic-file-validation

Conversation

@tiago-espinha-img

@tiago-espinha-img tiago-espinha-img commented Sep 3, 2025 •

Copy link
Copy Markdown
Contributor

Automatic test file validation causes issues when workspaces have large O(millions) amount of files. In those cases, if the particular test file doesn't exist at the time the user looks at the configuration page, the Agent will start crawling the whole workspace looking for other subdirectories where that file might be.

By doing so, it's tracking all the files it's seen which eventually leads to filling up the heap and crashing.

This disables the automatic file validation and adds a button that makes it possible to validate manually.

Fixes #728
Fixes #897

Testing done

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

Automatic test file validation causes issues when workspaces have
large O(millions) amount of files. In those cases, if the particular
test file doesn't exist at the time the user looks at the
configuration page, the Agent will start crawling the whole workspace
looking for other subdirectories where that file might be.

By doing so, it's tracking all the files it's seen which eventually
leads to filling up the heap and crashing.

This disables the automatic file validation and adds a button that
makes it possible to validate manually.
@timja
timja marked this pull request as ready for review October 29, 2026 07:43
@timja
timja requested a review from a team as a code owner October 29, 2026 07:43
@timja
timja requested a balanced review from Copilot and removed request for a team October 29, 2026 07:43

Copilot AI 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.

🟡 Changes recommended

The tests do not exercise the new freestyle “Validate Pattern” button, leaving its presence, submission of the edited pattern, and click-only validation behavior unverified.

1 open issue
What changed in this PR

This PR makes JUnit report-pattern validation manual, preventing configuration-page visits from triggering costly workspace scans that can exhaust agent memory.

Changes:

  • Replace automatic validation with a POST-only endpoint and a “Validate Pattern” button.
  • Hide the button for Pipeline jobs and warn about scanning large workspaces.
  • Add tests for endpoint request handling and button absence in the Pipeline snippet generator.
File Description
src/​test/​java/​hudson/​tasks/​junit/​pipeline/​JUnitResultsStepTest.java Tests that the snippet generator hides the validation button.
src/​test/​java/​hudson/​tasks/​junit/​JUnitResultArchiverTest.java Tests POST-only validation and pattern-specific output.
src/​main/​resources/​hudson/​tasks/​junit/​pipeline/​JUnitResultsStep/​config.jelly Hides validation for Pipeline jobs.
src/​main/​resources/​hudson/​tasks/​junit/​JUnitResultArchiver/​config.properties Adds a workspace-scan performance warning.
src/​main/​resources/​hudson/​tasks/​junit/​JUnitResultArchiver/​config.jelly Adds the manual validation button.
src/​main/​java/​hudson/​tasks/​junit/​JUnitResultArchiver.java Replaces automatic checking with an on-demand POST endpoint.

Review effort: Balanced

<f:textbox />
</f:entry>
<j:if test="${!hideValidateButton}">
<f:validateButton title="${%Validate Pattern}" method="validateTestResults" with="testResults" />
@timja
timja enabled auto-merge (squash) October 29, 2026 09:09
@timja
timja merged commit 5c1beed into jenkinsci:master Oct 29, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

4 participants