Skip to content

Conversation

@skydoves
Copy link
Owner

@skydoves skydoves commented Nov 13, 2025

Add an explicit project name to capture the project name during configurations (#41)

Summary by CodeRabbit

  • Improvements
    • Enhanced project name handling during task configuration for improved Gradle build reliability.

@coderabbitai
Copy link

coderabbitai bot commented Nov 13, 2025

Walkthrough

The changes introduce a new projectName property to the Gradle plugin's task classes (StabilityCheckTask and StabilityDumpTask), replacing direct references to project.name. The property is initialized during task registration in StabilityAnalyzerGradlePlugin and used throughout task execution for logging and file naming.

Changes

Cohort / File(s) Summary
Task API Definitions
stability-gradle/api/stability-gradle.api
Added abstract accessors getProjectName() returning Lorg/gradle/api/provider/Property to expand public API signatures for both StabilityCheckTask and StabilityDumpTask.
Task Registration
stability-gradle/src/main/kotlin/com/skydoves/compose/stability/gradle/StabilityAnalyzerGradlePlugin.kt
Updated task registrations to set projectName.set(target.name), capturing Gradle project name into a configuration property for downstream task usage.
Task Implementations
stability-gradle/src/main/kotlin/com/skydoves/compose/stability/gradle/StabilityCheckTask.kt, StabilityDumpTask.kt
Added projectName: Property<String> with @get:Input annotation and replaced all usages of project.name with projectName.get() in logging, file naming, and generated output.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Consistent property addition pattern applied across two task classes
  • Straightforward replacement of project.name with projectName.get()
  • API surface additions are minimal and predictable
  • No complex logic or control-flow changes

Possibly related PRs

Suggested labels

Stability Validation

Poem

🐰 A name for each task, now captured so clear,
With properties bound, the project draws near,
No more runtime guessing, the name's now defined,
Configuration-time magic, a reference so kind! ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description is minimal and missing most required template sections: Goal, Implementation details, and Explain examples are absent. Add missing sections from the template including Goal (linking to issue #41), Implementation details, and code examples to satisfy repository requirements.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title refers to adding an explicit project name property and is somewhat related to the changes, but contains awkward phrasing ('to captures') that suggests proofreading issues.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch improve/explicit-projectname

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d5425ce and f145a59.

📒 Files selected for processing (4)
  • stability-gradle/api/stability-gradle.api (2 hunks)
  • stability-gradle/src/main/kotlin/com/skydoves/compose/stability/gradle/StabilityAnalyzerGradlePlugin.kt (2 hunks)
  • stability-gradle/src/main/kotlin/com/skydoves/compose/stability/gradle/StabilityCheckTask.kt (4 hunks)
  • stability-gradle/src/main/kotlin/com/skydoves/compose/stability/gradle/StabilityDumpTask.kt (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: API check
  • GitHub Check: Runtime Module Tests
  • GitHub Check: Compiler Tests (FIR/IR Dumps)
🔇 Additional comments (9)
stability-gradle/api/stability-gradle.api (1)

28-28: LGTM! API changes properly expose the new property.

The addition of getProjectName() methods to both task classes is binary-compatible and follows Gradle's API conventions. The new accessors correctly return Property<String> types for lazy configuration.

Also applies to: 39-39

stability-gradle/src/main/kotlin/com/skydoves/compose/stability/gradle/StabilityAnalyzerGradlePlugin.kt (2)

71-71: LGTM! Configuration-time capture of project name.

Setting projectName from target.name during task registration correctly captures the project name at configuration time, which is essential for configuration cache compatibility.


85-85: LGTM! Consistent with stabilityDump task.

The projectName property is set consistently for both tasks, ensuring uniform behavior across the plugin.

stability-gradle/src/main/kotlin/com/skydoves/compose/stability/gradle/StabilityCheckTask.kt (3)

59-63: LGTM! Well-documented property with correct annotation.

The projectName property is properly declared with the @get:Input annotation for Gradle task input tracking. The documentation accurately explains the configuration cache compatibility benefit.


76-79: LGTM! Consistent usage throughout logging.

All log messages now use projectName.get() consistently, ensuring the captured configuration-time value is used rather than accessing project state during execution.

Also applies to: 87-91, 99-103


95-95: LGTM! Correct usage for file naming.

Using projectName.get() for the stability file path ensures consistent file naming based on the configuration-time project name.

stability-gradle/src/main/kotlin/com/skydoves/compose/stability/gradle/StabilityDumpTask.kt (3)

59-63: LGTM! Consistent property declaration.

The projectName property declaration matches the implementation in StabilityCheckTask, ensuring consistency across both task classes. The @get:Input annotation and documentation are appropriate.


76-76: LGTM! Proper usage in logging and file naming.

Both the log message and output file name correctly use projectName.get() to reference the configuration-time project name value.

Also applies to: 83-83


287-287: LGTM! Generated header uses captured project name.

The generated stability file header correctly references the task using projectName.get(), ensuring users see accurate instructions for updating the file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@skydoves skydoves merged commit f3e60bb into main Nov 13, 2025
10 checks passed
@skydoves skydoves deleted the improve/explicit-projectname branch November 13, 2025 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants