Context
GetMaintainerReleaseNotesActionTest currently creates a real temporary git repository in setUpBeforeClass() and deletes it in tearDownAfterClass(). This is needed because the action runs two git subprocesses directly via Process:
git log (to get commit history between refs)
git config --get remote.origin.url (to determine the project name)
These are real subprocess calls that require a real filesystem path — vfs:// paths from vfsstream are not usable by external processes.
Proposed fix
Make the git runner injectable via a \Closure, similar to how GetMaintainerIssuesAction accepts a $feedLoader closure:
public function __construct(
private readonly Client $client,
private readonly ?\Closure $processRunner = null,
) {}
The default implementation runs a real Process; tests inject a closure returning a mock result with pre-canned git log output and remote URL. This eliminates the need for a real temp directory and makes the tests fully in-process.
Related
Context
GetMaintainerReleaseNotesActionTestcurrently creates a real temporary git repository insetUpBeforeClass()and deletes it intearDownAfterClass(). This is needed because the action runs two git subprocesses directly viaProcess:git log(to get commit history between refs)git config --get remote.origin.url(to determine the project name)These are real subprocess calls that require a real filesystem path —
vfs://paths from vfsstream are not usable by external processes.Proposed fix
Make the git runner injectable via a
\Closure, similar to howGetMaintainerIssuesActionaccepts a$feedLoaderclosure:The default implementation runs a real
Process; tests inject a closure returning a mock result with pre-canned git log output and remote URL. This eliminates the need for a real temp directory and makes the tests fully in-process.Related
GetMaintainerIssuesActionalready uses this pattern for its feed loader