Skip to content

fix: exclude disabled projects from collection queries#1996

Open
joanagmaia wants to merge 2 commits into
mainfrom
fix/IN-exclude-disabled-projects-collections
Open

fix: exclude disabled projects from collection queries#1996
joanagmaia wants to merge 2 commits into
mainfrom
fix/IN-exclude-disabled-projects-collections

Conversation

@joanagmaia

Copy link
Copy Markdown
Collaborator

Summary

  • insightsProjects.enabled was not checked in any CommunityCollectionRepository queries — disabled projects appeared in collection listings and were passed as IDs to Tinybird
  • Added AND ip.enabled = true on all JOIN conditions to insightsProjects (3 list queries + findProjectIdsBySlug which feeds project_repo_insights.json)

Related

Complements crowd.dev PR #4313 which adds enabled = 1 gates 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 patched

Test plan

  • Verify a disabled project no longer appears in collection detail page (/collection/details/:slug)
  • Verify collection list pages no longer show disabled projects in project counts
  • Verify enabled projects still appear correctly

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings July 7, 2026 12:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 = true to the three collection-listing queries' joins to insightsProjects (findAll-style list, findBySlug, findBySsoUserId).
  • Rewrote findProjectIdsBySlug to inner-JOIN insightsProjects with enabled = true so disabled project IDs are excluded from the set fed to project_repo_insights.json.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/server/repo/communityCollection.repo.ts Outdated
Comment thread frontend/server/repo/communityCollection.repo.ts Outdated
Comment thread frontend/server/repo/communityCollection.repo.ts Outdated
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>
@joanagmaia joanagmaia requested a review from gaspergrom July 7, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants