{"id":20099023,"url":"https://github.com/spack/gh-spack-pr","last_synced_at":"2026-01-30T19:02:25.395Z","repository":{"id":258118265,"uuid":"866665289","full_name":"spack/gh-spack-pr","owner":"spack","description":"GitHub CLI extension for spack and tools for building pull requests when reviewing them, etc","archived":false,"fork":false,"pushed_at":"2024-11-13T01:50:56.000Z","size":185,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-06T06:46:02.730Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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":"2024-10-02T16:57:13.000Z","updated_at":"2024-11-13T01:51:00.000Z","dependencies_parsed_at":"2025-05-06T06:34:40.005Z","dependency_job_id":"3d72888e-72b4-4922-8c01-eeeac26a24b6","html_url":"https://github.com/spack/gh-spack-pr","commit_stats":null,"previous_names":["spack/build-quality-tools"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/spack/gh-spack-pr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spack%2Fgh-spack-pr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spack%2Fgh-spack-pr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spack%2Fgh-spack-pr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spack%2Fgh-spack-pr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spack","download_url":"https://codeload.github.com/spack/gh-spack-pr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spack%2Fgh-spack-pr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28917454,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T16:37:38.804Z","status":"ssl_error","status_checked_at":"2026-01-30T16:37:37.878Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2024-11-13T17:07:49.782Z","updated_at":"2026-01-30T19:02:25.379Z","avatar_url":"https://github.com/spack.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ✨ GitHub CLI extension `spack-pr`\n\n## 🌅 Proof of concept for complimenting CI with building changed packages\n\n- Exclusively aimed at building changed recipes (and related packages, e.g. dependents)\n- Most specifically aimed at packages labelled by @spackbot with `new-package` or `new-variant`.\n\nFor an introduction to the proof of concept see the specific README: [cli/README.md](cli/README.md)\n\n## 🌅 Introduction on using the GitHub CLI (`gh`)\n\nGitHub has a public API that you can use to work with pull requests.\n\nIt can be used to submit (for example) build results of PRs.\n\nThis extension to the GitHub CLI does exactly that:\n\n- It helps with checking out PRs to review and check if they work.\n- You can use `gh pr checkout \u003cPR number\u003e` to checkout a PR\n- Or, you can pass a keyword from the PR's title to check out the PR.\n- Or, you can check a list of PRs by creating a file with PRs to build.\n- If all goes well, you get a summary of building all specs changed in the PR\n- If that looks fine, you can submit it to the PR as a comment (work in progress)\n- If builds fail, you can examine the cause and submit the failure likewise.\n\nQuick start:\n\n- Install `gh` using `spack install gh` or any other means: \u003chttp://cli.github.com\u003e\n- Run `gh auth login`: The URL it tries to open into your browser and login\n- Then you can install the `spack-pr` extension: `gh extension install spack/gh-spack-pr`\n\nUsing `gh` your `spack` checkout directory:\n\n- Run `gh pr checkout \u003cPR number\u003e` for checking out a PR to review.\n- Run `gh pr review --approve -b \"Tested in my environment\"` to approve a PR\n- Run `gh pr merge --auto --squash` to merge it (enables auto-merge if not ready yet)\n- Get a list of PRs that need review, are not drafts, have no assignee, are not failed\n  do not have a number o labels, are not reviewed by me and have maximum comment:\n\n  ```py\n  gh pr list -L9 --search 'review:required draft:false no:assignee -status:failure -label:changes-requested -label:waiting-on-maintainer -label:waiting-on-dependency -label:question updated:\u003e=2024-05-01' `\n  ```\n\n  The output of this command can be edited by removing PRs\n  that are not safe to approve if all builds pass the reviewed\n  file can be passed to `build_pr_changes.py`:\n\n  ```py\n  gh pr list -L42 --search 'review:required draft:false no:assignee -status:failure -label:changes-requested -label:waiting-on-maintainer -label:waiting-on-dependency -label:question updated:\u003e=2024-05-01' \u003erecent-pr-queue.txt\n  gh-spack-pr/build_pr_changes.py -q recent-pr-queue.txt -mar\n  ```\n\n  This will attempt to build all changed specs that were detected\n  from the `gh pr diff` of each queued PR.\n\n  For each PR that was able to build each discovered spec,\n  if the `-a|--approve` flag is given, it will approve the PR\n  or will ask if changes shall be requested for each failure.\n\n  The change request will include the build error from spack.\n\n  If the approve was successful and no other reviewer requested\n  changes, it will ask if you want to merge the PR.\n\n## 📝 Tools for checking pull request quality\n\n### Helpful shortcuts (aliases) for `gh`\n\n- `co`: Checkout a PR branch using fzf (select from list)\n\n  ```py\n  gh alias set co --shell 'id=\"$(gh pr list -L60 | fzf | cut -f1)\"; [ -n \"$id\" ] \u0026\u0026 gh pr checkout \"$id\"'\n  ```\n\n- `review`: Find and check PRs that need review\n\n  ```py\n  gh alias set review --shell 'id=\"$(gh pr list -L20 -S \"review:required draft:false no:assignee -status:failure -label:changes-requested -label:waiting-on-maintainer -label:waiting-on-dependency\"|fzf|cut -f1)\"; [ -n \"$id\" ] \u0026\u0026 gh pr checkout $id \u0026\u0026 gh pr view -c \u0026\u0026 gh pr diff'\n  ```\n\n### ⚡️ [`build_pr_changes.py`](build_pr_changes.py)\n\nRun the script\n[build_pr_changes.py](build_pr_changes.py)\nfound in this repository to install the changes of the PR checked out.\n\nIt depends on `gh` to be set up and the PR checked out with `gh pr checkout \u003cPR number\u003e`.\nWith it, it:\n\n- Gets the PR diff using `gh pr diff`\n- Looks for changed and new versions in the PR diff to install\n- Looks for changed and new variants in the PR diff to install\n- Checks the checksums of all changed and new versions before the build.\n- Can also build all versions of recipes if indicated.\n- Build each version and variant found from the diff and report the result.\n- The result is ready to be pasted into a Pull request review.\n- In the future, it could even submit the review directly using the `gh` CLI.\n\n## 🪟 `gh dash`\n\n✨ A GitHub (`gh`) CLI extension to display a dashboard with\n**pull requests** and **issues** by\n[GitHub filters](https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests)\nyou care about.\n\nIt can be configured for the needs of spack\n[spack pull requests](https://github.com/spack/spack/pulls) as well.\n\nUsing the example configuration, the key binding `b` checks out the\nselected PR, and starts a sub-shell.\n\nIn the shell with the PR checked out, you can run\n[build_pr_changes.py](build_pr_changes.py) to build the PR and submit the results.\n\nSee [tools/gh-dash/README.md](cli-extensions/gh-dash/README.md) for an introduction.\n\n\u003cimg src=\"https://user-images.githubusercontent.com/6196971/198704107-6775a0ba-669d-418b-9ae9-59228aaa84d1.gif\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspack%2Fgh-spack-pr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspack%2Fgh-spack-pr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspack%2Fgh-spack-pr/lists"}