Class: PactBroker::Matrix::DeploymentStatusSummary
- Inherits:
-
Object
- Object
- PactBroker::Matrix::DeploymentStatusSummary
- Extended by:
- Forwardable
- Includes:
- Logging
- Defined in:
- lib/pact_broker/matrix/deployment_status_summary.rb
Instance Attribute Summary collapse
-
#all_rows ⇒ Object
readonly
Returns the value of attribute all_rows.
-
#query_results ⇒ Object
readonly
Returns the value of attribute query_results.
Instance Method Summary collapse
- #counts ⇒ Object
- #deployable? ⇒ Boolean
-
#initialize(query_results) ⇒ DeploymentStatusSummary
constructor
A new instance of DeploymentStatusSummary.
- #reasons ⇒ Object
Methods included from Logging
included, #log_error, #log_with_tag, #measure_info
Constructor Details
#initialize(query_results) ⇒ DeploymentStatusSummary
Returns a new instance of DeploymentStatusSummary.
14 15 16 17 18 |
# File 'lib/pact_broker/matrix/deployment_status_summary.rb', line 14 def initialize(query_results) @query_results = query_results @all_rows = query_results.rows @dummy_selectors = create_dummy_selectors end |
Instance Attribute Details
#all_rows ⇒ Object (readonly)
Returns the value of attribute all_rows.
11 12 13 |
# File 'lib/pact_broker/matrix/deployment_status_summary.rb', line 11 def all_rows @all_rows end |
#query_results ⇒ Object (readonly)
Returns the value of attribute query_results.
11 12 13 |
# File 'lib/pact_broker/matrix/deployment_status_summary.rb', line 11 def query_results @query_results end |
Instance Method Details
#counts ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/pact_broker/matrix/deployment_status_summary.rb', line 20 def counts { success: considered_rows.count(&:success), failed: considered_rows.count { |row| row.success == false }, unknown: required_integrations_without_a_row.count + considered_rows.count { |row| row.success.nil? }, ignored: resolved_ignore_selectors.any? ? ignored_rows.count : nil }.compact end |
#deployable? ⇒ Boolean
29 30 31 32 33 34 |
# File 'lib/pact_broker/matrix/deployment_status_summary.rb', line 29 def deployable? return false if considered_specified_selectors_that_do_not_exist.any? return nil if considered_rows.any?{ |row| row.success.nil? } return nil if required_integrations_without_a_row.any? considered_rows.all?(&:success) # true if considered_rows is empty end |
#reasons ⇒ Object
36 37 38 |
# File 'lib/pact_broker/matrix/deployment_status_summary.rb', line 36 def reasons .any? ? + : + end |