Skip to content

Make previousStageJobsOrNeeds return union

Updates the return type for previousStageJobsOrNeeds to be a BuildNeedType instead of a JobType. This caused an incident because the previous_stage_jobs_or_needs method was returning Ci::BuildNeed objects instead of the jobs that matches the defined needs. Ci::BuildNeed does not have a type method, so when JobType tried to calculate the id using the below method, a NoMethodError was thrown.