Skip to content

Conversation

@K3das
Copy link
Contributor

@K3das K3das commented Dec 27, 2025

gsw_service.yaml is currently tracked in git, despite being deployment-specific. This change creates an example configuration file and adds the real config file to gitignore. This also makes it possible to start gsw_service with no config file at all, if necessary environment variables are provided.

Copy link

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 refactors configuration management to follow best practices by removing deployment-specific configuration from version control. The changes enable the gsw_service to start without a config file when required environment variables are provided.

  • Creates an example configuration file with helpful comments
  • Adds the actual config file to .gitignore to prevent deployment-specific settings from being tracked
  • Implements graceful fallback to environment variables when config file is not found

Reviewed changes

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

Show a summary per file
File Description
data/config/gsw_service.yaml.example Reorganized example config with added explanatory comments for each section
compose.yaml Added GSW_TELEMETRY_CONFIG environment variable for Docker Compose deployments
cmd/gsw_service.go Modified config reading logic to allow missing config file and fall back to environment variables
cmd/Containerfile Added default environment variables for database connection and logging configuration
README.md Added Configuration section documenting how to set up config file and use environment variables
.gitignore Added gsw_service.yaml to prevent tracking deployment-specific configuration
Comments suppressed due to low confidence (1)

cmd/gsw_service.go:137

  • The telemetry_config validation should be added to readConfig() alongside the database_host_name and database_port_number checks for consistency. Currently, telemetry_config is validated later in telemetryConfigInitialize(), which means the service could proceed past readConfig() with an incomplete configuration. Consider adding: if !config.IsSet("telemetry_config") { logger.Panic("Error reading GSW config: telemetry_config not set...") }
	if !config.IsSet("database_host_name") {
		logger.Panic("Error reading GSW config: database_host_name not set...")
	}
	if !config.IsSet("database_port_number") {
		logger.Panic("Error reading GSW config: database_port_number not set...")
	}

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

@K3das K3das requested a review from AarC10 December 27, 2025 05:35
@K3das K3das marked this pull request as ready for review December 27, 2025 05:35
Copy link
Member

@AarC10 AarC10 left a comment

Choose a reason for hiding this comment

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

TY!

@K3das K3das merged commit 1ef8120 into main Dec 27, 2025
2 checks passed
@K3das K3das deleted the fix/mia/untracked-config branch December 27, 2025 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants