Adding ktlint to Test Improvers PRs#3718
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR updates two workflow documentation files (.github/workflows/) to standardize guidance on Kotlin formatting and Gradle execution within sandbox constraints. The daily-test-improver.md file now specifies that Task 3 should run Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related issues
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3718 +/- ##
============================================
- Coverage 23.35% 23.34% -0.02%
+ Complexity 3927 3925 -2
============================================
Files 923 923
Lines 56058 56058
Branches 6641 6641
============================================
- Hits 13093 13084 -9
- Misses 41271 41282 +11
+ Partials 1694 1692 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
shubham1g5
left a comment
There was a problem hiding this comment.
think we need to have these prompts quite small for them to be not costly, I would suggest just adding a single line ktlint all changed files as one sentence in both the files and testing whether the agent is able to figure out the rest of details by itself as a first iteration here.
conroy-ricketts
left a comment
There was a problem hiding this comment.
I have no additional concerns
|
@shubham1g5 @OrangeAndGreen @conroy-ricketts Question: Do we still want this ktlintFile gradle task to be working? I don't see any advantage if ktlint is installed now. |
yeah, think it's still good to rely on it, the idea is for AI agents or humans to be able to use it when they need to ktlint (locally or on an external host) |
I am not sure if I understand your comment here. Do you mean here that we should remove 'Running Gradle Tasks' from the appendix and give the command 'ktlint all changed files'? |
yeah I just meant replacing all additions with the single line that asks it to do Ktlint and relying on the agent to know it knows how to do it in project context using But if KTlint is already happening on new PRs, think we don't need to take any action here at all and close this PR without merge. |
Now, with ktlint being installed already on GitHub, we can try for that simple command, but I have already given comments here and here to the ktlint file, but there has been no action so far. I am waiting to get some proof that it can run ktlint without a Gradle task.
I think we will still require this PR, as daily-test-improver and pr-comment-handler don't have any mention of ktlint. |
They read AGENTS.md which mention that. Think this issue was only on old PRs when we didn't mention |
|
@Jignesh-dimagi it's taking a long time for the GitHub bot to update the Test Improver PRs I think. Are you ok with me using Claude to close out these PRs and we can watch for ktlint on new PRs in the future? They've been sitting for a while. I started using Claude on one of these PRs and then realized after that this PR exists |
Yes, you can go ahead with other PRs, as they are not related to this one. However, the ktlint GitHub bot doesn't seem to be responding, at least for me. |
Problem:
In PR #3614, the PR Comment Handler bot was asked to format a Kotlin file via ./gradlew ktlintFile and replied that it couldn't.
The Gradle wrapper cannot write its lock file under
~/.gradle. The bot runs inside gh-aw's sandboxed container where $HOME is read-only, so the Gradle wrapper's default user-home directory (~/.gradle/wrapper/dists/.../*.lock) is unwritable. Result: any ./gradlew invocation by either the PR Comment Handler or the Daily Test Improver fails.Fix:
Edited two workflow prompts (pr-comment-handler.md, daily-test-improver.md) to:
GRADLE_USER_HOME=$GITHUB_WORKSPACE/.gradle-homeinline on every./gradlewcall./gradlew ktlintFile -PfilePath=<path>on that file.Running Gradle Tasksfrom Step 5.3, to run./gradlew ktlintFile -PfilePath=<path>for kotlin fileWhat to expect in future Test Improver PRs:
This PR does not fix:
../commcare. This PR doesn't fix this issue.Note:
No .lock.yml regeneration needed - Lock files only need regenerating when we change the .md frontmatter (network allowlist, tools, schedule, safe-outputs, etc.). Pure prompt-body edits like this PR don't require it.