Skip to content

Proof of concept: Routing by schema_name#593

Draft
KludgeKML wants to merge 5 commits into
mainfrom
poc-route-by-schema-name-2
Draft

Proof of concept: Routing by schema_name#593
KludgeKML wants to merge 5 commits into
mainfrom
poc-route-by-schema-name-2

Conversation

@KludgeKML
Copy link
Copy Markdown
Contributor

This is a proof of concept of moving the information about which documents should be routed to which rendering apps to where it's actually critical - in router.

This would allow the publishing app chain (the originating app, publishing-api, and content-store) to not care about which app renders a particular document.

  • Non-special routes all have an exact mapping of schema_name to a rendering app, which can just be provided in code here , and updated when necessary in one place without republishing.
  • special routes are currently updated in publishing-api, but there's no particular need for that - putting them here means they can be loaded instantly on deploy, removing a publishing step from the process of adding/removing a special route.

This is not good Go code, but 🤷. Hopefully it will be able to show that everything works, and someone better than me can rewrite it.

- Publish intents allow a fast switchover by reducing the content expiry passed
  to the frontend so that items that are scheduled to be published don't get
  cached past their update time and thus apparently miss their scheduled time
  if the viewer recently viewed the page. However, this is of less utility now that
  our cache times are closer to 5 mins, and we could easily say that the
  default expiry time of 404s is 1 minute, making the site almost as snappy with
  less complexity.
- this should probably be loaded from a YAML file, but I can't work out how go's
  yaml handling would allow me to end up with map[string]string
- remove references to Mongo and router-api, add reference to content-store
- We remove the part of the query that asks for the backend id, instead trusting
  that the schema_map correctly points us from a schema to the correct handler
  (this is correct for everything except for special routes, which will be handled
  later).
- update the unit tests to point to use actual schemas (this isn't necessarily
  the best idea, possibly we should provide a synthetic schema mapping for
  the tests, but it'll do for now).
@KludgeKML KludgeKML force-pushed the poc-route-by-schema-name-2 branch from 1aa1014 to 45e970c Compare September 25, 2025 15:54
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.

1 participant