Class: Eco::API::UseCases::GraphQL::Samples::Pages::Template::Deploy::Loop::Result
- Inherits:
-
Struct
- Object
- Struct
- Eco::API::UseCases::GraphQL::Samples::Pages::Template::Deploy::Loop::Result
- Defined in:
- lib/eco/api/usecases/graphql/samples/pages/template/deploy/loop.rb
Overview
Aggregate outcome of one deploy→verify→monitor pass.
Instance Attribute Summary collapse
-
#applied ⇒ Object
Returns the value of attribute applied.
-
#drift ⇒ Object
Returns the value of attribute drift.
-
#sync_readiness ⇒ Object
Returns the value of attribute sync_readiness.
-
#verdict ⇒ Object
Returns the value of attribute verdict.
Instance Method Summary collapse
- #applied_ok? ⇒ Boolean
- #drift_ok? ⇒ Boolean
-
#ok? ⇒ Boolean
Overall gate: the apply was not blocked, the drift (if checked) matched, and verify passed.
- #report ⇒ Object
- #to_h ⇒ Object
- #verify_ok? ⇒ Boolean
Instance Attribute Details
#applied ⇒ Object
Returns the value of attribute applied
34 35 36 |
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/loop.rb', line 34 def applied @applied end |
#drift ⇒ Object
Returns the value of attribute drift
34 35 36 |
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/loop.rb', line 34 def drift @drift end |
#sync_readiness ⇒ Object
Returns the value of attribute sync_readiness
34 35 36 |
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/loop.rb', line 34 def sync_readiness @sync_readiness end |
#verdict ⇒ Object
Returns the value of attribute verdict
34 35 36 |
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/loop.rb', line 34 def verdict @verdict end |
Instance Method Details
#applied_ok? ⇒ Boolean
40 41 42 |
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/loop.rb', line 40 def applied_ok? applied && applied.skipped_reason.nil? end |
#drift_ok? ⇒ Boolean
44 45 46 |
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/loop.rb', line 44 def drift_ok? drift.nil? || drift.match? end |
#ok? ⇒ Boolean
Overall gate: the apply was not blocked, the drift (if checked) matched, and verify passed.
36 37 38 |
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/loop.rb', line 36 def ok? applied_ok? && drift_ok? && verify_ok? end |
#report ⇒ Object
62 63 64 65 66 67 68 69 70 |
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/loop.rb', line 62 def report [ "DEPLOY LOOP: #{ok? ? 'OK' : 'ATTENTION NEEDED'}", applied_line, drift&.report, verdict&.report, sync_readiness&.report ].compact.join("\n\n") end |
#to_h ⇒ Object
52 53 54 55 56 57 58 59 60 |
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/loop.rb', line 52 def to_h { ok: ok?, applied: applied&.to_h, drift: drift&.to_h, verdict: verdict&.to_h, sync_readiness: sync_readiness&.to_h }.compact end |
#verify_ok? ⇒ Boolean
48 49 50 |
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/loop.rb', line 48 def verify_ok? verdict.nil? || verdict.pass? end |