feat(asset-reviews): give review requests a human-readable title#490
Open
larsgeorge-db wants to merge 1 commit into
Open
feat(asset-reviews): give review requests a human-readable title#490larsgeorge-db wants to merge 1 commit into
larsgeorge-db wants to merge 1 commit into
Conversation
Data asset review requests had no name field, so every surface (list,
detail header, breadcrumb, notifications, toasts, search) fell back to
displaying the raw UUID. Introduce an optional, user-editable `title`
with a smart auto-derived fallback and surface it everywhere a review
is named.
Backend
- New `title VARCHAR(200)` column on `data_asset_review_requests` via
Alembic migration `g3_review_title`, backfilled inline using the
same derivation rule the runtime applies (so historical rows match
what the manager would produce).
- New `derive_review_title()` + `_short_asset_label()` helpers in
`data_asset_reviews_manager.py`. Derivation order:
1. user-set title if non-empty
2. `Review of {short_name(fqn)}` for one asset
3. `Review of {short_name(first)} (+{N-1} more)` for many
4. `Review request by {requester_email}` as last resort.
Short-name handles UC FQNs (`a.b.c` -> `c`), path-style FQNs
(notebooks / volumes), and `mdm://config/run/candidate` URIs.
- Pydantic: `title` on `DataAssetReviewRequest` (response, always
populated) and `DataAssetReviewRequestCreate` (optional input);
new `DataAssetReviewRequestUpdate` for partial updates.
- Manager hardens the response so callers never see `None` for title:
`get_review_request`, `list_review_requests`, and
`update_review_request_status` all run through the derive helper.
- Workflow trigger `entity_name`, fallback notifications (create and
status-change), and the search-index `title` now use the derived
title; descriptions no longer embed the UUID.
- New `manager.update_review_request()` + repo `update_request_fields()`
with explicit `*_set` flags so PATCH can distinguish field omitted
from field cleared to null.
- New `PATCH /api/data-asset-reviews/{request_id}` route with the same
audit-log shape as the other write routes.
Frontend
- `DataAssetReviewRequest.title: string` and matching
`DataAssetReviewRequestCreate.title?` / `DataAssetReviewRequestUpdate`
types.
- Added `patch()` to `useApi` (mirrors `put()`); updated the
`useComments` test mock to match the expanded return shape.
- Create dialog now has an optional Title input above Notes
(`maxLength=200`) with placeholder explaining the auto-derived
fallback.
- List view: dropped the Request ID column. Title is now the primary
column (text-sm font-medium) and the table search runs against it
(placeholder auto-adapts via `searchColumn="title"`).
- Detail view: breadcrumb and H1 use `request.title`; UUID demoted to
a small font-mono line with a copy-to-clipboard button. New inline
title editor (pencil -> input -> PATCH) with Enter/Esc handling and
a spinner during save.
- i18n: 7 locales (en, de, fr, es, it, ja, nl) updated. Renamed
`table.requestId` -> `table.title`, added `table.untitled`,
`form.titleLabel`, `form.titlePlaceholder`,
`actions.editTitle`, `actions.copyId`, `toast.titleUpdated`,
`toast.idCopied`. `toast.requestCreated` now interpolates
`{{title}}` instead of `{{id}}`.
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
Data asset review requests had no name field, so every surface (list, detail header, breadcrumb, notifications, toasts, search results) fell back to displaying the raw UUID like
00c00001-0000-4000-8000-000000000001. This PR introduces an optional, user-editabletitlewith a smart auto-derived fallback, and surfaces it everywhere a review is named.Before
00c00001-0000-4000-...Review Request Details+ UUIDReview: 00c00001...Review request (00c00001-...) assigned to you by ...Review Request by foo@x for bar@y (2 assets)After
Review of orders (+2 more)(user-set title takes precedence)Review of orders (+2 more)with inline edit; UUID demoted to small monospace line with copy buttonNew review request: Review of orders (+2 more)Derivation rule
Single
derive_review_title()helper in the manager, used by API responses, workflowentity_name, notifications, search index, and the Alembic backfill so all surfaces agree.titleif non-emptyReview of {short_name(asset_fqn)}for one assetReview of {short_name(first)} (+{N-1} more)for manyReview request by {requester_email}as last resortshort_nameunderstands UC FQNs (a.b.c->c), path-style FQNs (notebooks / volumes -> last segment), andmdm://config/run/candidateURIs (-> candidate id).Backend changes
title VARCHAR(200)column ondata_asset_review_requestsvia Alembic migrationg3_review_title(descends fromg2_ontology_gen_runs, single head). Migration backfills existing rows using the same derivation rule the runtime applies.titleadded to read + create models; newDataAssetReviewRequestUpdatefor PATCH.Nonereaches consumers). Workflow triggerentity_name, fallback notifications (create and status-change), and search-index title all use the derived title; descriptions no longer embed the UUID.manager.update_review_request()+ repoupdate_request_fields()(uses explicit*_setflags so PATCH can distinguish field omitted from field cleared to null).PATCH /api/data-asset-reviews/{request_id}route with the same audit-log shape as the other write routes.Frontend changes
DataAssetReviewRequest.title: string,DataAssetReviewRequestCreate.title?, newDataAssetReviewRequestUpdate.useApigains apatch()method (mirrorsput());useCommentstest mock updated to match the expanded return shape.maxLength=200), placeholder explains the auto-derived fallback.request.title; UUID demoted to small monospace line with a copy-to-clipboard button. Inline title editor (pencil -> input -> PATCH) with Enter/Esc handling.table.requestId->table.title, addedtable.untitled,form.titleLabel,form.titlePlaceholder,actions.editTitle,actions.copyId,toast.titleUpdated,toast.idCopied.toast.requestCreatednow interpolates{{title}}instead of{{id}}.Out of scope
asset_fqn).project_idexposure.Test plan