feat: adding username and displayName normalisation (CM-1235) - #4244
Merged
Conversation
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the OSSPCKGS stewardship model to persist and surface steward identity labels by introducing username and displayName (nullable in responses when not stored yet), writing those values during assignment, and joining them into stewardship-related reads.
Changes:
- Add a new
stewardstable keyed byuser_idto storeusername+display_name. - Update stewardship assignment to optionally upsert steward profile data in the same transaction as the assignment.
- Update stewardship/package list queries and public API schema/types to return
username/displayNameinstead of a singlenamefield.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| services/libs/data-access-layer/src/osspckgs/stewardships.ts | Adds steward-profile join for active stewards + upsert-on-assign support; updates steward record shape. |
| services/libs/data-access-layer/src/osspckgs/api.ts | Extends package list steward aggregation JSON to include username/displayName via join. |
| backend/src/osspckgs/migrations/V1781600000__stewards-table.sql | Introduces the stewards table schema for persisted profile labels. |
| backend/src/api/public/v1/stewardships/openapi.yaml | Updates public API schema to expose username/displayName and accept them on assignment. |
| backend/src/api/public/v1/stewardships/assignSteward.ts | Adds request validation for the optional username/displayName pair and passes through to DAL. |
| backend/src/api/public/v1/packages/types.ts | Updates shared public types for steward shape (username/displayName nullable). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Support writing username and displayName of the steward on the assignemnt.
Type of change
CM-1235
Note
Medium Risk
Public steward shape changes (
nameremoved) and assignment now writes profile data; existing stewards without rows will show null display fields until reassigned or backfilled.Overview
Steward identity in API responses moves from a single
namefield tousernameanddisplayName(both nullable when not stored yet).A new
stewardstable holds LFX username and display name keyed by Auth0user_id.PUT /stewardships/{id}/stewardaccepts optionalusernameanddisplayName(validated as an all-or-nothing pair); when both are sent, the handler upserts that row in the same transaction as the assignment. Steward lists fromassignSteward,getStewardshipSummary, and package list queries now LEFT JOINstewardsso stored labels surface in JSON; assignments without profile data still work and return nulls for those fields.OpenAPI and shared TypeScript types are updated to match.
Reviewed by Cursor Bugbot for commit bcdeec0. Bugbot is set up for automated code reviews on this repo. Configure here.