Skip to content
Snippets Groups Projects

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

Merged results pipeline #944008728 passed

Pipeline: E2E GDK

#944024511

    Pipeline: GitLab

    #944013874

      Merged results pipeline passed for 9998f751

      Test coverage 82.40% (15.94%) from 2 jobs
      Approval is optional
      Ready to merge by members who can write to the target branch.

      Activity

      Filter activity
      • Approvals
      • Assignees & reviewers
      • Comments (from bots)
      • Comments (from users)
      • Commits & branches
      • Edits
      • Labels
      • Lock status
      • Mentions
      • Merge request status
      • Tracking
    • Missy Davies marked this merge request as ready

      marked this merge request as ready

    • @gitlab-bot ready @zillemarco

      Another piece of the puzzle for you to look at! 🧩

    • requested review from @zillemarco

    • @zillemarco, this Community contribution is ready for review.

      • Do you have capacity and domain expertise to review this? We are mindful of your time, so if you are not able to take this on, please re-assign to one or more other reviewers.
      • Add the workflowin dev label if the merge request needs action from the author.

      This message was generated automatically. You're welcome to improve it.

    • Missy Davies added 1 commit

      added 1 commit

      • dd6e512c - Add negative validation to estimate mutations

      Compare with previous version

    • Loading
    • Loading
    • Loading
    • Loading
    • Loading
    • Loading
    • Loading
    • Loading
    • Loading
    • Loading
    • Please register or sign in to reply
      Loading