When using this plugin with Kotlin v2.0.20 or newer, an error occurs due to changes in the Compose Compiler Metrics JSON structure.
The error is triggered by the Strong Skippable mode, which is enabled by default in Kotlin v2.0.20.(see this)
Error Log:
/vendor/bundle/ruby/3.3.0/gems/danger-compose_compiler_metrics-0.0.4/lib/compose_compiler_metrics/plugin.rb:71:in `block (2 levels) in report_metrics_report': undefined method `-' for an instance of Hash (NoMethodError)
diff_value = (new_value - reference_value).then do |v|
Cause
From Kotlin v2.0.20, Strong Skippable mode is enabled by default.
This results in the generated compose compiler metrics JSON file containing the following new object:
The plugin attempts to perform a subtraction operation on this Hash object, resulting in the NoMethodError.
diff_value = (new_value - reference_value).then do |v|
Steps to Reproduce
Use Kotlin v2.0.20 or above in a Android project with Jetpack Compose.
Set up danger-compose_compiler_metrics in Dangerfile.
Run Danger as part of CI process.
Expected Behavior
The plugin should handle the new JSON structure gracefully, either by ignoring the featureFlags object or by updating its parsing logic to accommodate the new format.
Description
When using this plugin with Kotlin v2.0.20 or newer, an error occurs due to changes in the Compose Compiler Metrics JSON structure. The error is triggered by the Strong Skippable mode, which is enabled by default in Kotlin v2.0.20.(see this)
Error Log:
Cause
From Kotlin v2.0.20, Strong Skippable mode is enabled by default. This results in the generated compose compiler metrics JSON file containing the following new object:
The plugin attempts to perform a subtraction operation on this Hash object, resulting in the NoMethodError.
Steps to Reproduce
danger-compose_compiler_metrics
in Dangerfile.Expected Behavior
The plugin should handle the new JSON structure gracefully, either by ignoring the
featureFlags
object or by updating its parsing logic to accommodate the new format.Additional Information