Skip to content

Add negative validation to time estimate update mutations

What does this MR do and why?

For #390579 (closed)

Fixes the issue and merge request update mutations to validate the time estimate is not negative and return an error if it is.

Screenshots or screen recordings

updateIssue

Screenshot_2023-07-19_at_10.32.20_PM

updateMergeRequest

Screenshot_2023-07-19_at_10.33.36_PM

How to set up and validate locally

  1. Run gdk/gitpod server
  2. Visit http://127.0.0.1:3000/-/graphql-explorer
  3. Run timeEstimate update mutation for issue, try a negative timeEstimate and ensure error message is returned and estimate is unchanged
mutation {
  updateIssue(
    input: {
      projectPath: "twitter/Typeahead.Js",
      iid: "40",
      timeEstimate: "-1h"
    }
  ) {
    issue {
      id
      timeEstimate
    }
    errors 
  }
}
  1. Run timeEstimate update mutation for merge request, try a negative timeEstimate and ensure error message is returned and estimate is unchanged
mutation {
  mergeRequestUpdate(input: {
    iid: "5",
    projectPath: "twitter/Typeahead.Js"
    timeEstimate: "-2h"
  }) {
    mergeRequest {
      id
      timeEstimate
    }
  }
}

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Missy Davies

Merge request reports

Loading