Skip to content

Display build metadata on service start#679

Merged
javuto merged 3 commits intomainfrom
display-build-metadata
Aug 16, 2025
Merged

Display build metadata on service start#679
javuto merged 3 commits intomainfrom
display-build-metadata

Conversation

@javuto
Copy link
Collaborator

@javuto javuto commented Aug 16, 2025

Display build metadata on service start

@javuto javuto requested a review from Copilot August 16, 2025 12:19
@javuto javuto added osctrl-tls osctrl-tls related changes osctrl-api osctrl-api related changes osctrl-admin osctrl-admin related changes labels Aug 16, 2025
Copy link
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 enhances service startup logging by displaying comprehensive build metadata (version, commit hash, and build date) when each osctrl service starts up.

  • Removes redundant serviceVersion constants and uses buildVersion directly
  • Adds logging of commit hash and build date alongside the existing version logging
  • Updates handler initialization to use buildVersion instead of serviceVersion

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
cmd/tls/main.go Removes serviceVersion constant, adds build metadata logging for TLS service
cmd/api/main.go Removes serviceVersion constant, adds build metadata logging for API service
cmd/admin/main.go Removes serviceVersion constant, adds build metadata logging for Admin service

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

cmd/api/main.go Outdated
log.Info().Msgf("%s v%s - HTTP listening %s", serviceName, buildVersion, serviceListener)
log.Info().Msgf("%s - commit=%s - build date=%s", serviceName, buildCommit, buildDate)
if err := http.ListenAndServe(serviceListener, muxAPI); err != nil {
log.Fatal().Msgf("ListenAndServeTLS: %v", err)
Copy link

Copilot AI Aug 16, 2025

Choose a reason for hiding this comment

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

The error message mentions 'ListenAndServeTLS' but this code path is for HTTP (not HTTPS) listening. The message should be 'ListenAndServe' to match the actual function being called.

Suggested change
log.Fatal().Msgf("ListenAndServeTLS: %v", err)
log.Fatal().Msgf("ListenAndServe: %v", err)

Copilot uses AI. Check for mistakes.
javuto and others added 2 commits August 16, 2025 14:45
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@javuto javuto merged commit 2c6680d into main Aug 16, 2025
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

osctrl-admin osctrl-admin related changes osctrl-api osctrl-api related changes osctrl-tls osctrl-tls related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants