Skip to content

Fix flakey time-sensitive move slash command with unauthorized project

What does this MR do?

EE MR: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6124

Fix flakey time-sensitive move slash command with unauthorized project

Found while working on https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6051, failing test: https://gitlab.com/gitlab-org/gitlab-ee/-/jobs/74649299

Are there points in the code the reviewer needs to double check?

As a note, we don't show Commands applied when the project doesn't exist, see this rspec test

Should we fix the slash command to not return Commands applied with an unauthorized project? (let's create a follow-up issue)

root/waefeweaf is a valid project but the slash command user isn't authorized

# `root/unauthorized` is a valid project but unauthorized to move to that project
POST <namespace>/<project>/notes?target_id=336&target_type=issue with `note[note]: /move root/waefeweaf`
{
  "commands_changes": {
    "target_project": {
      // ...
    }
  },
  "valid": false,
  "errors": {
    "commands_only": [
      "Commands applied"
    ]
  }
}

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/47936

Edited by Eric Eastwood

Merge request reports