Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements EOL (End of Life) policy compliance for artifact management, aligning with CFX's official EOL policy. The changes introduce dynamic support status assignment based on version recency, add statistics tracking, and improve version string formatting for hosting panels.
Changes:
- Implemented position-based support status assignment (Latest = newest, Recommended = next 3, others determined by version thresholds)
- Added artifact statistics calculation and API response field showing counts by support status
- Changed FullVersion format from
v1.0.0.{build}to{version}-{hash}for hosting panel compatibility - Changed default for
includeEolparameter fromtruetofalseto exclude EOL artifacts by default
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| internal/services/artifacts.go | Added ArtifactStats struct and calculation logic; refactored support status assignment to be position-based rather than threshold-based; updated generateFullVersion to include hash; added stats to ArtifactsResult |
| internal/handlers/artifacts.go | Changed includeEol default to false; added stats object to API response metadata |
| CHANGELOG.md | Documented all changes including breaking changes, additions, and fixes for version 0.2.0 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| // Determine support status based on position in sorted list | ||
| // Position 0 = Latest (newest single version) | ||
| // Position 1-3 = Recommended (stable versions) |
There was a problem hiding this comment.
The comment states "Position 1-3 = Recommended (stable versions)" but the code on line 262 uses "idx <= 3", which includes indices 1, 2, and 3. This is correct for "3 versions after Latest", but the comment is slightly misleading as it doesn't clarify that index 0 is handled separately. Consider revising to "Positions 1-3 = Recommended (next 3 stable versions after Latest)" for clarity.
| // Position 1-3 = Recommended (stable versions) | |
| // Positions 1-3 = Recommended (next 3 stable versions after Latest) |
| SortBy: c.Query("sortBy", "version"), | ||
| SortOrder: c.Query("sortOrder", "desc"), | ||
| IncludeEOL: c.QueryBool("includeEol", true), | ||
| IncludeEOL: c.QueryBool("includeEol", false), |
There was a problem hiding this comment.
The API documentation comment indicates the default value for includeEol is true, but the actual default has been changed to false on line 40. The documentation should be updated to reflect the new default value.
No description provided.