Class: Releases::Evidence

Inherits:
ApplicationRecord show all
Includes:
Presentable, ShaAttribute
Defined in:
app/models/releases/evidence.rb

Instance Method Summary collapse

Methods included from Presentable

#present

Methods inherited from ApplicationRecord

at_most, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, underscore, where_exists, with_fast_statement_timeout, without_order

Instance Method Details

#milestonesObject


16
17
18
# File 'app/models/releases/evidence.rb', line 16

def milestones
  @milestones ||= release.milestones.includes(:issues)
end

#summaryObject

Return `summary` without sensitive information.

Removing issues from summary in order to prevent leaking confidential ones. See more gitlab.com/gitlab-org/gitlab/issues/121930


25
26
27
28
29
30
31
32
33
# File 'app/models/releases/evidence.rb', line 25

def summary
  safe_summary = read_attribute(:summary)

  safe_summary.dig('release', 'milestones')&.each do |milestone|
    milestone.delete('issues')
  end

  safe_summary
end