Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create an ADR for migrating the CSV previews #3674

Merged
merged 1 commit into from
Jun 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions docs/adr/0001-render-csv-previews-in-frontend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Render CSV Previews in Frontend

Date: 2023-06-22

## Context
The Publishing Platform team has been moving migration of public facing pages and end points out of Whitehall for a little over a year and has made its way to CSV previews. These pages differ from most pages in two key ways. Firstly they are served on the assets hostname (assets.publishing.service.gov.uk) and secondly they do not have a content item.

These previews were being served by Whitehall making a request to the asset’s public URL and rendering this in Whitehall Frontend. Two options were considered for moving these to another application.


### Option 1
There is an RFC that suggests moving these pages to Government Frontend which would involve changing the hostname and creating a content item for these pages. This would be a substantial architectural change, that mostly sits outside the scope of changing the rendering application.

#### Pros
+ Changes the hostname
+ Is arguably a more suitable frontend application

#### Cons
- Changing the hostname is a considerable piece of work
- Will take a long time to get right

### Option 2
Allow a frontend app to communicate directly with Asset Manager and don’t require the changes to the URL or the creation of a content item. This would mean that we couldn’t render CSV previews in Government Frontend because it has a fairly unique way of rendering things that rely on content items existing. Frontend would be a better fit because it follows a traditional MVC architecture.

#### Pros
+ Is relatively quick and straightforward
+ Won't require funky redirect logic to make it work
+ Still allows us to change the hostname in the future

#### Cons
- Doesn't change the hostname

## Decision
Option 2

## Status
Accepted

## Consequences
CSV previews are now rendered by Frontend and we’ve fixed a long standing problem that caused CSV’s attached to draft documents not to be previewable, as Whitehall could not access drafts from the public assets host.

If we decide in the future that we want to make these served by the gov.uk endpoint rather than the assets one then we will have to do an amount of exploratory work that is separated from the immediate issue of moving the rendering.