Skip to content

feat: resolveproject group in the segments middleware (CM-189)#4011

Open
ulemons wants to merge 21 commits intomainfrom
feat/standardize-segments-api
Open

feat: resolveproject group in the segments middleware (CM-189)#4011
ulemons wants to merge 21 commits intomainfrom
feat/standardize-segments-api

Conversation

@ulemons
Copy link
Copy Markdown
Contributor

@ulemons ulemons commented Apr 9, 2026

Note

Medium Risk
Changes request scoping for many API queries by allowing project-group/project segment IDs and expanding them server-side, which could alter data visibility/filtering if resolution is incorrect. Frontend request behavior is updated broadly to rely on this new resolution path.

Overview
Backend now resolves non-leaf segments (project group/project IDs) to leaf sub-project segments in segmentMiddleware before setting currentSegments, with safer query/body parsing and added debug logging.

Frontend segment passing is simplified: requests that previously expanded a project group into many segment IDs now send just the selected project group ID (letting the backend expand it), and activity/member/org list pages refactor initial query params to use buildApiFilter outputs directly (plus a small fix to avoid invalid joinedAt timestamps).

Reviewed by Cursor Bugbot for commit 0981ff5. Bugbot is set up for automated code reviews on this repo. Configure here.

@ulemons ulemons self-assigned this Apr 9, 2026
@ulemons ulemons added the Feature Created by Linear-GitHub Sync label Apr 9, 2026
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 9, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Comment thread backend/src/middlewares/segmentMiddleware.ts Fixed
Copilot AI review requested due to automatic review settings April 17, 2026 07:20
@ulemons ulemons marked this pull request as ready for review April 17, 2026 07:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 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 segmentMiddleware to 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.

Comment thread frontend/src/modules/activity/components/activity-timeline.vue Outdated
Comment thread backend/src/middlewares/segmentMiddleware.ts Outdated
Comment thread backend/src/middlewares/segmentMiddleware.ts Outdated
Comment thread frontend/src/modules/organization/organization-service.js Outdated
Comment thread frontend/src/modules/activity/components/activity-timeline.vue Outdated
@ulemons ulemons force-pushed the feat/standardize-segments-api branch from 765829e to 9d33a06 Compare April 17, 2026 09:32
Copilot AI review requested due to automatic review settings April 17, 2026 09:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread services/libs/data-access-layer/src/collections/index.ts
Comment thread backend/src/middlewares/segmentMiddleware.ts
Copilot AI review requested due to automatic review settings April 17, 2026 09:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread backend/src/middlewares/segmentMiddleware.ts
Comment thread backend/src/middlewares/segmentMiddleware.ts
Comment thread frontend/src/modules/organization/organization-service.js Outdated
Comment thread backend/src/middlewares/segmentMiddleware.ts
@ulemons ulemons force-pushed the feat/standardize-segments-api branch from ee72d68 to 5faf875 Compare April 17, 2026 12:14
Copilot AI review requested due to automatic review settings April 17, 2026 12:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread backend/src/middlewares/segmentMiddleware.ts
Comment thread backend/src/middlewares/segmentMiddleware.ts
Comment thread backend/src/middlewares/segmentMiddleware.ts
@ulemons ulemons force-pushed the feat/standardize-segments-api branch from 9a013b6 to e58e568 Compare April 17, 2026 13:03
Comment thread backend/src/middlewares/segmentMiddleware.ts
Copilot AI review requested due to automatic review settings April 17, 2026 14:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread backend/src/middlewares/segmentMiddleware.ts
Comment thread backend/src/middlewares/segmentMiddleware.ts
Copilot AI review requested due to automatic review settings April 17, 2026 15:14
Comment thread frontend/src/modules/organization/pages/organization-list-page.vue
ulemons and others added 19 commits April 23, 2026 12:31
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>
@ulemons ulemons force-pushed the feat/standardize-segments-api branch from 6195034 to 5cad379 Compare April 23, 2026 10:31
Comment thread backend/src/services/memberService.ts Outdated
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Copilot AI review requested due to automatic review settings April 23, 2026 13:14
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.


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

Comment thread backend/src/middlewares/segmentMiddleware.ts
Copy link
Copy Markdown

@cursor cursor Bot left a 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 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0981ff5. Configure here.

Comment thread backend/src/middlewares/segmentMiddleware.ts
@ulemons ulemons requested a review from gaspergrom April 23, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Created by Linear-GitHub Sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants