Class: Textus::Doctor::Check::LifecycleActionInvalid

Inherits:
Textus::Doctor::Check show all
Defined in:
lib/textus/doctor/check/lifecycle_action_invalid.rb

Overview

ADR 0079: refresh is valid only for intake entries; drop/archive are invalid for intake entries (they would re-fetch, not prune).

Instance Method Summary collapse

Methods inherited from Textus::Doctor::Check

#initialize, name_key

Constructor Details

This class inherits a constructor from Textus::Doctor::Check

Instance Method Details

#callObject



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/textus/doctor/check/lifecycle_action_invalid.rb', line 7

def call
  manifest.data.entries.filter_map do |mentry|
    policy = manifest.rules.for(mentry.key).lifecycle
    next if policy.nil?

    intake = mentry.is_a?(Textus::Manifest::Entry::Intake)
    bad = (policy.on_expire == :refresh && !intake) || (policy.destructive? && intake)
    next unless bad

    issue_for(mentry, policy, intake)
  end
end