feat: resolveproject group in the segments middleware (CM-189)#4011
feat: resolveproject group in the segments middleware (CM-189)#4011
Conversation
|
|
There was a problem hiding this comment.
Pull request overview
This PR updates segment scoping so the frontend can send project group (non-leaf) segment IDs, and the backend middleware will resolve them into leaf sub-project segments for downstream queries.
Changes:
- Backend: enhance
segmentMiddlewareto expand non-leaf segment IDs into active leaf sub-project segments. - Frontend: stop expanding project groups into subproject segments in a few call sites and instead pass
[projectGroup.id]. - Frontend: adjust organization merge suggestions calls to use the selected project group ID.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/modules/organization/services/organization.api.service.ts | Uses selected project group ID(s) for merge suggestions / create payloads. |
| frontend/src/modules/organization/organization-service.js | Sends only selected project group ID for merge suggestions. |
| frontend/src/modules/lf/layout/components/lf-banners.vue | Integration listing now scoped by [projectGroup.id]. |
| frontend/src/modules/activity/components/activity-timeline.vue | Activity query now scoped by selected project group ID when no explicit segment is selected. |
| backend/src/middlewares/segmentMiddleware.ts | Resolves provided segment IDs to leaf sub-project segments before attaching req.currentSegments. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
765829e to
9d33a06
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ee72d68 to
5faf875
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9a013b6 to
e58e568
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
22ad67d to
2ded93e
Compare
Note
Medium Risk
Changes request segment scoping by allowing project group/project IDs to be expanded to leaf subprojects server-side, which can affect data visibility and query results across many endpoints. Also adjusts activity querying and Tinybird parameter handling, with moderate risk of pagination/count discrepancies if segment expansion/capping is incorrect.
Overview
Segments handling is centralized in the backend.
segmentMiddlewarenow ignoresreq.params, safely parsessegmentsfrom query/body, and resolves any non-leaf segment IDs (project group/project) into their active leaf subprojects before settingcurrentSegments.Frontend requests are simplified to pass project-group IDs. Multiple views (activity timeline, member/org lists, banners, filters, and the Axios interceptor) stop expanding project groups into subproject IDs client-side and instead send
[selectedProjectGroup.id], relying on the middleware for expansion; the activity timeline also guards invalidjoinedAttimestamps and can send an empty segments array.Activity/Tinybird querying is hardened. The activities SQL path switches the count call to
pipeSql, Tinybird activity params now cap thesegmentsarray (with a warning) to avoid Tinybird 400s on large groups, and Tinybird client logs non-retriable error details; noisy advanced-query cache info logs were removed for members/orgs background refreshes.Reviewed by Cursor Bugbot for commit 2ded93e. Bugbot is set up for automated code reviews on this repo. Configure here.