NAME

App::Netdisco::Util::SiteLocal - find site-local files broken by shipped changes

DESCRIPTION

Site-local templates override shipped ones by relative path, so they keep calling APIs that later releases removed. Two of the three removals below fail silently in the browser, which is why this exists: nothing else reports them.

Detection only. This module never writes to a file and never logs.

site_local_rules

Returns the rule table as a list of hashrefs with keys name, release and advice. Lists what is checked without scanning anything.

site_local_paths

Returns the directories a scan should cover: template_paths from deployment.yml, plus the two nd-site-local directories when site_local_files is on.

These are the same directories App::Netdisco::Web unshifts onto the Template Toolkit INCLUDE_PATH. Derived here rather than passed in, so the checksitelocal action and the web app's startup check cannot drift apart.

The shipped share/views is deliberately absent: it is what site-local files override, not something to scan.

scan_site_local( \%args )

Scans every file under each directory in $args{paths} and returns the findings, sorted by path then line. $args{rules} optionally restricts the scan to the named rules.

A finding is a hashref with keys path, line, rule, release, excerpt and advice.

A directory that does not exist is skipped rather than fatal: template_paths routinely names directories a given install has not created.