Skip to content

Conversation

qiniu-ci
Copy link
Collaborator

@qiniu-ci qiniu-ci commented Aug 7, 2025

🚀 PR Review回复中commit链接格式错误

Closes #293 | Auto-generated by CodeAgent 🤖

🎯 Summary

Perfect! The fix has been successfully implemented and tested. Here's a summary of what was done:

Key Implementation Points:

  • Perfect! The fix has been successfully implemented and tested. Here's a summary of what was done:
  • Solution: Changed the URL format from /commit/ to /commits/ in internal/modes/tag_handler.go:1261:
🤖 Full AI Analysis
Perfect! The fix has been successfully implemented and tested. Here's a summary of what was done:

## Fix Summary

**Problem**: PR Review回复中commit链接格式错误 - The commit link format in PR review replies was incorrect.

**Issue**: 
- ❌ **Incorrect format**: `https://github.com/qiniu/codeagent/pull/290/commit/e38008d4153b2b789b17a4606d08a6cfe52db0f2`
- ✅ **Correct format**: `https://github.com/qiniu/codeagent/pull/290/commits/e38008d4153b2b789b17a4606d08a6cfe52db0f2`

**Root Cause**: In the `processPRReviewCommentCommand` function at line 1261 in `/workspace/internal/modes/tag_handler.go`, the commit URL was being generated using `/commit/` instead of `/commits/`.

**Solution**: Changed the URL format from `/commit/` to `/commits/` in `internal/modes/tag_handler.go:1261`:

```go
// Before (incorrect)
commitURL := fmt.Sprintf("%s/commit/%s", pr.GetHTMLURL(), commitHash)

// After (correct)  
commitURL := fmt.Sprintf("%s/commits/%s", pr.GetHTMLURL(), commitHash)

Verification:

  • ✅ All tests pass
  • ✅ No other instances of the incorrect format found in the codebase
  • ✅ All three commit URL generations in the file now use the correct /commits/ format

The fix ensures that when CodeAgent replies to PR review comments with commit links, the URLs will be correctly formatted and will properly redirect users to the commit view on GitHub.

</details>

---

*This pull request was automatically generated by [CodeAgent](https://github.com/qiniu/codeagent) on 2025-08-07 19:25:59.*

> 💡 **Review Tips**:
> - Focus on code quality and correctness
> - Verify the implementation matches the issue requirements
> - Check for proper error handling and edge cases
> - Ensure tests are comprehensive

@qiniu-ci
Copy link
Collaborator Author

qiniu-ci commented Aug 7, 2025

✅ CodeAgent completed successfully!

✅ 🤖 Generate code implementation (111.6s)
✅ 💾 Commit and push changes (7.7s)
✅ 📝 Update PR description (0.8s)

Branch

codeagent/claude/issue-293-1754565836

Pull Request

View Pull Request


Completed in 0.0s

Fix incorrect commit link format from `/commit/` to `/commits/` in PR review
comment replies. The previous format generated invalid GitHub URLs that
would not properly link to the commit view.

- Update commit URL generation in processPRReviewCommentCommand function
- Change format from `/pull/{pr}/commit/{hash}` to `/pull/{pr}/commits/{hash}`
- Ensures proper navigation to commit details in GitHub interface
- Affects PR review comment responses with commit links

Closes #293
@CarlJi CarlJi merged commit cb57f79 into main Aug 7, 2025
2 checks passed
@CarlJi CarlJi deleted the codeagent/claude/issue-293-1754565836 branch August 7, 2025 11:31
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.

PR Review回复中commit链接格式错误
2 participants