roots / roots/wp-packages

Make migrate script (more) idempotent

Open Beginner friendly
#116 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
143
Forks
9
PR merge metrics
No merged PRs in 30d

Description

Summary

Using the migrate-from-wpackagist.sh script multiple times results in the wp-packages repository being added multiple times to repository field in the composer.json.

composer.json after two invocations of migrate-wpackagist.sh:

{
  "repositories": [
    [...]
    {
      "name": "wp-packages",
      "type": "composer",
      "url": "https://repo.wp-packages.org"
    },
    {
      "name": "wp-packages",
      "type": "composer",
      "url": "https://repo.wp-packages.org"
    }
  ],
Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the migrate-from-wpackagist.sh script, called migrate-wpackagist.sh in the example, and inspect how it updates composer.json. Run the migration twice and verify that the wp-packages repository appears only once in the repositories array.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.