comparison hg-web/README.md @ 221:ce7f4400c2de hg-web

[hg-web] Harden forge and add changeset UI
author MrJuneJune <me@mrjunejune.com>
date Sun, 02 Aug 2026 09:01:24 -0700
parents 921ca3086879
children a8d6435dc021
comparison
equal deleted inserted replaced
219:8c9bb0b0759e 221:ce7f4400c2de
109 graph.tsx 109 graph.tsx
110 -> GET /api/graph/<revision>?graphtop=...&style=json 110 -> GET /api/graph/<revision>?graphtop=...&style=json
111 -> ApiGetGraph 111 -> ApiGetGraph
112 -> GET hg-serve/graph/<revision>?... 112 -> GET hg-serve/graph/<revision>?...
113 -> React rows + custom pencil/panda canvas 113 -> React rows + custom pencil/panda canvas
114
115 graph row selection
116 -> /changeset/<revision>
117 -> GET /api/changeset/<revision>
118 -> ApiGetChangeset
119 -> GET hg-serve/json-rev/<revision>
120 -> changeset metadata + rendered diff
114 ``` 121 ```
115 122
116 ### Mercurial clone, pull, and push 123 ### Mercurial clone, pull, and push
117 124
118 ```text 125 ```text
127 134
128 | Method | Route | Owner | Purpose | 135 | Method | Route | Owner | Purpose |
129 | --- | --- | --- | --- | 136 | --- | --- | --- | --- |
130 | `GET` | `/` | `GetReactHome` | Application shell | 137 | `GET` | `/` | `GetReactHome` | Application shell |
131 | `GET` | `/directories` | `GetReactHome` | Legacy application-shell route | 138 | `GET` | `/directories` | `GetReactHome` | Legacy application-shell route |
139 | `GET` | `/directory` | `GetReactHome` | Repository browser application route |
132 | `GET` | `/graph` | `GetReactHome` | Commit graph application route | 140 | `GET` | `/graph` | `GetReactHome` | Commit graph application route |
141 | `GET` | `/changeset/:changeset_id` | `GetReactHome` | Changeset application route |
133 | `GET` | `/api/repo/list` | `ApiListDirectory` | Directory listing JSON | 142 | `GET` | `/api/repo/list` | `ApiListDirectory` | Directory listing JSON |
134 | `GET` | `/api/repo/file` | `ApiGetFile` | Raw tracked file | 143 | `GET` | `/api/repo/file` | `ApiGetFile` | Raw tracked file |
135 | `GET` | `/api/repo/readme` | `ApiGetReadme` | Alias of the raw-file handler | 144 | `GET` | `/api/repo/readme` | `ApiGetReadme` | Directory README content |
136 | `GET` | `/api/graph/:graph_id` | `ApiGetGraph` | Mercurial graph JSON | 145 | `GET` | `/api/graph/:graph_id` | `ApiGetGraph` | Mercurial graph JSON |
146 | `GET` | `/api/changeset/:changeset_id` | `ApiGetChangeset` | Changeset metadata and diff JSON |
137 | `GET`, `POST` | `/repo` | `StreamHgWireProtocol` | Mercurial wire protocol | 147 | `GET`, `POST` | `/repo` | `StreamHgWireProtocol` | Mercurial wire protocol |
138 148
139 ## Frontend ownership 149 ## Frontend ownership
140 150
141 | File | Responsibility | 151 | File | Responsibility |
157 Build the server and deployable bundle from the repository root: 167 Build the server and deployable bundle from the repository root:
158 168
159 ```bash 169 ```bash
160 bazel build //hg-web:hg_web_server 170 bazel build //hg-web:hg_web_server
161 bazel build //hg-web:hg_web_server_bundle 171 bazel build //hg-web:hg_web_server_bundle
172 bazel test //markdown_converter/tests:markdown_to_html_test
173 bazel test //seobeo/tests:all
162 ``` 174 ```
163 175
164 Run the Mercurial backend: 176 Run the Mercurial backend:
165 177
166 ```bash 178 ```bash
187 -> /opt/hg_web_server_bundle_active/hg_web_server 199 -> /opt/hg_web_server_bundle_active/hg_web_server
188 -> working directory: /opt/hg_web_server_bundle_active 200 -> working directory: /opt/hg_web_server_bundle_active
189 -> hg serve service on 127.0.0.1:4444 201 -> hg serve service on 127.0.0.1:4444
190 ``` 202 ```
191 203
192 `deploy.sh` currently builds an optimized bundle, copies it to `/opt`, swaps 204 `deploy.sh` builds an optimized bundle into a revisioned release directory,
193 the active directory, changes ownership to `hg_web_server:zenbu_team`, and 205 atomically repoints `/opt/hg_web_server_bundle_active`, restarts
194 restarts `hg_web_server.service`. 206 `hg_web_server.service`, and checks `http://127.0.0.1:6970/`. A failed restart
207 or health check restores the previous release and restarts it. The service,
208 release root, active path, health URL, user, and group can be overridden with
209 environment variables.
195 210
196 ## Forge capability tree 211 ## Forge capability tree
197 212
198 ```text 213 ```text
199 Zenbu Forge 214 Zenbu Forge
200 ├── Repository 215 ├── Repository
201 │ ├── File and directory browsing available 216 │ ├── File and directory browsing available
202 │ ├── Syntax highlighting available 217 │ ├── Syntax highlighting available
203 │ ├── README rendering available 218 │ ├── README rendering available
204 │ ├── Commit graph available 219 │ ├── Commit graph available
205 │ ├── Changeset detail and diff planned 220 │ ├── Changeset detail and diff available
206 │ ├── Branches, bookmarks, and tags planned 221 │ ├── Branches, bookmarks, and tags planned
207 │ ├── File history and blame planned 222 │ ├── File history and blame planned
208 │ └── Search planned 223 │ └── Search planned
209 ├── Collaboration 224 ├── Collaboration
210 │ ├── Authentication and authorization planned 225 │ ├── Authentication and authorization planned
216 ├── Durable SQLite job queue planned 231 ├── Durable SQLite job queue planned
217 ├── Isolated Bazel runner planned 232 ├── Isolated Bazel runner planned
218 ├── Live logs and job status API planned 233 ├── Live logs and job status API planned
219 ├── Forge status and log screens planned 234 ├── Forge status and log screens planned
220 ├── Artifact retention planned 235 ├── Artifact retention planned
221 └── Atomic deploy, health check, rollback planned 236 └── Atomic deploy, health check, rollback available
222 ``` 237 ```
223 238
224 ## Automation data flow 239 ## Automation data flow
225 240
226 The Actions-like subsystem should extend the existing server rather than 241 The Actions-like subsystem should extend the existing server rather than
243 steps inside the Mercurial request, and make the queue durable before adding 258 steps inside the Mercurial request, and make the queue durable before adding
244 parallel or remote runners. 259 parallel or remote runners.
245 260
246 ## Safe extension order 261 ## Safe extension order
247 262
248 1. Harden proxy errors, path validation, response headers, and timeouts. 263 1. Add branches, bookmarks, tags, file history, blame, and search.
249 2. Add changeset detail and diff APIs, then wire graph clicks to those screens. 264 2. Add the hook, SQLite queue, single runner, and retained logs.
250 3. Make deployment atomic with health checks and rollback. 265 3. Add run/status/log pages using the existing custom UI.
251 4. Add the hook, SQLite queue, single runner, and retained logs. 266 4. Add authentication and authorization before accepting public pushes or
252 5. Add run/status/log pages using the existing custom UI.
253 6. Add authentication and authorization before accepting public pushes or
254 user-defined automation. 267 user-defined automation.
255 268
256 ## Invariants 269 ## Invariants
257 270
258 - Keep public application code on Seobeo APIs. 271 - Keep public application code on Seobeo APIs.