{"id":29266637,"url":"https://github.com/spack/migrate-package-prs","last_synced_at":"2025-07-04T16:11:58.200Z","repository":{"id":297588490,"uuid":"997241624","full_name":"spack/migrate-package-prs","owner":"spack","description":"Migrate package PRs from spack/spack to spack/spack-packages","archived":false,"fork":false,"pushed_at":"2025-06-06T09:26:38.000Z","size":5,"stargazers_count":2,"open_issues_count":2,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-27T09:10:39.296Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-06T07:35:30.000Z","updated_at":"2025-06-08T13:21:26.000Z","dependencies_parsed_at":"2025-06-06T09:39:51.937Z","dependency_job_id":null,"html_url":"https://github.com/spack/migrate-package-prs","commit_stats":null,"previous_names":["spack/migrate-package-prs"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/spack/migrate-package-prs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spack%2Fmigrate-package-prs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spack%2Fmigrate-package-prs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spack%2Fmigrate-package-prs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spack%2Fmigrate-package-prs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spack","download_url":"https://codeload.github.com/spack/migrate-package-prs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spack%2Fmigrate-package-prs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263575118,"owners_count":23483012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-04T16:11:57.322Z","updated_at":"2025-07-04T16:11:58.193Z","avatar_url":"https://github.com/spack.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spack Package PR Migration Tool\n\nA command-line tool to copy open package pull requests from `spack/spack` to `spack/spack-packages`.\n\n## Requirements\n\n- `git`\n- `gh` CLI tool (authenticated with GitHub)\n- `jq` for JSON processing\n- Current directory should be a clone of `spack/spack-packages`\n\n## Installation Instructions\n\n1. Either use Spack to install the tool:\n   ```bash\n   spack install migrate-package-prs\n   spack load migrate-package-prs\n   ```\n2. Or, if you already have the `gh` and `jq` utilities, you can simply clone the repository and add\n   it to your PATH.\n   ```bash\n   git clone https://github.com/spack/migrate-package-prs.git\n   export PATH=\"$PWD/migrate-package-prs/bin:$PATH\"\n   ```\n\n## Usage Instructions\n\n1. Clone the new package repository and navigate to it:\n   ```bash\n   git clone https://github.com/spack/spack-packages.git\n   cd spack-packages\n   ```\n\n2. Do a dry-run of the migration tool from within the `spack-packages` directory:\n   ```bash\n   migrate-pkg-prs\n   ```\n\n3. If that looks good, run the tool with the `--migrate` option to create actual PRs:\n   ```bash\n   migrate-pkg-prs --migrate\n   ```\n\n## Command Syntax\n\nFor advanced usage, you can specify options and PR numbers:\n\n```bash\nmigrate-pkg-prs [OPTIONS] [PR_NUMBERS...]\n```\n\n### Arguments\n\n- `PR_NUMBERS` - (Optional) Specific PR numbers to process\n\n### Options\n\n- `--author USER` - Process all open PRs for the specified GitHub user\n- `--migrate` - Create PRs in `spack/spack-packages` (default: local branches only)\n- `-h, --help` - Show help message\n\n### Behavior Rules\n\n- `--author` and `PR_NUMBERS` are mutually exclusive\n- If `PR_NUMBERS` are specified: process only those PRs\n- If `--author` is specified: process all open PRs for that user\n- **If neither: process all open PRs for the currently authenticated GitHub user** (default behavior)\n\n## Examples\n\n### Copy all open PRs for current GitHub user to local branches\n```bash\nmigrate-pkg-prs\n```\n\n### Copy and create PRs in spack/spack-packages\n```bash\nmigrate-pkg-prs --migrate\n```\n\n### Copy all open PRs for a specific user\n```bash\nmigrate-pkg-prs --author johndoe\n```\n\n### Copy specific PRs and create PRs in target repo\n```bash\nmigrate-pkg-prs --migrate 12345 67890\n```\n\n### Copy only a single PR to a local branch\n```bash\nmigrate-pkg-prs 12345\n```\n\n## How It Works\n\n1. **Fetches** the specified PR from `spack/spack`\n2. **Cherry-picks** commits (excluding merges) from the PR\n3. **Creates** a local branch named `spack-pr-{PR_NUMBER}`\n4. **Optionally** creates a new PR in `spack/spack-packages` with the `--migrate` flag\n\n## Branch Naming\n\nLocal branches are created with the format: `spack-pr-{PR_NUMBER}`\n\n## PR Migration\n\nWhen using `--migrate`, the tool:\n- Preserves the original PR title\n- Adds a note to the PR body linking to the original PR\n- Creates the PR against the `develop` branch in `spack/spack-packages`\n\n## Error Handling\n\nThe tool handles various failure scenarios:\n- Failed fetches\n- Cherry-pick conflicts\n- Non-package PRs\n- Branch creation issues\n- Authentication problems\n\nFailed PRs are skipped and reported in the summary.\n\n## Authentication\n\nEnsure you're authenticated with GitHub CLI:\n```bash\ngh auth login\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspack%2Fmigrate-package-prs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspack%2Fmigrate-package-prs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspack%2Fmigrate-package-prs/lists"}