Skepra / Web recovery & resilience

How to review a Composer audit before a maintenance decision

A Composer audit gives a maintenance review a defined package check. Use a short record to capture what was checked, how the command ended, and where a separate runtime review is still needed.

Discuss the next maintenance decision
Summary card: How to review a Composer audit before a maintenance decision. A Composer audit gives a maintenance review a defined package check.
Summary card drawn from this article's own text. Any figure on it is quoted from the article.

What Composer audit checks

Composer audit compares installed packages with defined dependency policies, including security advisories. It can audit the packages recorded in the lock file regardless of the current vendor directory. Start with the project lock file when you need to review the locked dependency set.

Source: Composer CLI documentation: audit.

Read the exit code as a review signal

The documented exit code 1 means the command found packages matching dependency policies or could not proceed because required packages were missing. Record the exit code with the command result, then inspect the reported condition before deciding what maintenance action follows. The code describes the audit result; it does not establish the state of a running application.

Source: Composer CLI documentation: audit.

Choose abandoned package handling explicitly

Composer configuration provides abandoned package handling choices. With the setting at fail, an abandoned package causes a non-zero audit exit. With ignore, abandoned packages are left out of audit reports. Include the selected setting in the maintenance record so readers can interpret the result in context.

Source: Composer configuration documentation: audit.

Separate the lock file from runtime activation

A package audit answers a question about dependency policy and locked packages. It does not show whether a running PHP process has loaded updated code. Debian's checkrestart tool reports processes using deleted files or descriptors, and its manual says root privileges are needed to obtain the information for analysis. Debian's needrestart manual describes checking which daemons need restarting after library upgrades. These are runtime follow-up questions, separate from Composer's lock file audit.

Source: checkrestart manual page; needrestart manual page.

Handoff and limits

For a maintenance record, note the lock file revision reviewed, the command run, its exit code, the abandoned package setting, and any advisory excluded with the reason. This method does not establish whether deployed runtime processes have activated updated code, whether project code has a defect, or whether any particular site is affected. A separate authorised runtime and application review is needed for those questions.

Source: Composer CLI documentation: audit; Composer configuration documentation: audit.

Questions

Does Composer audit depend on the vendor directory?

The documented audit can check packages from the lock file regardless of what is currently in the vendor directory.

What does exit code 1 tell a pipeline?

It signals matching dependency policies or a failure caused by missing required packages. Review the reported condition before deciding on the next step.

Does a passing audit show that PHP processes use updated code?

No. The lock file audit does not establish runtime activation. Runtime process checks are a separate review.