[OpenNMS/opennms] f11dbf: NMS-20246: Fail the build on dangling static image...

Scott Theleman via opennms-cvs <[email protected]>
Newsgroups gmane.network.opennms.cvs
Message-ID <OpenNMS/opennms/push/refs/heads/jira/NMS-20246-test-for-static-assets/[email protected]>
  Branch: refs/heads/jira/NMS-20246-test-for-static-assets
  Home:   https://github.com/OpenNMS/opennms
  Commit: f11dbfdb572c1243204a8dfb96fff2bb7841f540
      https://github.com/OpenNMS/opennms/commit/f11dbfdb572c1243204a8dfb96fff2bb7841f540
  Author: Scott Theleman <[email protected]>
  Date:   2026-08-19 (Wed, 19 Aug 2026)

  Changed paths:
    A opennms-webapp/src/test/java/org/opennms/web/StaticAssetReferenceTest.java

  Log Message:
  -----------
  NMS-20246: Fail the build on dangling static image references in the webapp

A missing image referenced from a JSP produces no compile error, no build
failure and no server-side error. The page just renders with a broken
image or a blank background, and the only trace is a 404 in the browser.
That is what made NMS-20091 risky: it removed 61 files from images/ on the
strength of a reference audit, and where the audit was wrong -- a wallpaper
whose only consumers were downstream PoweredBy JSPs -- nothing failed until
someone happened to look at a login page.

Scan every JSP, JSPF, tag, FTL, HTML, CSS and JS file under src/main/webapp
for statically written images/... references and assert each one resolves to
a file that is present. References assembled at runtime cannot be checked
and are skipped by construction, since the pattern does not span quotes.
assets/images/... is skipped too: it belongs to core/web-assets, where
webpack's file-loader already fails the bundle on an unresolvable url().

References are also compared against the case the file actually has on
disk, so a mismatch that works on a case-insensitive developer filesystem
does not reach a case-sensitive deployment as a 404.

The test never asserts that an image *is* referenced. Unused files are a
cleanup question for a human, not a build failure.



To unsubscribe from these emails, change your notification settings at https://github.com/OpenNMS/opennms/settings/notifications


_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/wiki/index.php?page=MailingListFaq
opennms-cvs mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.