Skip to content

Retrieving latest release metadata from osctrl.net in osctrl-admin#785

Merged
javuto merged 2 commits intomainfrom
telemetry-osctrl-admin
Mar 30, 2026
Merged

Retrieving latest release metadata from osctrl.net in osctrl-admin#785
javuto merged 2 commits intomainfrom
telemetry-osctrl-admin

Conversation

@javuto
Copy link
Copy Markdown
Collaborator

@javuto javuto commented Mar 29, 2026

Metadata for latest release retrieved from osctrl.net to make sure stable version is used.

@javuto javuto requested a review from Copilot March 29, 2026 22:42
@javuto javuto added ✨ enhancement New feature or request osctrl-admin osctrl-admin related changes labels Mar 29, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a mechanism in osctrl-admin to fetch release metadata from a remote JSON endpoint and compare it against the running version to notify operators about newer releases.

Changes:

  • Introduces pkg/version.VersionData, RetrieveVersionData(), and CheckSuggestedRelease() for remote version metadata + comparison.
  • Updates osctrl-admin startup to call the version check and log release/update information.
  • Adds/updates unit tests around version constants/URL/JSON tags and adds golang.org/x/mod dependency.

Reviewed changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
pkg/version/version.go Adds remote version metadata retrieval and a semver-based comparison helper.
pkg/version/version_test.go Replaces fixed version assertions with validation tests for constants/URL and JSON tags.
cmd/admin/main.go Calls the new version-check logic at service startup and logs results.
go.mod Adds golang.org/x/mod dependency for semver comparison.
go.sum Records checksums for the new module dependency.
.gitignore Ignores a local version_data.json file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/version/version.go Outdated
Comment thread pkg/version/version.go Outdated
Comment thread cmd/admin/main.go
Comment on lines +195 to +200
if version.CheckSuggestedRelease(latest.SuggestedRelease) {
log.Info().Msgf("A newer version of %s is available: %s (current: %s)", serviceName, latest.SuggestedRelease, buildVersion)
log.Info().Msgf("Release notes: %s", latest.MoreInformation)
} else {
log.Info().Msgf("%s is up to date with the latest release (%s)", serviceName, buildVersion)
}
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition is inverted relative to the message: CheckSuggestedRelease returns true when the current version is equal/newer than the suggested release, but the log says “A newer version ... is available”. Either invert the if condition or change CheckSuggestedRelease semantics/name so that true means an update is available.

Copilot uses AI. Check for mistakes.
Comment thread cmd/admin/main.go Outdated
Comment thread pkg/version/version.go
Comment thread pkg/version/version.go Outdated
Comment thread pkg/version/version.go
@javuto javuto merged commit 4ec0335 into main Mar 30, 2026
55 checks passed
@javuto javuto deleted the telemetry-osctrl-admin branch March 30, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ enhancement New feature or request osctrl-admin osctrl-admin related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants