Class: CleoQualityReview::Run
- Inherits:
-
Struct
- Object
- Struct
- CleoQualityReview::Run
- Defined in:
- lib/cleo_quality_review/run.rb
Overview
Value object representing a quality review run with its configuration and results
Instance Attribute Summary collapse
-
#artifacts ⇒ RunArtifacts?
readonly
Artifacts associated with this run.
-
#checks ⇒ Array<String>
readonly
Names of checks that were run.
-
#format ⇒ String
readonly
Output format (human, agent, github).
-
#log ⇒ Object
Returns the value of attribute log.
-
#results ⇒ Array<Result>
readonly
Findings from the quality checks.
-
#review_id ⇒ String
readonly
Deterministic identifier for the reviewed diff.
-
#ruby_files ⇒ Array<String>
readonly
Ruby file paths that were analyzed.
-
#run_directory ⇒ String
readonly
Path to the directory containing run artifacts.
-
#target_files ⇒ Array<String>
readonly
File paths that were analyzed.
-
#timestamp ⇒ Integer
readonly
Epoch milliseconds when the run started.
Instance Method Summary collapse
-
#check_outputs ⇒ Array<Hash{Symbol => String}>
Build array of check output hashes for serialization.
-
#manifest_data ⇒ Hash{Symbol => Object}
Build manifest data for artifact persistence.
-
#to_h ⇒ Hash{Symbol => Object}
Convert the run to a hash representation.
Instance Attribute Details
#artifacts ⇒ RunArtifacts? (readonly)
Returns artifacts associated with this run.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/cleo_quality_review/run.rb', line 25 Run = Struct.new( :timestamp, :review_id, :format, :checks, :target_files, :ruby_files, :run_directory, :results, :artifacts, :log, keyword_init: true, ) do ## # Convert the run to a hash representation # @return [Hash{Symbol => Object}] def to_h { timestamp: , review_id: review_id, format: format, checks: checks, target_files: target_files, ruby_files: ruby_files, run_directory: run_directory, changes_diff: artifacts&.changes_diff, check_outputs: check_outputs, findings: Array(results).map(&:to_h), } end ## # Build array of check output hashes for serialization # @return [Array<Hash{Symbol => String}>] def check_outputs return [] unless artifacts artifacts.raw_check_output_records.map(&:to_h) end ## # Build manifest data for artifact persistence # @return [Hash{Symbol => Object}] def manifest_data { review_id: review_id, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end end |
#checks ⇒ Array<String> (readonly)
Returns names of checks that were run.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/cleo_quality_review/run.rb', line 25 Run = Struct.new( :timestamp, :review_id, :format, :checks, :target_files, :ruby_files, :run_directory, :results, :artifacts, :log, keyword_init: true, ) do ## # Convert the run to a hash representation # @return [Hash{Symbol => Object}] def to_h { timestamp: , review_id: review_id, format: format, checks: checks, target_files: target_files, ruby_files: ruby_files, run_directory: run_directory, changes_diff: artifacts&.changes_diff, check_outputs: check_outputs, findings: Array(results).map(&:to_h), } end ## # Build array of check output hashes for serialization # @return [Array<Hash{Symbol => String}>] def check_outputs return [] unless artifacts artifacts.raw_check_output_records.map(&:to_h) end ## # Build manifest data for artifact persistence # @return [Hash{Symbol => Object}] def manifest_data { review_id: review_id, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end end |
#format ⇒ String (readonly)
Returns output format (human, agent, github).
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/cleo_quality_review/run.rb', line 25 Run = Struct.new( :timestamp, :review_id, :format, :checks, :target_files, :ruby_files, :run_directory, :results, :artifacts, :log, keyword_init: true, ) do ## # Convert the run to a hash representation # @return [Hash{Symbol => Object}] def to_h { timestamp: , review_id: review_id, format: format, checks: checks, target_files: target_files, ruby_files: ruby_files, run_directory: run_directory, changes_diff: artifacts&.changes_diff, check_outputs: check_outputs, findings: Array(results).map(&:to_h), } end ## # Build array of check output hashes for serialization # @return [Array<Hash{Symbol => String}>] def check_outputs return [] unless artifacts artifacts.raw_check_output_records.map(&:to_h) end ## # Build manifest data for artifact persistence # @return [Hash{Symbol => Object}] def manifest_data { review_id: review_id, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end end |
#log ⇒ Object
Returns the value of attribute log
25 26 27 |
# File 'lib/cleo_quality_review/run.rb', line 25 def log @log end |
#results ⇒ Array<Result> (readonly)
Returns findings from the quality checks.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/cleo_quality_review/run.rb', line 25 Run = Struct.new( :timestamp, :review_id, :format, :checks, :target_files, :ruby_files, :run_directory, :results, :artifacts, :log, keyword_init: true, ) do ## # Convert the run to a hash representation # @return [Hash{Symbol => Object}] def to_h { timestamp: , review_id: review_id, format: format, checks: checks, target_files: target_files, ruby_files: ruby_files, run_directory: run_directory, changes_diff: artifacts&.changes_diff, check_outputs: check_outputs, findings: Array(results).map(&:to_h), } end ## # Build array of check output hashes for serialization # @return [Array<Hash{Symbol => String}>] def check_outputs return [] unless artifacts artifacts.raw_check_output_records.map(&:to_h) end ## # Build manifest data for artifact persistence # @return [Hash{Symbol => Object}] def manifest_data { review_id: review_id, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end end |
#review_id ⇒ String (readonly)
Returns deterministic identifier for the reviewed diff.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/cleo_quality_review/run.rb', line 25 Run = Struct.new( :timestamp, :review_id, :format, :checks, :target_files, :ruby_files, :run_directory, :results, :artifacts, :log, keyword_init: true, ) do ## # Convert the run to a hash representation # @return [Hash{Symbol => Object}] def to_h { timestamp: , review_id: review_id, format: format, checks: checks, target_files: target_files, ruby_files: ruby_files, run_directory: run_directory, changes_diff: artifacts&.changes_diff, check_outputs: check_outputs, findings: Array(results).map(&:to_h), } end ## # Build array of check output hashes for serialization # @return [Array<Hash{Symbol => String}>] def check_outputs return [] unless artifacts artifacts.raw_check_output_records.map(&:to_h) end ## # Build manifest data for artifact persistence # @return [Hash{Symbol => Object}] def manifest_data { review_id: review_id, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end end |
#ruby_files ⇒ Array<String> (readonly)
Returns Ruby file paths that were analyzed.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/cleo_quality_review/run.rb', line 25 Run = Struct.new( :timestamp, :review_id, :format, :checks, :target_files, :ruby_files, :run_directory, :results, :artifacts, :log, keyword_init: true, ) do ## # Convert the run to a hash representation # @return [Hash{Symbol => Object}] def to_h { timestamp: , review_id: review_id, format: format, checks: checks, target_files: target_files, ruby_files: ruby_files, run_directory: run_directory, changes_diff: artifacts&.changes_diff, check_outputs: check_outputs, findings: Array(results).map(&:to_h), } end ## # Build array of check output hashes for serialization # @return [Array<Hash{Symbol => String}>] def check_outputs return [] unless artifacts artifacts.raw_check_output_records.map(&:to_h) end ## # Build manifest data for artifact persistence # @return [Hash{Symbol => Object}] def manifest_data { review_id: review_id, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end end |
#run_directory ⇒ String (readonly)
Returns path to the directory containing run artifacts.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/cleo_quality_review/run.rb', line 25 Run = Struct.new( :timestamp, :review_id, :format, :checks, :target_files, :ruby_files, :run_directory, :results, :artifacts, :log, keyword_init: true, ) do ## # Convert the run to a hash representation # @return [Hash{Symbol => Object}] def to_h { timestamp: , review_id: review_id, format: format, checks: checks, target_files: target_files, ruby_files: ruby_files, run_directory: run_directory, changes_diff: artifacts&.changes_diff, check_outputs: check_outputs, findings: Array(results).map(&:to_h), } end ## # Build array of check output hashes for serialization # @return [Array<Hash{Symbol => String}>] def check_outputs return [] unless artifacts artifacts.raw_check_output_records.map(&:to_h) end ## # Build manifest data for artifact persistence # @return [Hash{Symbol => Object}] def manifest_data { review_id: review_id, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end end |
#target_files ⇒ Array<String> (readonly)
Returns file paths that were analyzed.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/cleo_quality_review/run.rb', line 25 Run = Struct.new( :timestamp, :review_id, :format, :checks, :target_files, :ruby_files, :run_directory, :results, :artifacts, :log, keyword_init: true, ) do ## # Convert the run to a hash representation # @return [Hash{Symbol => Object}] def to_h { timestamp: , review_id: review_id, format: format, checks: checks, target_files: target_files, ruby_files: ruby_files, run_directory: run_directory, changes_diff: artifacts&.changes_diff, check_outputs: check_outputs, findings: Array(results).map(&:to_h), } end ## # Build array of check output hashes for serialization # @return [Array<Hash{Symbol => String}>] def check_outputs return [] unless artifacts artifacts.raw_check_output_records.map(&:to_h) end ## # Build manifest data for artifact persistence # @return [Hash{Symbol => Object}] def manifest_data { review_id: review_id, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end end |
#timestamp ⇒ Integer (readonly)
Returns epoch milliseconds when the run started.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/cleo_quality_review/run.rb', line 25 Run = Struct.new( :timestamp, :review_id, :format, :checks, :target_files, :ruby_files, :run_directory, :results, :artifacts, :log, keyword_init: true, ) do ## # Convert the run to a hash representation # @return [Hash{Symbol => Object}] def to_h { timestamp: , review_id: review_id, format: format, checks: checks, target_files: target_files, ruby_files: ruby_files, run_directory: run_directory, changes_diff: artifacts&.changes_diff, check_outputs: check_outputs, findings: Array(results).map(&:to_h), } end ## # Build array of check output hashes for serialization # @return [Array<Hash{Symbol => String}>] def check_outputs return [] unless artifacts artifacts.raw_check_output_records.map(&:to_h) end ## # Build manifest data for artifact persistence # @return [Hash{Symbol => Object}] def manifest_data { review_id: review_id, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end end |
Instance Method Details
#check_outputs ⇒ Array<Hash{Symbol => String}>
Build array of check output hashes for serialization
59 60 61 62 63 |
# File 'lib/cleo_quality_review/run.rb', line 59 def check_outputs return [] unless artifacts artifacts.raw_check_output_records.map(&:to_h) end |
#manifest_data ⇒ Hash{Symbol => Object}
Build manifest data for artifact persistence
68 69 70 71 72 73 74 75 76 |
# File 'lib/cleo_quality_review/run.rb', line 68 def manifest_data { review_id: review_id, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end |
#to_h ⇒ Hash{Symbol => Object}
Convert the run to a hash representation
41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/cleo_quality_review/run.rb', line 41 def to_h { timestamp: , review_id: review_id, format: format, checks: checks, target_files: target_files, ruby_files: ruby_files, run_directory: run_directory, changes_diff: artifacts&.changes_diff, check_outputs: check_outputs, findings: Array(results).map(&:to_h), } end |