-
Notifications
You must be signed in to change notification settings - Fork 727
chore(tinybird): update tinybird pipes to use repositories [CM-902] #3769
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
chore(tinybird): update tinybird pipes to use repositories [CM-902] #3769
Conversation
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
2 similar comments
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
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.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
| IN {{ Array(repos, 'String', description="Filter activity repo list", required=False) }} | ||
| {% else %} | ||
| AND pra.channel IN (SELECT repository FROM segmentRepositories where excluded = false) | ||
| AND pra.channel IN (SELECT url FROM repositories FINAL where excluded = false) |
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.
Missing NULL handling for excluded column filtering
Medium Severity
The query filters repositories with where excluded = false, but all other queries in this PR use WHERE (r.excluded IS NULL OR r.excluded = false). Repositories where excluded is NULL will be incorrectly filtered out in pull request queries, while they're correctly included in activity relations and security queries. This inconsistency causes different behavior for the same data.
| FROM segmentRepositories sr FINAL | ||
| WHERE (sr.excluded IS NULL OR sr.excluded = false) | ||
| FROM repositories r FINAL | ||
| WHERE (r.excluded IS NULL OR r.excluded = false) |
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.
Missing deletedAt filter for soft-deleted repositories
High Severity
The repositories table has a deletedAt column for soft-deletes (which segmentRepositories lacked), but the migrated queries only filter by excluded status. The PR description explicitly states queries should filter "where deletedAt is null", but this filter is missing from all updated queries. Soft-deleted repositories will incorrectly appear in analytics results, activity relations, pull request filtering, and security evaluations.
This pull request updates several SQL pipeline files to replace usage of the
segmentRepositoriestable with the newerrepositoriestable. The changes standardize repository lookups, simplify queries, and ensure consistent filtering of repositories based on theirexcludedandarchivedstatus. These updates affect activity relation, monitoring, insights, and pull request filtering pipelines.Repository Table Migration and Query Simplification:
Replaced all references to
segmentRepositorieswithrepositoriesinactivityRelations_bucket_clean_enrich_copy_pipe_0.pipethroughactivityRelations_bucket_clean_enrich_copy_pipe_9.pipeto standardize repository filtering byexcludedstatus. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Simplified repository filtering in
activityRelations_deduplicated_cleaned_copy_pipe.pipeandactivityRelations_enrich_clean_initial_snapshot.pipeby directly queryingurlfromrepositorieswheredeletedAtis null, removing the need for segment-based joins. [1] [2]Monitoring and Insights Pipeline Updates:
Updated
monitoring_entities.pipeto monitor therepositoriestable instead ofsegmentRepositories, including renaming nodes and updating metrics queries. [1] [2]Modified
insights_projects_populated_copy.pipeto useurlfromrepositoriesfor grouping archived and excluded repositories, instead of the oldrepositoryfield.Pull Request and Security Filtering:
Updated
pull_requests_filtered.pipeto filter byurlfromrepositoriesfor non-excluded repositories, replacing the previous segment-based filtering.Changed
security_deduplicated_merged_copy_pipe.pipeto filter byinsightsProjectIdfromrepositoriesinstead ofsegmentRepositories, ensuring only non-excluded repositories are considered.Note
Standardizes repository sourcing by migrating pipes from
segmentRepositoriestorepositories, aligning filters toexcluded=falseand usingurlwhere applicable.activityRelations_*copy/enrich pipes (0–9, dedup, initial snapshot) to filter bysegmentIdpresent inrepositoriesrather thansegmentRepositoriesSELECT url FROM repositories WHERE excluded = falseinpull_requests_filtered.piperepositories(url) ininsights_projects_populated_copy.pipe; also filters out deletedcollectionsInsightsProjectsrowsrepositories(renamed node and query) inmonitoring_entities.pipeinsightsProjectIdvia non-excludedrepositoriesinsecurity_deduplicated_merged_copy_pipe.pipeWritten by Cursor Bugbot for commit 36d057c. This will update automatically on new commits. Configure here.