8000 feat: get list streams by MicBun · Pull Request #875 · trufnetwork/node · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 1 commit into from
Mar 31, 2025
Merged

feat: get list streams #875

merged 1 commit into from
Mar 31, 2025

Conversation

MicBun
Copy link
Member
@MicBun MicBun commented Mar 31, 2025

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 the list_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 the ListStreamsInput struct and the ListStreams function to execute the list_streams action and process the result rows.

Test Enhancements:

Related Problem

resolves: #871

How Has This Been Tested?

@MicBun MicBun added the type: feat New feature or request label Mar 31, 2025
@MicBun MicBun requested review from outerlook and Copilot March 31, 2025 06:06
@MicBun MicBun self-assigned this Mar 31, 2025
Copy link
@Copilot 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

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

Comment on lines +766 to +772
expected := fmt.Sprintf(`
| data_provider | stream_id | stream_type | created_at |
|---------------|-----------|-------------|------------|
| %s | %s | primitive | 1 |
| %s | %s | composed | 1 |
| %s | %s | primitive | 1 |
`,
Copy link
Preview
Copilot AI Mar 31, 2025

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.

Suggested change
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.

Copy link
pr-time-tracker bot commented Mar 31, 2025

@Copilot
@outerlook
⚠️⚠️⚠️
You must submit the time spent on this PR.
⚠️⚠️⚠️

@MicBun MicBun merged commit e7e0b60 into refactor/node-2.0 Mar 31, 2025
3 of 6 checks passed
@MicBun MicBun deleted the feat/listStreams branch March 31, 2025 11:21
@MicBun MicBun linked an issue Apr 1, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feat New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem: missing a way to list stream
2 participants
0