Skip to content

Conversation

@JonghunYu
Copy link
Member

@JonghunYu JonghunYu commented Nov 24, 2025

Summary by CodeRabbit

  • New Features

    • Issues now automatically populate with template content upon creation, ensuring consistent formatting and structure.
  • Documentation

    • Added comprehensive documentation describing template functionality and providing sample issue templates for reference.

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

JonghunYu and others added 5 commits November 24, 2025 11:38
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>
@coderabbitai
Copy link

coderabbitai bot commented Nov 24, 2025

Walkthrough

This pull request updates the issue counter from 15 to 18, adds three new documentation and example files in the .issues/closed/ directory to demonstrate and document template functionality, and implements template body loading in pkg/storage.go. The changes introduce a new LoadTemplateBody() function that reads .issues/template.md, parses and extracts content after the YAML frontmatter and title heading, then integrates this into the NewIssue() function to populate newly created issues with template content rather than empty strings.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • pkg/storage.go changes: Review the frontmatter parsing logic to ensure correct delimiter handling (\-\-\-) and that title line trimming (first line starting with "\#") matches intended behavior
  • Error handling: Verify graceful fallback to empty string when template is missing or parsing fails
  • Integration with NewIssue(): Confirm the template body assignment doesn't break existing issue creation workflows

Poem

🐰 A template blooms from frontmatter's fold,
Where body and structure finally hold,
No empty issues shall see the light,
The template path sets everything right! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Fix 017' is vague and non-descriptive, using only a reference number without conveying what the fix actually accomplishes or which feature/bug it addresses. Use a more descriptive title that explains the actual change, such as 'Implement template loading for issue creation' or 'Load template body when creating new issues'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ 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-017

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.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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

Copy link

@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: 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:

  1. Splitting on --- to separate frontmatter from content
  2. Skipping the title line (first # heading)
  3. 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

📥 Commits

Reviewing files that changed from the base of the PR and between bcdcbf3 and edf97bf.

📒 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 where LoadTemplateBody() 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.

@JonghunYu JonghunYu merged commit d561407 into develop Nov 24, 2025
4 checks passed
@JonghunYu JonghunYu deleted the fix-017 branch November 24, 2025 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants