feat: Gitea issue body parser for structured task extraction (closes #177) #183

Closed
Rockachopa wants to merge 0 commits from feat/177-issue-parser into main
Owner

Closes #177

Added:

  • scripts/gitea_issue_parser.py — Parses Gitea issue markdown into structured JSON
  • scripts/test_gitea_issue_parser.py — 6 tests

Extracted fields:

  • title, context, criteria[], labels[], epic_ref, sections{}

Usage:

cat issue.txt | python3 scripts/gitea_issue_parser.py --stdin --pretty
python3 scripts/gitea_issue_parser.py --url https://forge.example.com/api/v1/repos/owner/repo/issues/123 --pretty
Closes #177 **Added:** - `scripts/gitea_issue_parser.py` — Parses Gitea issue markdown into structured JSON - `scripts/test_gitea_issue_parser.py` — 6 tests **Extracted fields:** - `title`, `context`, `criteria[]`, `labels[]`, `epic_ref`, `sections{}` **Usage:** ```bash cat issue.txt | python3 scripts/gitea_issue_parser.py --stdin --pretty python3 scripts/gitea_issue_parser.py --url https://forge.example.com/api/v1/repos/owner/repo/issues/123 --pretty ```
Rockachopa added 2 commits 2026-04-15 03:51:10 +00:00
Timmy approved these changes 2026-04-15 04:13:15 +00:00
Dismissed
Timmy left a comment
Owner

Mostly looks good with minor suggestions below.

Scope: 2 file(s) changed (240+ / 0-)

Issues

  • Possible duplicate: This PR appears similar to #177. Consider closing duplicates.
Mostly looks good with minor suggestions below. **Scope**: 2 file(s) changed (240+ / 0-) ### Issues - **Possible duplicate**: This PR appears similar to #177. Consider closing duplicates.
Timmy approved these changes 2026-04-15 14:35:21 +00:00
Timmy left a comment
Owner

DUPLICATE of #177: Both PRs implement a Gitea issue body parser. This one (#183) is slightly cleaner with better type hints (List, Dict, Any, Optional from typing) and a simpler regex approach. PR #177 has a more elaborate section parsing loop and handles token auth for URL fetching.

This PR:

  • Cleaner parse_issue_body with typed signature
  • Epic ref extraction uses compiled patterns with finditer
  • Section parsing via regex multiline matches
  • Tests are well-structured but use an unusual importlib.util pattern instead of normal imports

Issues:

  1. Import pattern in tests is fragile: Using importlib.util.spec_from_file_location to import a sibling file is unnecessary. A simple from gitea_issue_parser import parse_issue_body with sys.path.insert would be cleaner (as PR #177 does).

  2. epic_ref is int in #183 but string in #177: This PR returns int(match.group(1)) while #177 returns f"#{match.group(1)}". The int representation is more useful for downstream processing.

  3. context extraction: The context is capped at 500 chars, which is reasonable, but the regex to strip the leading header is fragile.

Recommend merging #183 (this one) over #177. Close #177 as superseded.

**DUPLICATE of #177**: Both PRs implement a Gitea issue body parser. This one (#183) is slightly cleaner with better type hints (List, Dict, Any, Optional from typing) and a simpler regex approach. PR #177 has a more elaborate section parsing loop and handles token auth for URL fetching. This PR: - Cleaner parse_issue_body with typed signature - Epic ref extraction uses compiled patterns with finditer - Section parsing via regex multiline matches - Tests are well-structured but use an unusual importlib.util pattern instead of normal imports Issues: 1. **Import pattern in tests is fragile**: Using `importlib.util.spec_from_file_location` to import a sibling file is unnecessary. A simple `from gitea_issue_parser import parse_issue_body` with `sys.path.insert` would be cleaner (as PR #177 does). 2. **epic_ref is int in #183 but string in #177**: This PR returns `int(match.group(1))` while #177 returns `f"#{match.group(1)}"`. The int representation is more useful for downstream processing. 3. **context extraction**: The context is capped at 500 chars, which is reasonable, but the regex to strip the leading header is fragile. Recommend merging #183 (this one) over #177. Close #177 as superseded.
Author
Owner

Closing as this PR cannot be merged (branch protection or conflicts). Please reopen if needed.

Closing as this PR cannot be merged (branch protection or conflicts). Please reopen if needed.
Rockachopa closed this pull request 2026-04-16 01:44:32 +00:00
Author
Owner

Closing: unmergeable due to conflicts or branch protection. Reopen if needed.

Closing: unmergeable due to conflicts or branch protection. Reopen if needed.
Author
Owner

Closing: unmergeable due to conflicts or branch protection. Reopen if needed.

Closing: unmergeable due to conflicts or branch protection. Reopen if needed.
Author
Owner

Closing: unmergeable due to conflicts or branch protection. Reopen if needed.

Closing: unmergeable due to conflicts or branch protection. Reopen if needed.
Rockachopa reopened this pull request 2026-04-16 02:03:53 +00:00
Rockachopa closed this pull request 2026-04-16 02:14:16 +00:00
Author
Owner

Closed — duplicate of PR #177 (same gitea_issue_parser.py, #177 is more complete: 162 lines vs 131). Merging #177 instead.

Closed — duplicate of PR #177 (same gitea_issue_parser.py, #177 is more complete: 162 lines vs 131). Merging #177 instead.

Pull request closed

Sign in to join this conversation.