Conversation
gaspergrom
approved these changes
Feb 3, 2026
| isNull (deletedAt) | ||
| isNull(i.deletedAt) | ||
| AND isNull(r.deletedAt) | ||
| AND r.enabled = true |
There was a problem hiding this comment.
Missing excluded filter when joining repositories table
Medium Severity
The new queries joining the repositories table are missing the r.excluded = false filter. The repositories table has both excluded and enabled fields with distinct meanings. The established pattern in segments_filtered.pipe (the core project context provider) and activityRelations_bucket_clean_enrich_copy_pipe_*.pipe files includes all three filters: isNull(r.deletedAt), r.excluded = false, and r.enabled = true. Without the excluded filter, these queries may return repositories that are explicitly marked as excluded from processing.
Additional Locations (2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This pull request updates several SQL pipes in the
services/libs/tinybird/pipesdirectory to improve data integrity and filtering for project repositories. The main changes ensure that only enabled and non-deleted repositories are included, and they clarify joins and field references for better consistency across pipes.Repository Filtering and Join Improvements:
insightsProjectsandrepositoriesusing explicitON r.insightsProjectId = i.idsyntax, ensuring correct project-repository associations. [1] [2] [3]isNull(i.deletedAt)andisNull(r.deletedAt)) and to include only enabled repositories (r.enabled = true). [1] [2] [3]Field Reference Updates:
repotor.urlfor clarity and consistency. Also updated output field names fromrepotorepositorywhere applicable. [1] [2] [3]Parameter Filtering Consistency:
r.urlinstead ofrepo) in conditional logic for project and repository selection.These changes help ensure that queries only return relevant, active repositories and projects, and that joins are performed correctly for more reliable data.
Note
Medium Risk
Query semantics change to exclude disabled/deleted repositories and to use a different join path, which may change counts and results in downstream metrics/copies if data is inconsistent or expectations relied on the old array field.
Overview
Updates several Tinybird pipes to stop reading repository URLs via the deprecated
insightsProjects.reposarray and instead joininsightsProjectstorepositoriesviar.insightsProjectId = i.id.Tightens repository selection by filtering out deleted projects/repos and excluding disabled repos (
isNull(i.deletedAt),isNull(r.deletedAt),r.enabled = true), and updates downstream filters/fields to user.urlconsistently.Written by Cursor Bugbot for commit d831a09. This will update automatically on new commits. Configure here.