Skip to content

Comments

Fix ksrc file-id cache fallback and improve help#15

Merged
Nek-12 merged 3 commits intomainfrom
fix/ksrc-include-builds-cat-search
Jan 24, 2026
Merged

Fix ksrc file-id cache fallback and improve help#15
Nek-12 merged 3 commits intomainfrom
fix/ksrc-include-builds-cat-search

Conversation

@Nek-12
Copy link
Member

@Nek-12 Nek-12 commented Jan 24, 2026

Summary

  • make file-id based reads fall back to Gradle cache like search
  • allow cache fallback to honor explicit versions
  • improve root help text and bump patch version
  • trim ksrc skill guidance

Testing

  • go test ./...
  • go build -o ./bin/ksrc ./cmd/ksrc

Summary by CodeRabbit

  • Chores

    • Bumped version to 0.5.1
  • Bug Fixes

    • Fixed source resolution to use cache fallback for specified versions
  • New Features

    • CLI now displays help by default when invoked without arguments
  • Documentation

    • Updated command descriptions and documentation with improved guidance, clearer usage examples, and enhanced troubleshooting steps

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 24, 2026

📝 Walkthrough

Walkthrough

This PR bumps the version to 0.5.1, updates CLI documentation to emphasize Gradle usage, adds a startup guard to display help when no arguments are provided, and modifies cache fallback behavior in source resolution to always attempt cache lookup even when a version is explicitly specified.

Changes

Cohort / File(s) Summary
Version & Metadata
VERSION, internal/cli/root.go
Version bumped from 0.5.0 to 0.5.1; root command description updated from Kotlin-focused to Gradle-focused with usage guidance and caveats.
Cache Fallback Behavior
internal/cli/helpers.go, internal/cli/helpers_test.go
Modified resolveSources to always call FindCachedSources with coord.Version when allowCacheFallback is true, enabling cache fallback for specific versions. Added test TestResolveSourcesCacheFallbackUsesVersionWhenProvided to verify behavior.
Source Resolution Parameter Updates
internal/cli/cat.go, internal/cli/open.go, internal/cli/where.go
Each file updated resolveSources calls in coordinate-based code paths to pass true instead of false for the allowCacheFallback parameter.
Startup Guard
cmd/ksrc/main.go
Added logic to inject default --help argument when no command-line arguments are provided.
Documentation
skills/ksrc/SKILL.md
Refined CLI description from Kotlin-specific to Kotlin/Java dependency sources; expanded usage examples with regex glob patterns; added guidance for scope limiting via flags; revised common issues section with concrete troubleshooting steps; expanded flag reference.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main changes: fixing cache fallback for file-id operations and improving help documentation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fix/ksrc-include-builds-cat-search

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@skills/ksrc/SKILL.md`:
- Around line 20-26: The three consecutive bullets in SKILL.md that begin with
“Gradle not found”, “Gradle build script is failing in the repo”, and “Gradle
fails with unresolved class version” should be reworded to avoid repetition and
fix capitalization: change the second to “Build script failing in the repo: ksrc
falls back to cache-only resolution and warns; re-run with -v to see Gradle
output for debugging.” and the third to “Unresolved class version: local Java
resolves to an unsupported JDK for Gradle—guide the user to fix Gradle↔JDK
incompatibility.” Keep the “Gradle not found” bullet as-is but ensure consistent
punctuation and parallel structure across all three bullets.

@Nek-12 Nek-12 self-assigned this Jan 24, 2026
@Nek-12 Nek-12 added the autorelease Trigger release on merge label Jan 24, 2026
@Nek-12 Nek-12 merged commit 0eb8923 into main Jan 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autorelease Trigger release on merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant