Skip to content

feat(hub): add prototype Build detail metadata - #230

Merged
nshki merged 3 commits into
build/hub/newfrom
nshki/feat/hub/build-metadata
Nov 12, 2026
Merged

nshki merged 3 commits into
build/hub/newfrom
nshki/feat/hub/build-metadata

Conversation

@nshki

@nshki nshki commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Why

Build records need source and author metadata to support the planned prototype detail experience. This slice adds the persistence foundation without expanding into historical Rails imports, Build APIs, preview hosting, or live review.

What changes

Add optional commit SHA, external author identity and snapshots, Build start and finish times, and failure summaries. Database constraints keep known metadata coherent while allowing existing Builds to retain unknown values. Seed data, PostgreSQL coverage, and the database and development guides are updated to match.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 24981734-e0da-49fc-baf7-507617a6b09f
@nshki
nshki requested a review from a team as a code owner November 12, 2026 20:26
Copilot AI adaptive review requested due to automatic review settings November 12, 2026 20:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The database test fails in the documented devcontainer because the seed’s safety guard rejects the isolated worker database URL before any records are created.

1 open issue
What changed in this PR

Adds the persistence foundation for Hub’s planned prototype Build detail experience, without introducing Build APIs, preview hosting, or historical imports.

Changes:

  • Adds optional commit, external author, timing, and failure metadata with database constraints.
  • Adds PostgreSQL coverage for upgrades, metadata rules, and seed reruns.
  • Updates synthetic seed data and contributor documentation.
File Description
hub/​test/​database/​build-metadata-migration/​index.db.test.ts Tests upgrade preservation and metadata constraints.
hub/​server/​scripts/​seed-prototype-index/​index.ts Populates synthetic Build metadata.
hub/​server/​scripts/​seed-prototype-index/​index.db.test.ts Tests seeded metadata and restoration on rerun.
hub/​schema/​migrations/​20261112190000_build_detail_metadata/​migration.sql Adds metadata columns, uniqueness, and consistency constraints.
hub/​schema/​build.prisma Exposes metadata fields through Prisma.
hub/​docs/​development.md Clarifies synthetic metadata and seed restoration.
hub/​docs/​database.md Documents metadata rules and unknown values after upgrades.

Review effort: Balanced (auto)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 24981734-e0da-49fc-baf7-507617a6b09f
Build author details may come from sources other than a Git commit, such as a future manual upload. Dropping the commit prefix keeps these columns accurate for every source. The commit SHA keeps its name because it only describes Git Builds.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 335a01a0-881c-4159-bcf9-5f19b9b66bd4
@nshki
nshki added this pull request to stack #247 November 12, 2026 22:35
@nshki
nshki merged commit b7deaef into build/hub/new Nov 12, 2026
48 checks passed
@nshki
nshki deleted the nshki/feat/hub/build-metadata branch November 12, 2026 23:17
nshki added a commit that referenced this pull request Nov 12, 2026
## Why

Members can browse the real prototype index, but its cards lead nowhere.
This connects each card to a read-only prototype page so members can see
a prototype and its Builds before hosted previews and review exist.

## What changes

Hub adds `GET /api/repositories/:repositoryId/prototypes/:prototypeId`
for signed-in members. It returns the prototype, its Builds, and the
latest successful Build. A `build` query pins another successful Build.
A malformed, missing, or unsuccessful Build returns 404. Preview and
screenshot URLs stay empty because Hub does not host Builds yet.

In real mode, index cards now open this page. It shows a "no preview"
state and offers only successful Builds. Build history, Build details,
and sharing links stay hidden until they work. Authors who signed in
with another provider, such as Entra, appear by name without a GitHub
link. Mock mode keeps its existing navigation.

Build author details come from the provider-neutral `author_*` columns
added in #230.

## Storybook screenshots

**Hub/Pages/Prototype Review › Preview Hosting Unavailable** (light
theme, 1200×1279)

![Prototype page showing "Build 3 has no preview" with a Build selector
and no history or sharing
actions](https://github.com/user-attachments/assets/630bf3aa-b8ea-42ed-b9e6-f2ea0212b142)


**Hub/Pages/Prototype Review › Empty** (light theme, 1200×1279; updated
empty-state copy)

![Prototype page showing "No successful Build yet" with the message
"This prototype has no successful Build
yet."](https://github.com/user-attachments/assets/3ec4410e-801f-4bad-8c85-c1606ec88712)

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 335a01a0-881c-4159-bcf9-5f19b9b66bd4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants