Develop#3
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a Go-based example service for fetching and processing FXServer artifacts from GitHub and updates the Windows txAdmin install docs to reference this new example.
Changes:
- Introduced
lib/examples/artifacts.goimplementing anArtifactsServicethat fetches tags/issues from GitHub, derives artifact metadata, supports filtering/sorting/pagination, and includes fallback artifact data. - Updated
content/docs/txadmin/windows/install.mdxto embed the new Go example file instead of the previous TypeScript path when demonstrating automated artifact handling.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| lib/examples/artifacts.go | Adds a complete Go example (ArtifactsService) for discovering and serving artifact metadata from GitHub tags and issues, including caching and fallback logic. |
| content/docs/txadmin/windows/install.mdx | Updates the “wanna see how we did it?” accordion to point to the new Go example file so the docs display a working implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| s.cache[key] = &cacheEntry{ | ||
| data: data, | ||
| timestamp: time.Now().UnixMilli(), |
There was a problem hiding this comment.
The duration parameter passed to setCache is never used, and getCache always compares against the global cacheDuration, which means entries cached with issuesCacheDuration will never actually respect the intended shorter TTL. To make the separate durations effective, either store and compare against a per-entry TTL (e.g., include duration in cacheEntry and use it in getCache) or remove the duration parameter and the issuesCacheDuration constant to avoid misleading behavior.
| s.cache[key] = &cacheEntry{ | |
| data: data, | |
| timestamp: time.Now().UnixMilli(), | |
| nowMillis := time.Now().UnixMilli() | |
| // Encode per-entry TTL into the timestamp so that getCache's | |
| // `now - timestamp < cacheDuration` check effectively uses `duration`. | |
| effectiveTimestamp := nowMillis | |
| if duration > 0 && duration < cacheDuration { | |
| effectiveTimestamp = nowMillis - (cacheDuration - duration) | |
| } | |
| s.cache[key] = &cacheEntry{ | |
| data: data, | |
| timestamp: effectiveTimestamp, |
| {"24574", "779c1fa38ec01b33d79a5e994b7e0c1a0bbcg421", Windows}, | ||
| {"24574", "779c1fa38ec01b33d79a5e994b7e0c1a0bbcg421", Linux}, |
There was a problem hiding this comment.
The fallback artifact entries for version 24574 use a hash value 779c1fa38ec01b33d79a5e994b7e0c1a0bbcg421 that contains a non-hex character (g), which is not a valid Git commit SHA and will generate invalid artifact URLs in the fallback data. Please correct this hash to the actual SHA (or another valid placeholder) so that the generated fallback URLs for 24574 point to real artifacts.
| {"24574", "779c1fa38ec01b33d79a5e994b7e0c1a0bbcg421", Windows}, | |
| {"24574", "779c1fa38ec01b33d79a5e994b7e0c1a0bbcg421", Linux}, | |
| {"24574", "779c1fa38ec01b33d79a5e994b7e0c1a0bbc9421", Windows}, | |
| {"24574", "779c1fa38ec01b33d79a5e994b7e0c1a0bbc9421", Linux}, |
| maxRetries = 3 | ||
| retryDelay = 1000 // 1 second in milliseconds | ||
| rateLimitDelay = 1000 // 1 second in milliseconds |
There was a problem hiding this comment.
maxRetries and retryDelay are defined in the constants block but never used anywhere in this file, which is misleading and would cause a compile error if this package were part of a Go module. Either remove these constants or implement retry logic in the GitHub fetch helpers that actually uses them.
| maxRetries = 3 | |
| retryDelay = 1000 // 1 second in milliseconds | |
| rateLimitDelay = 1000 // 1 second in milliseconds |
No description provided.