Skip to content

Commit 7473dd2

Browse files
authored
fix: exclude archived from TotalCount (#757)
1 parent c18425d commit 7473dd2

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

docs/src/content/docs/configuration/issue-section.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ the issues view.
2929
This setting defines the [GitHub search filters][01] for the Issues in the section's table.
3030

3131
Don't specify `is:issue` for this setting. The dashboard always adds that filter for Issues
32-
sections.
32+
sections.
33+
34+
Note issues from archived repositories are excluded by default with `archived:false`.
3335

3436
You can define any combination of search filters. To make it easier to read and maintain
3537
your filters, we recommend using the `>-` syntax after the `filter` key and writing one

docs/src/content/docs/configuration/pr-section.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ This setting defines the [GitHub search filters][01] for the PRs in the section'
3131
Don't specify `is:pr` for this setting. The dashboard always adds that filter for PR
3232
sections.
3333

34+
Note pull requests from archived repositories are excluded by default with `archived:false`.
35+
3436
You can define any combination of search filters. To make it easier to read and maintain
3537
your filters, we recommend using the `>-` syntax after the `filter` key and writing one
3638
filter per line.

docs/src/content/docs/configuration/searching.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ prsSections:
2424
```
2525
2626
Note: don't specify `is:pr` for this setting. The dashboard always adds that filter for PR
27-
sections.
27+
sections. Results from archived repositories are excluded by default with `archived:false`.
2828

2929
You can define any combination of search filters. To make it easier to read and maintain
3030
your filters, we recommend using the `>-` syntax after the `filter` key and writing one

internal/data/issueapi.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (data IssueData) GetCreatedAt() time.Time {
9191
}
9292

9393
func makeIssuesQuery(query string) string {
94-
return fmt.Sprintf("is:issue %s sort:updated", query)
94+
return fmt.Sprintf("is:issue archived:false %s sort:updated", query)
9595
}
9696

9797
func FetchIssues(query string, limit int, pageInfo *PageInfo) (IssuesResponse, error) {
@@ -131,9 +131,6 @@ func FetchIssues(query string, limit int, pageInfo *PageInfo) (IssuesResponse, e
131131

132132
issues := make([]IssueData, 0, len(queryResult.Search.Nodes))
133133
for _, node := range queryResult.Search.Nodes {
134-
if node.Issue.Repository.IsArchived {
135-
continue
136-
}
137134
issues = append(issues, node.Issue)
138135
}
139136

internal/data/prapi.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ func (e EnrichedPullRequestData) ToPullRequestData() PullRequestData {
430430
}
431431

432432
func makePullRequestsQuery(query string) string {
433-
return fmt.Sprintf("is:pr %s sort:updated", query)
433+
return fmt.Sprintf("is:pr archived:false %s sort:updated", query)
434434
}
435435

436436
type PullRequestsResponse struct {
@@ -492,9 +492,6 @@ func FetchPullRequests(query string, limit int, pageInfo *PageInfo) (PullRequest
492492

493493
prs := make([]PullRequestData, 0, len(queryResult.Search.Nodes))
494494
for _, node := range queryResult.Search.Nodes {
495-
if node.PullRequest.Repository.IsArchived {
496-
continue
497-
}
498495
prs = append(prs, node.PullRequest)
499496
}
500497

0 commit comments

Comments
 (0)