Skip to content

Add selective phase controls to dev-tools sync #64

@coisa

Description

@coisa

Objective

Add selective execution controls to dev-tools:sync so maintainers can run only specific sync phases, skip selected phases, and configure default sync behavior in composer.json.

Current Limitation

dev-tools:sync currently executes every synchronization phase in a fixed sequence. Consumers cannot persist repository-specific defaults such as skipping wiki setup, running only workflow sync, or enabling overwrite by default.

Proposed Work

Add CLI options and Composer extra configuration for sync phase selection and overwrite defaults.

Supported inputs should include:

  • CLI --only=<phase[,phase...]> to run only selected phases.
  • CLI --skip=<phase[,phase...]> to run all phases except selected phases.
  • Composer extra.dev-tools.sync.only for default selected phases.
  • Composer extra.dev-tools.sync.skip for default skipped phases.
  • Composer extra.dev-tools.sync.overwrite for default overwrite behavior.
  • CLI flags should override Composer defaults for the current run.

Scope

  • Define stable sync phase names for every existing sync step.
  • Validate unknown phase names with clear errors.
  • Decide precedence between CLI options and Composer extra configuration.
  • Make --only and --skip mutually exclusive in a single effective configuration.
  • Preserve current behavior when no options or Composer defaults are configured.
  • Add tests for CLI-only, Composer-only, CLI-overrides-Composer, invalid phase, and overwrite default behavior.

Non-goals

  • Changing the behavior of individual sync phases.
  • Implementing dry-run/check mode; that is tracked separately.
  • Making phase names user-extensible in the first implementation.

Acceptance Criteria

Functional Criteria

  • dev-tools:sync --only=workflows,skills queues only the named phases.
  • dev-tools:sync --skip=wiki,git-hooks queues all phases except the named phases.
  • Composer extra.dev-tools.sync.only and extra.dev-tools.sync.skip are respected when CLI options are absent.
  • Composer extra.dev-tools.sync.overwrite=true makes overwrite-enabled phases overwrite by default.
  • CLI overwrite and phase options override Composer defaults for that run.
  • Invalid phase names produce a clear message and non-zero exit code.

Architectural / Isolation Criteria

  • Sync phase resolution is isolated from SyncCommand orchestration where practical.
  • Phase names are deterministic and covered by tests.
  • The implementation remains compatible with future dry-run/check/status modes.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

Released

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions