-
Notifications
You must be signed in to change notification settings - Fork 3
Fix 017 #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Modified NewIssue function to read and use the template body from .issues/template.md when creating new issues. The template sections (Description, Requirements, Success Criteria) are now included in all newly created issues. Fixes #15 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
WalkthroughThis pull request updates the issue counter from 15 to 18, adds three new documentation and example files in the Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
pkg/storage.go (1)
329-366: Good implementation with room for improved error handling.The parsing logic correctly extracts the template body by:
- Splitting on
---to separate frontmatter from content- Skipping the title line (first
#heading)- Returning the remaining body content
The function handles edge cases well (missing template, invalid format, etc.).
However, consider adding logging or error reporting when template parsing fails. Currently, the function silently returns an empty string for all errors, which could make debugging difficult if the template file is corrupted or malformed.
func LoadTemplateBody() string { templatePath := filepath.Join(IssuesDir, TemplateFile) // Read template file data, err := os.ReadFile(templatePath) if err != nil { - // If template doesn't exist, return empty body + // If template doesn't exist, log and return empty body + fmt.Fprintf(os.Stderr, "Warning: Could not read template file: %v\n", err) return "" } // Parse the template to extract body content := string(data) parts := strings.SplitN(content, "---", 3) if len(parts) < 3 { - // Invalid template format, return empty + // Invalid template format, log and return empty + fmt.Fprintf(os.Stderr, "Warning: Invalid template format (expected frontmatter delimited by ---)\n") return "" }Optional consideration: The function reads the template file on every call. For typical usage this is fine, but if you ever need to create many issues programmatically, caching the template body could improve performance.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.issues/.counter(1 hunks).issues/closed/015-make-template-work.md(1 hunks).issues/closed/016-test-template-functionality.md(1 hunks).issues/closed/017-sample-issue-to-show-template.md(1 hunks)pkg/storage.go(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
pkg/storage.go (2)
pkg/issue.go (1)
Issue(6-14)pkg/parser.go (1)
FormatID(108-110)
🔇 Additional comments (5)
.issues/.counter (1)
1-1: LGTM! Counter correctly updated.The counter increment from 15 to 18 correctly reflects the three new issues (015, 016, 017) added in this PR.
.issues/closed/015-make-template-work.md (1)
1-46: LGTM! Well-documented issue.The documentation clearly describes the template functionality bug and expected behavior. This provides good context for understanding the code changes implemented in
pkg/storage.go..issues/closed/017-sample-issue-to-show-template.md (1)
1-24: LGTM! Good demonstration.This sample issue effectively demonstrates the template structure that will be used for new issues, showing the YAML frontmatter and body sections working together.
pkg/storage.go (1)
368-384: LGTM! Clean integration of template loading.The
NewIssue()function now correctly loads and assigns the template body. The implementation properly handles the case whereLoadTemplateBody()returns an empty string (e.g., if the template is missing), falling back to an empty body gracefully..issues/closed/016-test-template-functionality.md (1)
1-23: LGTM! Good test case.This test issue validates that the template functionality works correctly, showing the expected structure with YAML frontmatter and body sections.
Summary by CodeRabbit
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.