fix(lanes): stop archive/activate from clobbering feature title and links

archiveActiveFeature was overwriting a feature's own title with the
LIVE lane's title on every clear/switch — a --title set on activation
silently disappeared. activateFeature restored stage/status/gate/CI/
stages/notes onto the live lane when switching back to a past feature,
but never links, so they vanished on reactivation. Both are fixed, with
a regression test for each (full activate/archive/reactivate round trip
for links).

Also fixes server/routes/lanes.js: the doc comment explaining GET
/:id/git's rationale had been left sitting above the newly-inserted
/:id/features routes instead of its own route.

docs/API.md's Lane features section described fields and behavior that
don't exist in the real routes (an "active" boolean, a POST response
containing "archivedPrevious", a "409 ESTALE" concurrency response) —
rewritten to match the actual request/response shapes exactly.
This commit is contained in:
2026-08-04 15:17:14 +07:00
parent 917f0794d5
commit fcc7a8f2f3
4 changed files with 84 additions and 62 deletions
+3 -3
View File
@@ -99,12 +99,11 @@ function archiveActiveFeature(laneId) {
db.prepare(
`UPDATE lane_features SET
title = ?, branch = ?, pipeline = ?, stage = ?, stage_since = ?, status = ?,
branch = ?, pipeline = ?, stage = ?, stage_since = ?, status = ?,
gate_decision = ?, ci_status = ?, qc_dev = ?, stages = ?, links = ?, notes = ?,
archived_at = ?, updated_at = ?
WHERE id = ?`
).run(
lane.title,
lane.branch,
lane.pipeline,
lane.stage,
@@ -172,7 +171,7 @@ function activateFeature(laneId, rawSlug, options = {}) {
db.prepare(
`UPDATE lanes SET
stage = ?, stage_since = ?, status = ?, gate_decision = ?, ci_status = ?,
stages = ?, notes = ?, active_feature_id = ?, updated_at = ?
stages = ?, links = ?, notes = ?, active_feature_id = ?, updated_at = ?
WHERE id = ?`
).run(
target.stage,
@@ -181,6 +180,7 @@ function activateFeature(laneId, rawSlug, options = {}) {
target.gate_decision,
target.ci_status,
JSON.stringify(target.stages || {}),
JSON.stringify(target.links || {}),
target.notes,
target.id,
nowIso(),