code: func findAncestorStepId(step *flow.Step) (int, bool) {
  	current := step
  	taskCount := len(current.Tasks)
  
  	// println("find step", step.Name)
  
  	for taskCount == len(current.Tasks) {
  		if len(current.InputDatasets) > 1 {
  			// more than 2 dataset inputs
  			break
  		}
  		if len(current.InputDatasets) == 0 {
  			// no dataset inputs
  			break
  		}
  		if !isMergeableDataset(current.InputDatasets[0], taskCount) {
  			break
  		}
  		if (!current.IsOnDriverSide && current.InputDatasets[0].Step.IsOnDriverSide) ||
  			(current.IsOnDriverSide && !current.InputDatasets[0].Step.IsOnDriverSide) {
  			break
  		}
  
  		current = current.InputDatasets[0].Step
  		taskCount = len(current.Tasks)
  
  	}
  	return current.Id, true
  }
docs: // find mergeable parent step or itself if parent is not mergeable