Skip to content

Fix operators for state#720

Merged
aangelisc merged 1 commit intomainfrom
andreas/update-schema
Apr 10, 2026
Merged

Fix operators for state#720
aangelisc merged 1 commit intomainfrom
andreas/update-schema

Conversation

@aangelisc
Copy link
Copy Markdown
Contributor

The state operator for pull requests doesn't work as we expect so we will filter in the SQL engine instead.

Copilot AI review requested due to automatic review settings April 9, 2026 17:53
@aangelisc aangelisc requested a review from a team as a code owner April 9, 2026 17:53
@github-project-automation github-project-automation bot moved this to Backlog in OSS Big Tent Apr 9, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the GitHub datasource schema for the pull-requests table to avoid using the state column’s operators for pushdown filtering, since PR state filtering via the existing operator/pushdown path is not behaving as expected.

Changes:

  • Removed explicit Operators: equalityOperators from pull-requests.state schema column so filtering can be handled in the SQL engine instead.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

{Name: "deletions", Type: schemas.ColumnTypeInt64},
{Name: "repository", Type: schemas.ColumnTypeString},
{Name: "state", Type: schemas.ColumnTypeEnum, Values: []string{"OPEN", "CLOSED", "MERGED"}, Operators: equalityOperators},
{Name: "state", Type: schemas.ColumnTypeEnum, Values: []string{"OPEN", "CLOSED", "MERGED"}},
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing Operators: equalityOperators here likely disables filter pushdown for PR state (so filtering happens in the SQL engine instead). That can significantly increase GitHub search result sizes/API usage (and rate-limit risk) for common queries; consider instead mapping the enum values to the correct GitHub search qualifiers (e.g., is:open, is:closed, is:merged) so state filtering can still be pushed down efficiently. If pushdown is intentionally disabled, add a short inline comment explaining why this column intentionally omits Operators to prevent someone from reintroducing the broken behavior later.

Suggested change
{Name: "state", Type: schemas.ColumnTypeEnum, Values: []string{"OPEN", "CLOSED", "MERGED"}},
{Name: "state", Type: schemas.ColumnTypeEnum, Values: []string{"OPEN", "CLOSED", "MERGED"}, Operators: equalityOperators},

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would do this but passing is:closed to GitHub also returns merged PRs 😞

@aangelisc aangelisc merged commit 772dbc9 into main Apr 10, 2026
28 checks passed
@aangelisc aangelisc deleted the andreas/update-schema branch April 10, 2026 10:17
@github-project-automation github-project-automation bot moved this from Backlog to Complete in OSS Big Tent Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

3 participants