Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions services/libs/tinybird/pipes/issue_analysis_copy_pipe.pipe
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
DESCRIPTION >
Compacts activities from same issue into one, keeping necessary information in a single row. Helps to serve issue-wide widgets in the development tab.
Compacts activities from same issue into one, keeping necessary information in a single row. Helps to serve issue-wide widgets in the development tab.
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

Line 2 uses a tab indentation under DESCRIPTION >, while other Tinybird pipes in this repo use spaces (e.g., pull_request_analysis_copy_pipe.pipe). Tabs can make diffs noisy and may be interpreted differently by tooling—please switch this to consistent space indentation.

Suggested change
Compacts activities from same issue into one, keeping necessary information in a single row. Helps to serve issue-wide widgets in the development tab.
Compacts activities from same issue into one, keeping necessary information in a single row. Helps to serve issue-wide widgets in the development tab.

Copilot uses AI. Check for mistakes.


NODE issues_opened
SQL >
Expand All @@ -13,24 +14,33 @@ SQL >
memberId,
organizationId
FROM activityRelations_deduplicated_cleaned_bucket_union
WHERE type = 'issues-opened'
WHERE type = 'issues-opened' AND toYear(timestamp) >= 1971
Comment on lines 16 to +17
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

The new toYear(timestamp) >= 1971 predicate is non-sargable in ClickHouse/Tinybird and can prevent partition/primary-key pruning. Prefer a direct range filter like timestamp >= toDateTime('1971-01-01 00:00:00') (or toDate('1971-01-01') if timestamp is a Date) to keep the filter efficient.

Copilot uses AI. Check for mistakes.



NODE issues_closed
SQL >

SELECT sourceParentId, MIN(timestamp) AS closedAt
FROM activityRelations_deduplicated_cleaned_bucket_union
WHERE type = 'issues-closed' AND sourceParentId != ''
WHERE type = 'issues-closed' AND sourceParentId != '' AND toYear(timestamp) >= 1971
GROUP BY sourceParentId
Comment on lines 25 to 27
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

Same as above: toYear(timestamp) >= 1971 is likely to be less efficient than a direct timestamp range predicate. Consider switching this to timestamp >= toDateTime('1971-01-01 00:00:00') for better query pruning.

Copilot uses AI. Check for mistakes.



NODE issues_comment
SQL >

SELECT sourceParentId, MIN(timestamp) AS commentedAt
FROM activityRelations_deduplicated_cleaned_bucket_union
WHERE type = 'issue-comment' AND sourceParentId != '' AND toYear(timestamp) >= 1971
GROUP BY sourceParentId



NODE issue_analysis_results_merged
SQL >

SELECT
opened.id,
opened.sourceId,
Expand Down Expand Up @@ -61,3 +71,5 @@ TYPE COPY
TARGET_DATASOURCE issues_analyzed
COPY_MODE replace
COPY_SCHEDULE 20 * * * *


Loading