Skip to content

Synchronize Funding metadata during dev-tools sync #56

@coisa

Description

@coisa

Objective

Synchronize funding metadata between .github/FUNDING.yml and the Composer funding property during dev-tools:sync.

Current Limitation

Fast Forward repositories can declare sponsorship information in GitHub's .github/FUNDING.yml file or in composer.json under funding, but dev-tools:sync does not currently reconcile these sources. When only one file is updated, the other can become stale or incomplete.

Proposed Work

Add sync support that reads funding entries from both .github/FUNDING.yml and composer.json, merges the supported entries, and writes the missing values back to both files while preserving the expected format for each file.

Scope

  • Support at least GitHub Sponsors entries from github in .github/FUNDING.yml.
  • Support custom funding links from custom in .github/FUNDING.yml.
  • Support Composer funding entries that correspond to GitHub Sponsors and custom funding URLs.
  • If only .github/FUNDING.yml exists, populate missing composer.json funding entries from it.
  • If only composer.json has funding, create or update .github/FUNDING.yml from it.
  • If both exist, merge all supported entries so both files contain the same logical records.
  • Preserve existing unsupported funding providers without deleting them.
  • Avoid duplicate entries when sync runs repeatedly.

Non-goals

  • Supporting every GitHub Funding provider in the first implementation.
  • Removing existing funding entries.
  • Changing package metadata unrelated to funding.
  • Reformatting composer.json beyond the funding property update required for sync.

Acceptance Criteria

Delivery Criteria

  • dev-tools:sync synchronizes GitHub Sponsors entries between .github/FUNDING.yml github and Composer funding records.
  • dev-tools:sync synchronizes custom funding URLs between .github/FUNDING.yml custom and Composer funding records.
  • Missing entries from either source are added to the other source.
  • Running sync repeatedly is idempotent and does not duplicate funding records.
  • Existing unsupported funding providers are preserved.
  • Tests cover sync from Funding YAML only, Composer funding only, both files with different entries, and idempotent repeated sync.

Architectural / Isolation Criteria

  • Funding parsing, merging, and rendering are isolated from command orchestration.
  • SyncCommand remains orchestration-focused and delegates funding synchronization to dedicated services or commands.
  • File writes use existing repository filesystem abstractions where practical.
  • The implementation keeps deterministic output ordering for stable diffs.

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