WIP: obs-status-service: add default landing page for root URL #115

Closed
schrodinger wants to merge 1 commits from schrodinger/autogits:main into main
First-time contributor

Summary

This PR improves the behavior of the root endpoint (GET /) of the OBS Status Service.

Previously, the root URL always returned a 404 page not found response when the service was healthy. This change replaces that 404 response with a simple HTML landing page that explains how to use the service.

Specifically, the following changes were made in obs-status-service/main.go:

  • The existing GET / handler was updated to return HTTP 200 instead of 404.

  • A basic HTML landing page is now served at the root endpoint.

  • The landing page content is derived from the existing README and explains how /status/... URLs work.

  • Example /status/... URLs are shown so users can quickly understand the expected format.

  • A small client-side only form was added that helps users build:

    • the full status image URL,
    • the corresponding Markdown snippet,
    • and shows a live SVG preview using the generated URL.

No backend logic was added for the form. It only concatenates URL path segments based on user input and relies on the existing /status/* endpoints.

This change does not modify or affect any existing /status/* handlers or backend logic.

Testing

The landing page HTML and form behavior are fully client-side and were tested independently in a browser.

Running the full service locally requires access to Redis and OBS, so the backend was not executed locally. The change is limited to the root endpoint and does not interact with Redis or OBS.

Fixes https://src.opensuse.org/git-workflow/autogits/issues/114

### Summary This PR improves the behavior of the root endpoint (`GET /`) of the OBS Status Service. Previously, the root URL always returned a `404 page not found` response when the service was healthy. This change replaces that 404 response with a simple HTML landing page that explains how to use the service. Specifically, the following changes were made in `obs-status-service/main.go`: * The existing `GET /` handler was updated to return HTTP 200 instead of 404. * A basic HTML landing page is now served at the root endpoint. * The landing page content is derived from the existing README and explains how `/status/...` URLs work. * Example `/status/...` URLs are shown so users can quickly understand the expected format. * A small **client-side only** form was added that helps users build: * the full status image URL, * the corresponding Markdown snippet, * and shows a live SVG preview using the generated URL. No backend logic was added for the form. It only concatenates URL path segments based on user input and relies on the existing `/status/*` endpoints. This change does not modify or affect any existing `/status/*` handlers or backend logic. ### Testing The landing page HTML and form behavior are fully client-side and were tested independently in a browser. Running the full service locally requires access to Redis and OBS, so the backend was not executed locally. The change is limited to the root endpoint and does not interact with Redis or OBS. ### Related Fixes [https://src.opensuse.org/git-workflow/autogits/issues/114](https://src.opensuse.org/git-workflow/autogits/issues/114)
schrodinger added 5 commits 2026-01-20 18:21:48 +01:00
obs-status-service: made SVG status colors theme-aware by using CSS variables
Some checks failed
go-generate-check / go-generate-check (pull_request) Has been cancelled
1826f0fe4d
obs-status-service: add landing page at root endpoint
Some checks failed
go-generate-check / go-generate-check (pull_request) Has been cancelled
6b0fb4fadc
merge upstream
Some checks failed
go-generate-check / go-generate-check (pull_request) Has been cancelled
de351435bc
removing unnecessay space from svg.go
Some checks failed
go-generate-check / go-generate-check (pull_request) Has been cancelled
48a32170b8
First-time contributor

@schrodinger Can you clean this PR? Just rebase your branch on main and left just one commit with the relevant changes.

https://git-scm.com/docs/git-rebase#_interactive_mode

@schrodinger Can you clean this PR? Just rebase your branch on main and left just one commit with the relevant changes. https://git-scm.com/docs/git-rebase#_interactive_mode
schrodinger force-pushed main from 48a32170b8 to 059ffffbdd 2026-01-21 09:43:00 +01:00 Compare
Author
First-time contributor

@schrodinger Can you clean this PR? Just rebase your branch on main and left just one commit with the relevant changes.

https://git-scm.com/docs/git-rebase#_interactive_mode

Thanks for the suggestion. I’ve rebased the branch on main and cleaned the PR to contain a single commit.

> @schrodinger Can you clean this PR? Just rebase your branch on main and left just one commit with the relevant changes. > > https://git-scm.com/docs/git-rebase#_interactive_mode Thanks for the suggestion. I’ve rebased the branch on main and cleaned the PR to contain a single commit.
schrodinger changed title from obs-status-service: add default landing page for root URL to WIP: obs-status-service: add default landing page for root URL 2026-01-26 16:08:37 +01:00
dgarcia requested changes 2026-01-27 10:37:06 +01:00
dgarcia left a comment
First-time contributor

It's a good start!

It's a good start!
@@ -41,6 +41,107 @@ const (
AppName = "obs-status-service"
)
const indexHTML = `<!DOCTYPE html>
First-time contributor

Instead of harcode the html in this file, you can create a folder, for example static and add the index.html file there, and then return the file directly.

Instead of harcode the html in this file, you can create a folder, for example `static` and add the `index.html` file there, and then return the file directly.
schrodinger force-pushed main from 059ffffbdd to aeb3917591 2026-01-27 13:42:39 +01:00 Compare
Author
First-time contributor

It's a good start!

Done, I’ve moved the landing page into static/index.html and updated the root handler to serve it directly. Thanks for the suggestion!

> It's a good start! Done, I’ve moved the landing page into static/index.html and updated the root handler to serve it directly. Thanks for the suggestion!
schrodinger requested review from dgarcia 2026-01-27 13:43:42 +01:00
schrodinger added 1 commit 2026-01-27 14:50:13 +01:00
obs-status-service: add --test-run using interface-based Redis mock (fixes #113)
Some checks failed
go-generate-check / go-generate-check (pull_request) Has been cancelled
1243ba4c6e
schrodinger force-pushed main from 1243ba4c6e to aeb3917591 2026-01-27 14:57:45 +01:00 Compare
Author
First-time contributor

Closing this PR to create a new clean PR rebased on the latest upstream main.

Closing this PR to create a new clean PR rebased on the latest upstream main.
schrodinger closed this pull request 2026-01-29 16:48:56 +01:00
Some checks failed
go-generate-check / go-generate-check (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: git-workflow/autogits#115