Whenever you're ready, walk me through how you'd approach this.
GitLab's CI system tracks the status of each pipeline stage as it runs. A QA engineer wrote this quick Ruby script to simulate three stages sharing a default status template, then asked what it actually prints before trusting the pattern in a test fixture.
default_status = { name: "pending", retries: 0 }
stages = []
3.times do |i|
status = default_status
status[:name] = "stage_#{i}"
stages << status
end
stages.each { |s| puts s[:name] }
puts default_status[:name]
State exactly what this prints, in order, and explain why, before describing the fix.