Skip to content

Normalize DevTools workspace directory handling#275

Merged
coisa merged 2 commits intomainfrom
feature/274-normalize-workspace-dir
Apr 28, 2026
Merged

Normalize DevTools workspace directory handling#275
coisa merged 2 commits intomainfrom
feature/274-normalize-workspace-dir

Conversation

@coisa
Copy link
Copy Markdown
Contributor

@coisa coisa commented Apr 28, 2026

Related Issue

Closes #274

Motivation / Context

  • --working-dir now selects the project root, but generated artifacts and caches still needed one central policy instead of each command assuming .dev-tools independently.
  • Consumer and global-binary usage need a way to move generated reports, coverage, metrics, and caches without changing source/resource lookup semantics.
  • Nested orchestrators such as reports and standards should carry the same workspace defaults without requiring duplicated command-specific paths.

Changes

  • Adds the standalone global --workspace-dir/-w option and wires it to FAST_FORWARD_WORKSPACE_DIR before command defaults are resolved.
  • Teaches ManagedWorkspace to resolve output/cache roots from the configured workspace while keeping .dev-tools as the default.
  • Keeps explicit command paths authoritative, including --target, --coverage, --metrics, and --cache-dir.
  • Extends tooling source-scan exclusions and PhpMetrics defaults so a custom relative workspace is not analyzed as project source.
  • Updates README, command docs, usage docs, and tooling defaults to distinguish project root from generated artifact workspace.
  • Adds tests for default workspace behavior, custom relative/absolute workspaces, source-scan exclusions, metrics excludes, and the DevTools global option.

Verification

  • composer dev-tools
  • composer dev-tools:fix
  • composer dev-tools docs
  • Focused command(s): composer dev-tools tests -- --filter='(ManagedWorkspaceTest|WorkingProjectPathResolverTest|DevToolsTest|MetricsCommandTest)'
  • Manual verification: php bin/dev-tools.php --workspace-dir=.artifacts reports --help --no-ansi | rg '\.artifacts|workspace-dir'
  • Manual verification: FAST_FORWARD_WORKSPACE_DIR=.artifacts php bin/dev-tools.php metrics --help --no-ansi | rg '\.artifacts|exclude'
  • Manual verification: confirmed help checks did not create .artifacts

Documentation / Generated Output

  • README updated
  • docs/ updated
  • Generated or synchronized output reviewed

Changelog

  • Added a notable CHANGELOG.md entry

Reviewer Notes

  • --working-dir continues to define where DevTools runs; --workspace-dir only changes generated artifact/cache defaults.
  • Composer plugin usage can use FAST_FORWARD_WORKSPACE_DIR for the same workspace policy because Composer cannot receive DevTools-specific global application options.
  • Existing explicit output/cache options continue to win over workspace defaults.

@github-actions
Copy link
Copy Markdown
Contributor

@coisa coisa merged commit 8c0b865 into main Apr 28, 2026
12 checks passed
@coisa coisa deleted the feature/274-normalize-workspace-dir branch April 28, 2026 21:09
@github-project-automation github-project-automation Bot moved this from Backlog to Released in PHP Fast Forward Project Apr 28, 2026
github-actions Bot added a commit that referenced this pull request Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Released

Development

Successfully merging this pull request may close these issues.

Normalize workspace directory handling for generated DevTools artifacts

1 participant