fix(dev): address CLI review feedback

This commit is contained in:
Thomas Camlong committed 2026-07-31 14:53:43 +02:00
1 parent e97eb7fc58
commit c8485ed7fc
18 files changed
+307 -160

No files matched your search

+5 -4
View File
@@ -1,6 +1,7 @@
package gh
import (
"context"
"encoding/json"
"fmt"
"os/exec"
@@ -76,8 +77,8 @@ func rollupState(checks []rawCheck) string {
return "SUCCESS"
}
func ListPRs(limit int, includeBots bool) ([]PR, error) {
out, err := exec.Command("gh", "pr", "list",
func ListPRs(ctx context.Context, limit int, includeBots bool) ([]PR, error) {
out, err := exec.CommandContext(ctx, "gh", "pr", "list",
"--repo", Repo,
"--state", "open",
"--limit", fmt.Sprint(limit),
@@ -110,8 +111,8 @@ func ListPRs(limit int, includeBots bool) ([]PR, error) {
return prs, nil
}
func GetPR(number int) (*PR, error) {
out, err := exec.Command("gh", "pr", "view", fmt.Sprint(number),
func GetPR(ctx context.Context, number int) (*PR, error) {
out, err := exec.CommandContext(ctx, "gh", "pr", "view", fmt.Sprint(number),
"--repo", Repo,
"--json", "number,title,author,headRefName,updatedAt,isDraft,statusCheckRollup",
).Output()
+1 -1
View File
@@ -47,7 +47,7 @@ func TestListPRsExcludesBotsIntegration(t *testing.T) {
t.Skip("set HOMARR_INTEGRATION_TEST=1 to query GitHub")
}
prs, err := ListPRs(50, false)
prs, err := ListPRs(t.Context(), 50, false)
if err != nil {
t.Fatal(err)
}