code: private Integer resolveStageOrder(long pipelineId, String stageName) {
          Integer order = getStageOrderInPipeline(pipelineId, stageName);
          if (order == null) {
              order = getMaxStageOrderInPipeline(pipelineId) + 1;
          }
          return order;
      }
docs: stage order in current pipeline by 1, as current stage's order