From ea3a249918fa671b0da703f4f2f784a2a4459a05ef5125a766640a2cf9379beb Mon Sep 17 00:00:00 2001 From: Till Wegmueller Date: Tue, 7 Apr 2026 00:36:33 +0200 Subject: [PATCH] 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. --- crates/runner-integration/src/reporter.rs | 28 ++++++----------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/crates/runner-integration/src/reporter.rs b/crates/runner-integration/src/reporter.rs index be3efed..e654ebf 100644 --- a/crates/runner-integration/src/reporter.rs +++ b/crates/runner-integration/src/reporter.rs @@ -215,35 +215,21 @@ async fn report_to_forgejo( 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 { 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, started_at: Some(now.clone()), stopped_at: Some(now.clone()), log_index: setup_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