feat(groups): add public_name slug resolution for public group URLs - #1318
feat(groups): add public_name slug resolution for public group URLs#1318MRashad26 wants to merge 4 commits into
Conversation
LFXV2-2012 When the :id route param is not a UUID, resolve it as a public_name slug via query-service tag lookup before fetching the committee. This enables human-readable URLs like /groups/technical-steering-committee alongside the existing UUID-based /groups/<uid> route. Signed-off-by: Mohamed Rashad <mrashad@contractor.linuxfoundation.org> Signed-off-by: Rashad <mrashad@contractor.linuxfoundation.org>
PR SummaryMedium Risk Overview The JSON payload adds optional Reviewed by Cursor Bugbot for commit 012de66. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
There was a problem hiding this comment.
Pull request overview
Adds public-name slug resolution for public group URLs while retaining UUID support.
Changes:
- Resolves non-UUID identifiers through query-service tags.
- Uses the resolved committee UID for downstream requests.
- Exposes
public_namethrough shared group interfaces and API responses.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
packages/shared/src/interfaces/public-group.interface.ts |
Adds public_name to public group details. |
packages/shared/src/interfaces/committee.interface.ts |
Adds the committee public URL slug field. |
apps/lfx-one/src/server/controllers/public-groups.controller.ts |
Implements slug lookup and returns the slug. |
Suppressed comments (1)
apps/lfx-one/src/server/controllers/public-groups.controller.ts:66
QueryServiceResponse.resources[].idis the query index key (for committees it iscommittee:<uid>), not the committee UID. Passing it togetCommitteeByIdproduces/committees/committee:<uid>, so every successful slug lookup fails before rendering. Read the UID from the indexed payload instead.
committeeUid = resources[0].id;
🚀 Deployment StatusYour branch has been deployed to: https://ui-pr-1318.dev.v2.cluster.linuxfound.info Deployment Details:
The deployment will be automatically removed when this PR is closed. |
Address review comments from @copilot-pull-request-reviewer, @cursor: - public-groups.controller.ts: use resources[0].data.uid instead of resources[0].id — the query-service id is the type-prefixed index key (committee:<uid>), not the raw UID (per @cursor, @copilot) - public-groups.controller.ts: throw ResourceNotFoundError (404) instead of AuthorizationError (403) when slug lookup finds no match — frontend treats 403 as "private group" which is wrong UX for a missing slug (per @copilot, @cursor) Resolves 2 code review threads. Signed-off-by: Rashad <mrashad@contractor.linuxfoundation.org>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (1)
apps/lfx-one/src/server/controllers/public-groups.controller.ts:56
- The upstream
public_namecontract explicitly does not enforce uniqueness, so limiting this lookup to one result silently selects whichever duplicate the query service returns first. Two committees with the same value can therefore route the same canonical URL to the wrong group (or to a private group and return 403). Fetch enough results to detect ambiguity and return a deterministic error, or makepublic_nameglobally unique before relying on it as a route key.
const { resources } = await this.microserviceProxy.proxyRequest<QueryServiceResponse<Committee>>(req, 'LFX_V2_SERVICE', '/query/resources', 'GET', {
type: 'committee',
tags: `public_name:${id}`,
page_size: 1,
Review Feedback AddressedCommit: 48e1a8e Changes Made
No Change Needed
Threads Resolved5 of 5 unresolved threads addressed in this iteration. |
Replace public_name with sso_group_name in the public groups controller tag query and response mapping, plus the shared Committee and PublicGroupDetail interfaces. LFXV2-2012 Signed-off-by: Rashad <mrashad@contractor.linuxfoundation.org>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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 4cbbb94. Configure here.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (2)
apps/lfx-one/src/server/controllers/public-groups.controller.ts:55
- The implementation now resolves
sso_group_name, while the PR title, summary, interface bullets, and test plan still promise apublic_namecontract. The latest dependency commit (2c1fb9a) confirms the upstream implementation pivoted tosso_group_name, so update this PR's metadata to match; otherwise consumers and reviewers are directed to a field/tag that no longer exists.
tags: `sso_group_name:${id}`,
packages/shared/src/interfaces/committee.interface.ts:419
Committeealready declaressso_group_name?: stringat lines 363–366. Declaring it again here duplicates the same upstream field and splits its documentation across two locations. Remove this declaration and, if needed, extend the existing field's JSDoc to mention its public-URL role.
/** SSO group name, also used as slug for public URLs */
sso_group_name?: string;
The Committee interface already had sso_group_name at line 366; renaming public_name created a duplicate. Remove the second one. LFXV2-2012 Signed-off-by: Rashad <mrashad@contractor.linuxfoundation.org>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
apps/lfx-one/src/server/controllers/public-groups.controller.ts:159
- This response exposes
sso_group_namerather than the canonicalpublic_namepromised by this API change. As a result, clients cannot build canonical public URLs, and the newly addedPublicGroupDetailfield models the unrelated SSO identifier. Addpublic_nameto the sharedCommitteeandPublicGroupDetailcontracts and mapcommittee.public_namehere.
sso_group_name: committee.sso_group_name || undefined,
| if (!UUID_REGEX.test(id)) { | ||
| const { resources } = await this.microserviceProxy.proxyRequest<QueryServiceResponse<Committee>>(req, 'LFX_V2_SERVICE', '/query/resources', 'GET', { | ||
| type: 'committee', | ||
| tags: `sso_group_name:${id}`, |
Review Feedback AddressedNo Change Needed
Threads Resolved1 of 1 unresolved thread addressed. |

Summary
:idroute parameter on/public/api/groups/:idis not a UUID, resolve it as apublic_nameslug via query-service tag lookup (public_name:<slug>)public_namefield toCommitteeandPublicGroupDetailinterfacespublic_namein the public group API response so the frontend can use it for canonical URLsDepends on backend PR: linuxfoundation/lfx-v2-committee-service#172
Test plan
/groups/<valid-uuid>— page renders as before (no regression)/groups/<valid-public-name-slug>— slug resolves and page renders/groups/<nonexistent-slug>— shows not-found pagepublic_nameis present in the API response when set on the committee🤖 Generated with Claude Code