Summary
Fixes #224 where berg issue comment returned a 404 error when the issue's internal database ID differed from its visible issue number.
Problem
The issue comment command was using issue.id (internal database ID) instead of issue.number (the visible issue number like #1, #2, etc.) when making the API call. The Forgejo API expects the issue number, not the internal ID.
When these values differ (which happens in repositories with closed/deleted issues), the API returns a 404 error.
Solution
Changed src/actions/issue/comment.rs:93 to use issue.number instead of issue.id, aligning with how other commands like issue edit already work.
Testing
- The code compiles and passes cargo clippy
- Manually verified the fix addresses the root cause
- A test case has been added to main branch that would catch this regression
Related
This fix aligns with the pattern used in other commands:
issue edit uses issue.number (line 76)
milestone view uses issue.number (line 106)
Closes #224
🤖 Generated with Claude Code
## Summary
Fixes #224 where `berg issue comment` returned a 404 error when the issue's internal database ID differed from its visible issue number.
## Problem
The `issue comment` command was using `issue.id` (internal database ID) instead of `issue.number` (the visible issue number like #1, #2, etc.) when making the API call. The Forgejo API expects the issue number, not the internal ID.
When these values differ (which happens in repositories with closed/deleted issues), the API returns a 404 error.
## Solution
Changed `src/actions/issue/comment.rs:93` to use `issue.number` instead of `issue.id`, aligning with how other commands like `issue edit` already work.
## Testing
- The code compiles and passes cargo clippy
- Manually verified the fix addresses the root cause
- A test case has been added to main branch that would catch this regression
## Related
This fix aligns with the pattern used in other commands:
- `issue edit` uses `issue.number` (line 76)
- `milestone view` uses `issue.number` (line 106)
Closes #224
🤖 Generated with [Claude Code](https://claude.com/claude-code)