Repository navigation
chore: sync workflow templates #154
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -286,6 +286,29 @@ def _formatted_output_valid(text: str) -> bool: | |||||
| return all(section in text for section in required) | ||||||
|
|
||||||
|
|
||||||
| def _select_code_fence(text: str) -> str: | ||||||
| runs = [len(match.group(0)) for match in re.finditer(r"`+", text)] | ||||||
| fence_len = max(3, max(runs, default=0) + 1) | ||||||
| return "`" * fence_len | ||||||
|
|
||||||
|
|
||||||
| def _append_raw_issue_section(formatted: str, issue_body: str) -> str: | ||||||
| raw = issue_body.strip() | ||||||
| if not raw: | ||||||
| return formatted | ||||||
| marker = "<summary>Original Issue</summary>" | ||||||
| if marker in formatted: | ||||||
| return formatted | ||||||
| fence = _select_code_fence(raw) | ||||||
| details = ( | ||||||
| "\n\n<details>\n" | ||||||
| "<summary>Original Issue</summary>\n\n" | ||||||
| f"{fence}text\n{raw}\n{fence}\n" | ||||||
|
||||||
| f"{fence}text\n{raw}\n{fence}\n" | |
| f"{fence}markdown\n{raw}\n{fence}\n" |
Copilot
AI
Jan 5, 2026
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.
The new functions _select_code_fence and _append_raw_issue_section lack test coverage. Since this repository has comprehensive test coverage for other modules (as seen in the tests directory), these new functions should have corresponding unit tests to verify:
- Fence selection with various backtick patterns in the input
- Handling of empty issue bodies
- Duplicate marker detection
- Proper HTML details block formatting
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.
The duplicate detection check only looks for the exact marker string in the formatted output. However, if the original raw issue body contains the text "<summary>Original Issue</summary>" (which could happen if someone is discussing HTML or documenting this feature), the function would incorrectly skip appending the raw issue section when it should still be added. Consider checking for the complete details block structure or using a more unique marker pattern.