Skip to content

Quick actions refactor to handle commits better

In https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20694, we started supporting quick actions on commits.

However, there are a couple of issues with that:

  1. The existing quick actions use issuable everywhere, but Commit is not an Issuable. This is a confusing variable name. We could consider noteable instead.
  2. Because of that, we have a lot of issuable.is_a?(Issuable) checks, but these are easy to miss out on new actions.
  3. We don't have great spec coverage for actions on commits.

One way of solving 1 and 2 might be to explicitly define types that implement a command, by extending the DSL. Something like:

desc 'My command'
explanation { ... }
types Issue, MergeRequest # or Issuable
condition do
  # ...
end
# etc.

@splattael @jprovaznik wdyt?