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

Add a special route for /chat #3122

Merged
merged 2 commits into from
Feb 6, 2025
Merged

Add a special route for /chat #3122

merged 2 commits into from
Feb 6, 2025

Conversation

kevindew
Copy link
Member

@kevindew kevindew commented Feb 6, 2025

Trello: https://trello.com/c/evNZhxxc/2285-set-up-410-page-for-govuk-chat-to-be-served-by-govuk

This PR configures a route for /chat (and a few content sub pages) so they can return a gone response.

The motivation for this is that we are going to remove the chat application from GOV.UK routing and want to leave behind the appropriate 410 responses.

The first commit here makes a modification to SpecialRoutePublisher in order to enable publishing special routes of the gone /redirect schema. The second commit applies the change.


⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

This application is owned by the publishing platform team. Please let us know in #govuk-publishing-platform when you raise any PRs.

Follow these steps if you are doing a Rails upgrade.

Requiring a rendering app prevents special route publisher from
publishing routes that don't have one such as gone and redirects.

My motivation for making this change is so that we can use
SpecialRoutePublisher to publish a gone route for /chat.

This will make the Rails logger line a little bit janky with the
"routing to ". But this seems such a modest issue that it isn't worth
writing extra code.
GOV.UK Chat was an application hosted at www.gov.uk/chat. Its routing
was configured at the CDN level so it did not have a presence in
Publishing API.

As part of retiring the application we want the URLs to return a 410
status code. The most idiomatic way to do this for GOV.UK Publishing
seems to be to create a content item for it.

GOV.UK Chat had a number of routes used but I didn't want to set a
prefix route for it as that'd mean anything under /chat would get a 410.
Instead I opted for just the homepage and the content pages with the
expectation that isn't any issue for application routes to return 404.

Note: title and description are required to be null for a gone schema,
hence the explicit declarations [1]

[1]: https://github.com/alphagov/publishing-api/blob/61eb70f361de537da3cdab41eeb810be25c4b5f9/content_schemas/formats/gone.jsonnet#L6-L7
@kevindew kevindew merged commit 752def8 into main Feb 6, 2025
13 checks passed
@kevindew kevindew deleted the chat-special-route branch February 6, 2025 13:50
kevindew added a commit to alphagov/govuk-helm-charts that referenced this pull request Feb 6, 2025
Now that we have configured a gone route for www.gov.uk/chat [1] this
removes the additional configuration to serve the /chat route with the
www loadbalancer.

This removes the additional ALB conditions for router with extra paths
for /chat. It removes the nginx redirects to keep people on
www rather than the chat.publishing hostname, and turns on signon
authentication for chat again, so that it can't be accessed without a
signon account.

I've applied this only to integration so far so that I can verify it all
works correctly.

[1]: alphagov/publishing-api#3122
kevindew added a commit to alphagov/govuk-helm-charts that referenced this pull request Feb 6, 2025
Now that we have configured a gone route for www.gov.uk/chat [1] this
removes the additional configuration to serve the /chat route with the
www loadbalancer.

This removes the additional ALB conditions for router with extra paths
for /chat. It removes the nginx redirects to keep people on
www rather than the chat.publishing hostname, and turns on signon
authentication for chat again, so that it can't be accessed without a
signon account.

I've applied this only to integration so far so that I can verify it all
works correctly.

I've left the ingress configuration [2] as it seemed every other app
with public access has it, however I was a little confused as we didn't
seem to add it until we configured the app to be served on www.

[1]: alphagov/publishing-api#3122
[2]: 06f6103
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.

2 participants