Class: Gitloggl::Gitlab::Stack::LoadNotes

Inherits:
Abstract
  • Object
show all
Defined in:
lib/gitloggl/gitlab/stack/load_notes.rb

Instance Attribute Summary

Attributes inherited from Abstract

#app, #env, #options

Instance Method Summary collapse

Methods inherited from Abstract

#call, #initialize, opt

Constructor Details

This class inherits a constructor from Gitloggl::Gitlab::Stack::Abstract

Instance Method Details

#before_callObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/gitloggl/gitlab/stack/load_notes.rb', line 7

def before_call
  result = {}

  env.cli.connection.in_parallel do
    issue_paths.each do |path|
      response = env.cli.connection.get("/api/v4/projects/#{path.project_id}/issues/#{path.issue_id}/notes")
      result[path] = response
    end
  end

  env.issues.each do |issue|
    issue.notes = result[issue.path]&.body || []
  end
end