myxce/src/frontend/apiserver
Rongsong Shen 099dbdabdc
fix(apiserver): fix job control union discriminant, add human-readable job ID support (gitea#45)
ControlJob() set xce_jobctrl_t.action to the job_ctrl_type_t action code
(kill/stop/resume/checkpoint), but that field is actually the capnp
JobControl_u_which union discriminant -- a different enum entirely. This
made kill/resume/checkpoint hit request.c's -EINVAL default case, and made
stop collide with the checkpoint discriminant and read through the wrong
union member. Live-verified against a real deployed cluster: kill/stop/
resume/checkpoint now behave correctly with no apiserver crash.

Also additively accept a human-readable job ID ("{cluster}-{apiserver}-
{timestamp}-{seq}") on the job control endpoint, alongside the existing
numeric form xcecli already translates to -- lets a caller hit the REST
API directly without reimplementing xcecli's ID packing. Live-verified via
a direct curl call with the human-readable ID.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hb6Edtj4KbS8CrgEWYdA2E
2026-09-07 08:31:54 +00:00
..
backend fix(apiserver): fix job control union discriminant, add human-readable job ID support (gitea#45) 2026-09-07 08:31:54 +00:00
cmd feat(eliminate-frontend-makefile): task 3.4 - update source code comments 2026-09-03 14:34:48 +00:00
common Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
config fix(security): replace exposed admin credential with placeholder 2026-07-31 03:31:23 +00:00
controllers fix(apiserver): fix job control union discriminant, add human-readable job ID support (gitea#45) 2026-09-07 08:31:54 +00:00
docs Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
middleware Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
models fix(apiserver): pass client-asserted FromHost through unchanged (bug-1676, gitea #44) 2026-08-24 15:14:33 +00:00
router Init commit of jobs output/error message peek project. 2026-05-09 16:57:54 +08:00
services submit job from xcecli 2026-04-14 15:55:52 +08:00
store fix(apiserver): FilterRows must not route non-bitmask operators through bitmask matching (bug-1680) 2026-08-25 04:04:08 +00:00
tools/encrypt Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
utils refactor: simplify HA backend peer handling 2026-05-08 03:41:11 +00:00
vendor build: make Go and Python builds fully offline (hermetic Nix build) 2026-09-03 12:38:49 +08:00
go.mod Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
go.sum Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
meson.build feat(eliminate-frontend-makefile): task 1.1 - Meson backend CGO test target 2026-09-03 13:17:06 +00:00
README.md Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00

(1) run server command:

cd cmd go run main.go

(2) run server with different log level: cd cmd go run main.go -level=debug

level options: info/debug/warn/error/fatal