playfulprogramming / playfulprogramming/hoof

Implement branch-aware routing across content endpoints

Open
#244 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
9
Forks
7
Avg merge
1d 2h
Merged PRs (30d)
23

Description

Blocked until #243 merges

Each content endpoint - /content/authors, /content/collections, /content/posts, etc. - currently either defines a branch parameter and returns entries for only one branch, or defines no parameters and does not filter content by branch at all (or filters to a hardcoded main).

When fetching from any table (including any entities referenced by slug within the same query), these endpoints must first look for an item from the requested branch, and then fall back to the main branch if no item is found.

For list endpoints (like /content/posts), this likely means a GROUP BY posts.slug to determine the set of available branches before filtering.

It may also be a good idea to create definitions for a Type.String({ default: "main" }) (+ explanation of the ?branch= parameter for the API docs) and a BRANCH_MAIN constant in e.g. content/common.ts to be shared by all content routes.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the blocking issue #243, then inventory the content endpoints and their current branch parameters and filters. Check the proposed shared definitions in content/common.ts if that file is created. Done means every content endpoint consistently prefers the requested branch and falls back to main, including referenced entities and list results.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.