Skip to content

Commit 0784df8

Browse files
committed
fix: artifact support logic and updated changelog
1 parent 2696cb1 commit 0784df8

3 files changed

Lines changed: 38 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2525

2626
---
2727

28-
## [0.1.1] - Unreleased
28+
## [0.2.0] - 2026-01-25
2929

3030
### Added
3131
- **Full version string for hosting panels** - Added `FullVersion` field to artifact entries
@@ -43,10 +43,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4343
- Created `ArtifactsResult` struct to properly track total count after filtering but before pagination
4444
- `hasMore` now correctly indicates if more pages are available
4545

46+
- **Latest vs Recommended logic** - Fixed support status assignment per CFX EOL policy
47+
- **Latest** = Single newest version (for testing/bleeding edge)
48+
- **Recommended** = Next 3 versions after Latest (stable for production)
49+
- Support status now dynamically assigned based on version position, not hardcoded thresholds
50+
- See https://aka.cfx.re/eol for CFX official policy
51+
52+
- **EOL filter default** - Changed `includeEol` default from `true` to `false`
53+
- EOL artifacts are now excluded by default for safety
54+
- Users must explicitly opt-in to see end-of-life versions
55+
4656
### Changed
4757
- Updated all artifact handlers to use new `ArtifactsResult` return type
4858
- Refactored `generateFullVersion()` helper to accept hash parameter
4959
- Added `ArtifactStats` struct and `calculateStats()` helper function
60+
- Refactored `ProcessGitHubTags` to dynamically assign Latest/Recommended based on sorted position
61+
- Simplified `determineSupportStatus()` to only handle Active/Deprecated/EOL thresholds
5062

5163
---
5264

internal/handlers/artifacts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func GetArtifacts(c *fiber.Ctx) error {
3737
Status: services.SupportStatus(c.Query("status", "")),
3838
SortBy: c.Query("sortBy", "version"),
3939
SortOrder: c.Query("sortOrder", "desc"),
40-
IncludeEOL: c.QueryBool("includeEol", true),
40+
IncludeEOL: c.QueryBool("includeEol", false),
4141
}
4242

4343
// Parse limit and offset

internal/services/artifacts.go

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ func (s *ArtifactsService) ProcessGitHubTags(tags []GitHubTag) ArtifactData {
239239
}
240240
}
241241

242-
// Sort by version number (descending)
242+
// Sort by version number (descending) - highest version first
243243
sort.Slice(artifactTags, func(i, j int) bool {
244244
versionA := s.extractVersionNumber(artifactTags[i].Name)
245245
versionB := s.extractVersionNumber(artifactTags[j].Name)
@@ -248,15 +248,28 @@ func (s *ArtifactsService) ProcessGitHubTags(tags []GitHubTag) ArtifactData {
248248

249249
now := time.Now().UTC().Format(time.RFC3339)
250250

251-
for _, tag := range artifactTags {
251+
for idx, tag := range artifactTags {
252252
versionNumber := s.extractVersionNumber(tag.Name)
253253
version := strconv.Itoa(versionNumber)
254254

255+
// Determine support status based on position in sorted list
256+
// Position 0 = Latest (newest single version)
257+
// Position 1-3 = Recommended (stable versions)
258+
// Rest based on version thresholds
259+
var status SupportStatus
260+
if idx == 0 {
261+
status = Latest
262+
} else if idx <= 3 {
263+
status = Recommended
264+
} else {
265+
status = s.determineSupportStatus(versionNumber)
266+
}
267+
255268
baseEntry := Artifact{
256269
Version: version,
257270
Hash: tag.Commit.SHA,
258271
Date: now,
259-
SupportStatus: s.determineSupportStatus(versionNumber),
272+
SupportStatus: status,
260273
}
261274

262275
// Windows artifact
@@ -464,14 +477,16 @@ func (s *ArtifactsService) extractVersionNumber(tagName string) int {
464477
}
465478

466479
func (s *ArtifactsService) determineSupportStatus(version int) SupportStatus {
480+
// Based on CFX EOL policy: https://aka.cfx.re/eol
481+
// This is used for versions beyond the top 4 (Latest + 3 Recommended)
482+
// which are dynamically assigned in ProcessGitHubTags
483+
// Active = still supported but older
484+
// Deprecated = support ending soon
485+
// EOL = no longer supported
467486
switch {
468-
case version >= 24500:
469-
return Recommended
470-
case version >= 24000:
471-
return Latest
472-
case version >= 23000:
487+
case version >= 23000: // Still actively supported
473488
return Active
474-
case version >= 20000:
489+
case version >= 20000: // Support ending
475490
return Deprecated
476491
default:
477492
return EOL

0 commit comments

Comments
 (0)