-
Notifications
You must be signed in to change notification settings - Fork 3
feat: get list streams #875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces the new action "list_streams" along with its utility functions and tests to enable listing streams with support for parameters such as limit, offset, and order_by.
- Added ListStreamsInput struct and ListStreams function in the procedure utilities.
- Added a new test function testListStreams to validate the list_streams action.
- Adjusted test configuration to include the new test.
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
tests/streams/utils/procedure/execute.go | Implements the ListStreams function and supporting input struct for the new list_streams action |
tests/streams/query/query_test.go | Introduces testListStreams to validate the list_streams action via a markdown table assertion |
Files not reviewed (1)
- internal/migrations/001-common-actions.sql: Language not supported
expected := fmt.Sprintf(` | ||
| data_provider | stream_id | stream_type | created_at | | ||
|---------------|-----------|-------------|------------| | ||
| %s | %s | primitive | 1 | | ||
| %s | %s | composed | 1 | | ||
| %s | %s | primitive | 1 | | ||
`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The multi-line raw string literal used for the expected markdown table is indented, which may introduce unintended leading whitespace that could cause the table assertion to fail; consider removing or trimming the indentation.
expected := fmt.Sprintf(` | |
| data_provider | stream_id | stream_type | created_at | | |
|---------------|-----------|-------------|------------| | |
| %s | %s | primitive | 1 | | |
| %s | %s | composed | 1 | | |
| %s | %s | primitive | 1 | | |
`, | |
expected := strings.TrimSpace(fmt.Sprintf(` | |
| data_provider | stream_id | stream_type | created_at | | |
|---------------|-----------|-------------|------------| | |
| %s | %s | primitive | 1 | | |
| %s | %s | composed | 1 | | |
| %s | %s | primitive | 1 | | |
`, |
Copilot uses AI. Check for mistakes.
@Copilot |
Description
This pull request introduces a new action
list_streams
and adds corresponding tests and utility functions to support it. The primary focus is on enabling the listing of streams with various parameters such as limit, offset, and order_by.New Action and Utility Functions:
internal/migrations/001-common-actions.sql
: Added thelist_streams
action to list streams with parameters for data provider, limit, offset, and order_by. This action includes validation for the limit parameter and default values for limit, offset, and order_by.tests/streams/utils/procedure/execute.go
: Added theListStreamsInput
struct and theListStreams
function to execute thelist_streams
action and process the result rows.Test Enhancements:
tests/streams/query/query_test.go
: Added a new test functiontestListStreams
to validate thelist_streams
action and included it in theTestQueryStream
test suite. [1] [2]Related Problem
resolves: #871
How Has This Been Tested?