mirror of
https://codeberg.org/Toasterson/solstice-ci.git
synced 2026-04-10 13:20:41 +00:00
Fix step mapping: only real YAML steps get StepState entries
Forgejo's "Set up job" and "Complete job" are virtual UI steps that auto-collect logs outside any real step's range. Only the actual YAML step (id=0) needs a StepState. Setup logs before its log_index go to "Set up job" automatically.
This commit is contained in:
parent
f61588e68b
commit
ea3a249918
1 changed files with 7 additions and 21 deletions
|
|
@ -215,35 +215,21 @@ async fn report_to_forgejo(
|
||||||
|
|
||||||
total_lines = setup_lines + work_lines;
|
total_lines = setup_lines + work_lines;
|
||||||
|
|
||||||
// Step 0: "Set up job" — boot, env, tool_check etc.
|
// Forgejo's "Set up job" and "Complete job" are virtual UI steps —
|
||||||
|
// they auto-collect logs outside any real step's range. Only actual
|
||||||
|
// YAML steps need StepState entries with matching IDs.
|
||||||
|
//
|
||||||
|
// The YAML trigger has 1 step (id=0). Logs before its log_index
|
||||||
|
// go to "Set up job", logs in its range go to the step, and
|
||||||
|
// any logs after go to "Complete job".
|
||||||
step_states.push(StepState {
|
step_states.push(StepState {
|
||||||
id: 0,
|
id: 0,
|
||||||
result: v1::Result::Success as i32,
|
|
||||||
started_at: Some(now.clone()),
|
|
||||||
stopped_at: Some(now.clone()),
|
|
||||||
log_index: 0,
|
|
||||||
log_length: setup_lines,
|
|
||||||
});
|
|
||||||
|
|
||||||
// Step 1: The Actions YAML step — KDL workflow steps + other output
|
|
||||||
step_states.push(StepState {
|
|
||||||
id: 1,
|
|
||||||
result: result as i32,
|
result: result as i32,
|
||||||
started_at: Some(now.clone()),
|
started_at: Some(now.clone()),
|
||||||
stopped_at: Some(now.clone()),
|
stopped_at: Some(now.clone()),
|
||||||
log_index: setup_lines,
|
log_index: setup_lines,
|
||||||
log_length: work_lines,
|
log_length: work_lines,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Step 2: "Complete job"
|
|
||||||
step_states.push(StepState {
|
|
||||||
id: 2,
|
|
||||||
result: result as i32,
|
|
||||||
started_at: Some(now.clone()),
|
|
||||||
stopped_at: Some(now.clone()),
|
|
||||||
log_index: total_lines,
|
|
||||||
log_length: 0,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send final "no more logs" marker
|
// Send final "no more logs" marker
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue