Class: Upkeep::HerbSupport::DeveloperReport

Inherits:
Object
  • Object
show all
Defined in:
lib/upkeep/herb/developer_report.rb

Constant Summary collapse

FALLBACK_ACTIONS =
{
  "helper_hidden_collection" => "Move collection rendering out of helper-only HTML and into an explicit render site.",
  "manifest_runtime_mismatch" => "Inspect manifest provenance mismatches before trusting narrow updates.",
  "multi_root_partial" => "Wrap the partial in one stable root element so it can carry a fragment marker.",
  "no_herb_render_site" => "Extract updateable repeated markup into a partial render so Herb can plan a render site.",
  "page_dependency_without_narrower_frame" => "Add a fragment or render-site boundary around the data-dependent region.",
  "parse_failure" => "Fix the Herb parse error before using source-derived update addresses.",
  "preloaded_plain_data" => "Keep record identity available to the view or attach summaries to their source records."
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(manifests:, proof_report: nil) ⇒ DeveloperReport

Returns a new instance of DeveloperReport.



18
19
20
21
# File 'lib/upkeep/herb/developer_report.rb', line 18

def initialize(manifests:, proof_report: nil)
  @manifests = manifests
  @proof_report = proof_report
end

Instance Method Details

#to_hObject



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/upkeep/herb/developer_report.rb', line 23

def to_h
  actions = template_actions + fallback_actions

  {
    summary: TemplateManifest.summary(manifests).merge(
      page_fallback_reasons: page_fallback_reasons,
      actionable_items: actions.size,
      gate_passed: actions.all? { |action| action.fetch(:message) }
    ),
    templates: manifests.map { |manifest| template_report(manifest) },
    actions: actions
  }
end