Skip to content

Commit 31ea30a

Browse files
authored
Add updatedAt time field to pull request queries (#507)
<img width="1063" height="549" alt="grafik" src="https://github.com/user-attachments/assets/933e40fd-b064-4fb5-b407-a06319b903a0" /> Fixes: #506
1 parent 450d3ca commit 31ea30a

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

.changeset/proud-items-compare.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'grafana-github-datasource': minor
3+
---
4+
5+
Add UpdatedAt time field to pull request queries

pkg/models/pull_requests.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ const (
1010
PullRequestCreatedAt
1111
// PullRequestMergedAt is used when filtering when a Pull Request was merged
1212
PullRequestMergedAt
13+
// PullRequestUpdatedAt is used when filtering when a Pull Request was updated
14+
PullRequestUpdatedAt
1315
// PullRequestNone is used when the results are not filtered by time. Without any other filters, using this could easily cause an access token to be rate limited
1416
PullRequestNone
1517
)
1618

1719
func (d PullRequestTimeField) String() string {
18-
return [...]string{"closed", "created", "merged"}[d]
20+
return [...]string{"closed", "created", "merged", "updated"}[d]
1921
}
2022

2123
// ListPullRequestsOptions are the available options when listing pull requests in a time range

src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export enum PullRequestTimeField {
3838
ClosedAt,
3939
CreatedAt,
4040
MergedAt,
41+
UpdatedAt,
4142
None,
4243
}
4344

0 commit comments

Comments
 (0)