Skip to content

fix(stash): exclude node_modules from buildResult stash - #5861

Open
maxcask wants to merge 1 commit into
masterfrom
fix/buildResult-stash-exclude-node-modules
Open

fix(stash): exclude node_modules from buildResult stash#5861
maxcask wants to merge 1 commit into
masterfrom
fix/buildResult-stash-exclude-node-modules

Conversation

@maxcask

@maxcask maxcask commented Jul 31, 2026

Copy link
Copy Markdown
Member

Summary

  • The buildResult stash includes **/dist/**, which matches dist/ folders inside node_modules packages
  • Projects with npm dependencies can have 40,000–100,000+ unneeded files stashed, costing several minutes per build
  • Adds the same excludes class already used by checkmarx/checkmarxOne to buildResult

Pattern added:

**/node_modules/**, **/*.mockserver.js, **/*-preload.js, **/target/coverage/**

Performance impact (measured on AdminUIService, build #9894)

Source Files
webCore/node_modules/**/dist/** 20,089
webDevOps/node_modules/**/dist/** 21,194
Total buildResult stash 112,688 (2m 58s)
pipelineStashFilesAfterBuild total 3m 44s

Reference build log: https://gkecpspipeline2.jaas-gcp.cloud.sap.corp/job/CPServices/job/AdminUIService/job/dev/9894/console

Test plan

  • Verify buildResult stash no longer includes node_modules/**/dist/** files on a project with npm dependencies
  • Confirm .war, .jar, .mtar, and project-owned dist/ artifacts are still stashed correctly
  • Check that projects without node_modules are unaffected

The buildResult stash includes `**/dist/**` which matches dist/
folders inside node_modules packages, causing 100k+ unnecessary
files to be stashed on projects with npm dependencies. This adds
the same-class of excludes already used by checkmarx/checkmarxOne
to the buildResult stash entry, preventing node_modules and other
non-artifact paths from being stashed.

Measured impact: 40k+ files and ~3 minutes saved per Central Build
stage on affected projects (e.g. AdminUIService build #9894).
@maxcask
maxcask requested a review from a team as a code owner July 31, 2026 05:35
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.

1 participant