playfulprogramming / playfulprogramming/hoof
Implement branch-aware routing across content endpoints
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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