Skip to content

Data classes that contain classes defined in stability configuration file incorrectly mark Composable as unstable #176

Description

@mlewandowskiphysitrack

Please complete the following information:

  • Library Version: 0.10.0

Describe the Bug:

Let's take following example:

// In build.gradle.kts:
composeStabilityAnalyzer {
    stabilityValidation {
        stabilityConfigurationFiles.add(
            rootProject.layout.projectDirectory.file("stability_config.conf")
        )
    }
}

// stability_config.conf
com.example.MyClassToBeStable

// MyComposable.kt
fun MyComposable(
    myObject: MyClassToBeStable
) { ... }

MyComposable is correctly reported by :debugStabilityCheck as stable ✅

However, if you introduce some wrapper e.g. state:

// MyComposable.kt
data class State(
    val myObject: MyClassToBeStable
)

fun MyComposable(
    state: State
) { ... }

then :debugStabilityCheck incorrectly reports state as unstable, while it's a data class and it contains stable child object.

What is interesting is that IDE with stability config file attached in settings marks this composable correctly as skippable with stable parameter (there's a green box next to it). The issue is only with stabilityDump/Check Gradle tasks.

Expected Behavior:

MyComposable from the example after the changes is reported as skippable, with the state parameter marked as stable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions