Make migrate script (more) idempotent
Open
Beginner friendly
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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