Skip to content

feat(catalog): add GET /v1/catalogs/{id} - #16038

Merged
strandhvilliam merged 8 commits into
mainfrom
villiam/catalog-version-endpoint
Oct 29, 2026
Merged

strandhvilliam merged 8 commits into
mainfrom
villiam/catalog-version-endpoint

Conversation

@strandhvilliam

@strandhvilliam strandhvilliam commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

We want a dashboard page for each catalog version, showing what was in it (#16039). There was no way to fetch a single version and its products, so this adds one.

  • GET /v1/catalogs/{id} (private) returns the catalog, its products, and the IDs of the versions before and after it.
  • Regenerated the TypeScript client.

View guided diff Turn on auto-fix

@vercel

vercel Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
orbit Ready Ready Preview Oct 29, 2026 8:47am UTC
polar-test Ready Ready Preview Oct 29, 2026 8:47am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 6 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread server/polar/catalog/repository.py Resolved

@cubic-dev-ai cubic-dev-ai Bot 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.

0 issues found across 2 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Adds a new authenticated GET /v1/catalogs/{id} endpoint returning catalog version, products, and neighboring version IDs, plus generated client updates. Because this adds API surface/contract, a human should sign off on the endpoint design and exposure.

View guided diff | Turn on auto-fix | Re-trigger cubic

Returns one catalog version with its products and the IDs of the versions
published before and after it, so the dashboard can show a version page
and step between versions.
…/{id}

Neighbors depend on the list ordering and change whenever a new version is
published. The dashboard can find them from the list endpoint.
@strandhvilliam
strandhvilliam force-pushed the villiam/catalog-version-endpoint branch from d4df9cb to f9824ae Compare October 28, 2026 15:01
@strandhvilliam
strandhvilliam changed the base branch from prototype/product-version-fields to main October 28, 2026 15:01
…on-endpoint

Co-authored-by: Villiam Strandh <villiam.strandh@outlook.com>

# Conflicts:
#	clients/packages/client/src/v1.ts
#	server/polar/catalog/schemas.py
Comment thread server/polar/models/catalog.py Outdated
return relationship("Catalog", remote_side="Catalog.id", lazy="raise")

@declared_attr
def products(cls) -> Mapped[list["CatalogProduct"]]:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Mmm Product.catalog already exists and Catalog.products can be read as the inverse of the first one. This returns a CatalogProduct and it's not the same type. I think it's better to find a better name for this, maybe members as we already use it in the publish ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah very good call! Renamed it to product_members. So that we later can also have benefit_members etc if I understand the design doc correctly?

@cubic-dev-ai cubic-dev-ai Bot 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.

1 issue found across 6 files

Confidence score: 4/5

  • CatalogVersion in server/polar/catalog/schemas.py omits the successor ID, so clients can’t navigate to the next catalog version without listing all catalogs. Add the field and populate it in the endpoint or service.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="server/polar/catalog/schemas.py">

<violation number="1" location="server/polar/catalog/schemas.py:39">
P2: `CatalogVersion` omits the ID of the catalog version after this one. Add the successor ID to the response and populate it in the endpoint/service so clients can navigate both directions without listing all catalogs.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

product_id: UUID4 = Field(description="The product version in this catalog.")


class CatalogVersion(Catalog):

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.

P2: CatalogVersion omits the ID of the catalog version after this one. Add the successor ID to the response and populate it in the endpoint/service so clients can navigate both directions without listing all catalogs.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At server/polar/catalog/schemas.py, line 39:

<comment>`CatalogVersion` omits the ID of the catalog version after this one. Add the successor ID to the response and populate it in the endpoint/service so clients can navigate both directions without listing all catalogs.</comment>

<file context>
@@ -29,3 +29,17 @@ class Catalog(IDSchema, TimestampedSchema):
+    product_id: UUID4 = Field(description="The product version in this catalog.")
+
+
+class CatalogVersion(Catalog):
+    """A catalog version with its products."""
+
</file context>

@strandhvilliam
strandhvilliam added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit 41568f3 Oct 29, 2026
29 checks passed
@strandhvilliam
strandhvilliam deleted the villiam/catalog-version-endpoint branch October 29, 2026 09:49

This branch was successfully deployed

2 active deployments
Preview – polar-test — 82a2d3c5 Deployed Oct 29, 2026 by vercel[bot]
Preview – orbit — 82a2d3c5 Deployed Oct 29, 2026 by vercel[bot]
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.

3 participants