fix: exclude disabled projects from collection queries#1996
Open
joanagmaia wants to merge 2 commits into
Open
Conversation
Filter insightsProjects by enabled = true in all CommunityCollectionRepository queries so disabled projects are not surfaced in collection listings or passed as IDs to Tinybird. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to stop disabled insightsProjects from appearing in CommunityCollectionRepository query results, so that disabled project IDs are never surfaced in collection listings or forwarded to Tinybird. It complements the crowd.dev-side change (PR #4313) that gates Tinybird pipes on enabled = 1, closing the Postgres side of the same concern.
Changes:
- Added
AND ip.enabled = trueto the three collection-listing queries' joins toinsightsProjects(findAll-style list,findBySlug,findBySsoUserId). - Rewrote
findProjectIdsBySlugto inner-JOINinsightsProjectswithenabled = trueso disabled project IDs are excluded from the set fed toproject_repo_insights.json.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
LEFT JOIN with enabled = true only nulls ip columns — disabled rows still returned. Switch all three list queries to INNER JOIN so disabled projects are fully excluded from results and project counts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
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.
Summary
insightsProjects.enabledwas not checked in anyCommunityCollectionRepositoryqueries — disabled projects appeared in collection listings and were passed as IDs to TinybirdAND ip.enabled = trueon all JOIN conditions toinsightsProjects(3 list queries +findProjectIdsBySlugwhich feedsproject_repo_insights.json)Related
Complements crowd.dev PR #4313 which adds
enabled = 1gates to Tinybird pipes. This PR closes the Postgres side so disabled project IDs are never sent to Tinybird in the first place.Files changed
frontend/server/repo/communityCollection.repo.ts— 4 queries patchedTest plan
/collection/details/:slug)🤖 Generated with Claude Code