-
-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
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
- Part of Action/Result refactor milestone Refactor Commands to Action/Result Pattern for Multi-Channel Support #270
GetMaintainerIssuesActionalready uses this pattern for its feed loader
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels