Skip to content

chore(app): general tidy for release#31

Merged
Jacobbrewer1 merged 2 commits intomainfrom
feat/tidy
Apr 16, 2025
Merged

chore(app): general tidy for release#31
Jacobbrewer1 merged 2 commits intomainfrom
feat/tidy

Conversation

@Jacobbrewer1
Copy link
Owner

Describe your changes

This pull request includes several changes to the app.go and options.go files to improve configuration management, error handling, and code readability. The most important changes include the introduction of new configuration options, enhanced error handling, and the removal of redundant code.

Improvements to configuration management:

  • app.go: Added new constants httpReadHeaderTimeout and shutdownTimeout for better configuration management.
  • options.go: Introduced WithViperConfig and WithConfigWatchers functions to set up and watch Viper configuration.

Enhanced error handling:

  • app.go: Added error logging and panics for unregistered components like the logger, vault client, viper instance, database connection, Kubernetes client, etc. [1] [2] [3]
  • options.go: Improved error messages and checks in functions like WithLeaderElection, WithRedisPool, and WithNatsClient. [1] [2] [3]

Code readability and simplification:

  • app.go: Removed redundant Viper setup code from the NewApp function.
  • app.go: Changed log level from Info to Debug for leader election status.
  • options.go: Replaced hardcoded leader election durations with constants.

@Jacobbrewer1 Jacobbrewer1 requested a review from Copilot April 16, 2025 13:18
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.

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

Comments suppressed due to low confidence (1)

app.go:149

  • The viper instance created in NewApp is no longer assigned to the app struct, which could lead to a panic when calling a.Viper(). Consider storing the viper instance (e.g. via WithViperConfig) into the app's vip field to ensure it is available.
return &App{ ... }

@Jacobbrewer1 Jacobbrewer1 marked this pull request as ready for review April 16, 2025 13:19
@Jacobbrewer1 Jacobbrewer1 enabled auto-merge (squash) April 16, 2025 13:20
@Jacobbrewer1 Jacobbrewer1 merged commit d8b0e13 into main Apr 16, 2025
6 checks passed
@Jacobbrewer1 Jacobbrewer1 deleted the feat/tidy branch April 16, 2025 13:21
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants