Redirect legacy page names to the new routes (v0.9.4)

The retired legacy instance now blanket-redirects its old host to the new
one, so pre-rewrite deep links like /index.html or /branches.html arrive
here — they answer 301 to the new routes instead of 404; about/license had
no successor pages and land on the start page.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
mhoennig
2026-08-10 16:55:11 +02:00
co-authored by Claude Fable 5
parent fbdc6f54b7
commit eb49387c97
3 changed files with 40 additions and 1 deletions
@@ -28,6 +28,7 @@ import org.springframework.http.HttpStatus
import org.springframework.test.web.servlet.MockMvc
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.content
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.header
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.status
import org.springframework.web.server.ResponseStatusException
import java.nio.file.Files
@@ -270,6 +271,21 @@ class UiControllerTest : FunSpec() {
Regex(""" failed</span>""").findAll(page).count() shouldBe 1
}
test("legacy page names redirect permanently to the new routes") {
mockMvc
.perform(get("/index.html"))
.andExpect(status().isMovedPermanently)
.andExpect(header().string("Location", "/"))
mockMvc
.perform(get("/branches.html"))
.andExpect(status().isMovedPermanently)
.andExpect(header().string("Location", "/branches"))
mockMvc
.perform(get("/history.html"))
.andExpect(status().isMovedPermanently)
.andExpect(header().string("Location", "/history"))
}
test("artifact index of a pruned build explains the missing artifacts") {
every { repository.history() } returns listOf(successResult)
every { artifactStore.artifactDir("main-abc123-key") } returns null