From 25e39843e8a2c8a54a509af0ecd0f297513cf60f Mon Sep 17 00:00:00 2001 From: ismail simsek Date: Fri, 19 Sep 2025 17:43:30 +0200 Subject: [PATCH 1/4] add updatedAt time field to pull requests --- pkg/models/pull_requests.go | 4 +++- src/constants.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/models/pull_requests.go b/pkg/models/pull_requests.go index c0e8e097..33001f89 100644 --- a/pkg/models/pull_requests.go +++ b/pkg/models/pull_requests.go @@ -10,12 +10,14 @@ const ( PullRequestCreatedAt // PullRequestMergedAt is used when filtering when a Pull Request was merged PullRequestMergedAt + // PullRequestUpdatedAt is used when filtering when a Pull Request was updated + PullRequestUpdatedAt // 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 PullRequestNone ) func (d PullRequestTimeField) String() string { - return [...]string{"closed", "created", "merged"}[d] + return [...]string{"closed", "created", "merged", "updated"}[d] } // ListPullRequestsOptions are the available options when listing pull requests in a time range diff --git a/src/constants.ts b/src/constants.ts index a141e8cc..bbd2d559 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -38,6 +38,7 @@ export enum PullRequestTimeField { ClosedAt, CreatedAt, MergedAt, + UpdatedAt, None, } From 789a0ee2bc478cf553ab721a93954b03bb7bc1c3 Mon Sep 17 00:00:00 2001 From: ismail simsek Date: Fri, 19 Sep 2025 17:47:13 +0200 Subject: [PATCH 2/4] yarn changeset --- .changeset/proud-items-compare.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/proud-items-compare.md diff --git a/.changeset/proud-items-compare.md b/.changeset/proud-items-compare.md new file mode 100644 index 00000000..8b234651 --- /dev/null +++ b/.changeset/proud-items-compare.md @@ -0,0 +1,5 @@ +--- +'grafana-github-datasource': minor +--- + +Add UpdatedAt time field to pull request queries From eab313cb2419e1b236d76589a509bd621eb2447e Mon Sep 17 00:00:00 2001 From: ismail simsek Date: Tue, 30 Sep 2025 15:41:49 +0200 Subject: [PATCH 3/4] try to fix e2e --- tests/QueryEditor.spec.ts | 2 +- tests/mocks/github-response.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/QueryEditor.spec.ts b/tests/QueryEditor.spec.ts index 4650ae08..e524ad69 100644 --- a/tests/QueryEditor.spec.ts +++ b/tests/QueryEditor.spec.ts @@ -21,5 +21,5 @@ test('QueryEditor smoke test', async ({ panelEditPage, page }) => { await panelEditPage.getByGrafanaSelector(components.QueryEditor.Repository.input).fill('grafana-github-datasource'); await panelEditPage.refreshPanel(); - await expect(page.getByRole('cell', { name: 'grafana-github-datasource v1.5.7' })).toBeVisible(); + await expect(page.getByRole('cell', { name: 'grafana-github-datasource v2.2.0' })).toBeVisible(); }); diff --git a/tests/mocks/github-response.ts b/tests/mocks/github-response.ts index d55c6e7c..40ca9332 100644 --- a/tests/mocks/github-response.ts +++ b/tests/mocks/github-response.ts @@ -69,12 +69,12 @@ export const githubResponse = { }, data: { values: [ - ['grafana-github-datasource v1.5.7'], + ['grafana-github-datasource v2.2.0'], ['grafanabot'], [false], [false], - ['v1.5.7'], - ['https://github.com/grafana/github-datasource/releases/tag/v1.5.7'], + ['v2.2.0'], + ['https://github.com/grafana/github-datasource/releases/tag/v2.2.0'], [1713519461000], [1713519486000], ], From 9d08936ffd296553a3cb942dfbbe93e2c416e9b3 Mon Sep 17 00:00:00 2001 From: ismail simsek Date: Mon, 6 Oct 2025 15:51:01 +0200 Subject: [PATCH 4/4] revert mock response --- tests/mocks/github-response.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/mocks/github-response.ts b/tests/mocks/github-response.ts index 40ca9332..d55c6e7c 100644 --- a/tests/mocks/github-response.ts +++ b/tests/mocks/github-response.ts @@ -69,12 +69,12 @@ export const githubResponse = { }, data: { values: [ - ['grafana-github-datasource v2.2.0'], + ['grafana-github-datasource v1.5.7'], ['grafanabot'], [false], [false], - ['v2.2.0'], - ['https://github.com/grafana/github-datasource/releases/tag/v2.2.0'], + ['v1.5.7'], + ['https://github.com/grafana/github-datasource/releases/tag/v1.5.7'], [1713519461000], [1713519486000], ],