Module: Gitlab::Triage::Action
- Defined in:
- lib/gitlab/triage/action.rb,
lib/gitlab/triage/action/base.rb,
lib/gitlab/triage/action/issue.rb,
lib/gitlab/triage/action/delete.rb,
lib/gitlab/triage/action/comment.rb,
lib/gitlab/triage/action/summarize.rb,
lib/gitlab/triage/action/work_item.rb,
lib/gitlab/triage/action/work_item_status.rb,
lib/gitlab/triage/action/comment_on_summary.rb
Defined Under Namespace
Classes: Base, Comment, CommentOnSummary, Delete, Issue, Summarize, WorkItem, WorkItemStatus
Class Method Summary collapse
- .act(action:, dry:, **args) ⇒ Object
-
.actions_for(policy) ⇒ Object
Work items are fetched and updated through the Work Items REST API, which does not share the issues note/quick-action write path.
- .process(policy:, **args) ⇒ Object
Class Method Details
.act(action:, dry:, **args) ⇒ Object
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/gitlab/triage/action.rb', line 45 def self.act(action:, dry:, **args) klass = if dry action.const_get(:Dry) else action end klass.new(**args).act end |
.actions_for(policy) ⇒ Object
Work items are fetched and updated through the Work Items REST API, which does not share the issues note/quick-action write path. Their actions (assign, label, comment) are handled by a dedicated action instead of the note-based Comment action.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/gitlab/triage/action.rb', line 26 def self.actions_for(policy) if policy.type == 'work_items' [ [Summarize, policy.summarize?], [WorkItem, policy.work_item?], [CommentOnSummary, policy.comment_on_summary?] ] else [ [Summarize, policy.summarize?], [Comment, policy.comment?], [CommentOnSummary, policy.comment_on_summary?], [Issue, policy.issue?], [Delete, policy.delete?], [WorkItemStatus, policy.work_item_status?] ] end end |
.process(policy:, **args) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/gitlab/triage/action.rb', line 14 def self.process(policy:, **args) policy.validate! actions_for(policy).each do |action, active| act(action: action, policy: policy, **args) if active end end |