Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes issues with the rendering of historical workflow information and updates the regex matching to support a broader range of GitHub repository URLs. Key changes include:
- Adjusting HTML structure in test fixtures and templates by removing extraneous punctuation and ensuring proper closing tags.
- Updating the regex pattern in constants to match workflow URLs from various repositories.
- Adding a debug log for tracking the number of history workflow entries retrieved.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/plugins/github/publish/utils/test_trigger_registry_update.py | Removed redundant punctuation in HTML anchors for history entries. |
| tests/plugins/github/publish/utils/test_history_workflow.py | Modified test fixture HTML and added a new test verifying rendered history workflow data. |
| tests/plugins/github/publish/render/*.py | Corrected the HTML structure across multiple render error tests. |
| src/plugins/github/plugins/publish/templates/comment.md.jinja | Fixed the template to correctly close the anchor tag. |
| src/plugins/github/plugins/publish/constants.py | Updated the regex pattern for matching historical workflow entries with a generic pattern. |
| src/plugins/github/plugins/publish/init.py | Added a debug log to report the count of history workflow entries. |
Comments suppressed due to low confidence (3)
src/plugins/github/plugins/publish/constants.py:51
- Consider adding an inline comment to explain the rationale behind the updated regex pattern, as its complexity may require future maintainers to understand the matching logic at a glance.
r'<li>(⚠️|✅)\s*<a href=?["\']?(https://github\.com/[^/]+/[^/]+/actions/runs/\d+)["\']?>([^<]+?CST)</a></li>'
src/plugins/github/plugins/publish/init.py:166
- [nitpick] Consider expanding this debug log message with additional context (such as the issue number or comment identifier) to assist with troubleshooting in production environments.
logger.debug(f"获取到 {len(history)} 条历史工作流")
src/plugins/github/plugins/publish/templates/comment.md.jinja:39
- [nitpick] It may be helpful to add a comment in the template describing the expected HTML structure for historical workflow entries to aid future maintenance.
<li>{{"✅" if status else "⚠️"}} <a href={{action_url}}>{{time|format_datetime}}</a></li>
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #398 +/- ##
==========================================
- Coverage 93.89% 93.85% -0.05%
==========================================
Files 40 40
Lines 2342 2343 +1
==========================================
Hits 2199 2199
- Misses 143 144 +1 ☔ View full report in Codecov by Sentry. |
No description provided.