Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1235 +/- ##
==========================================
- Coverage 66.39% 66.19% -0.20%
==========================================
Files 245 245
Lines 16954 16988 +34
==========================================
- Hits 11257 11246 -11
- Misses 5317 5363 +46
+ Partials 380 379 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.
| Benchmark suite | Current: eb54706 | Previous: e4741a0 | Ratio |
|---|---|---|---|
Benchmark_Fatal |
4e-7 ns/op 0 B/op 0 allocs/op |
2e-7 ns/op 0 B/op 0 allocs/op |
2 |
Benchmark_Fatal - ns/op |
4e-7 ns/op |
2e-7 ns/op |
2 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Pull Request Overview
This PR optimizes the database installation workflow by conditionally creating config/database.go, incrementally adding missing database configuration keys with annotations, and refactoring conditional modification logic to a unified options-based When API. Key changes include introducing file-existence condition helpers (WhenFileExists/WhenFileNotExists), extending AddConfig to support annotations, and splitting database config generation into a base stub plus incremental key insertion.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| support/stubs/stub.go | Renames package to stubs and adds DatabaseConfig stub for initial database config file creation. |
| support/file/file.go | Adds deprecated Contain wrapper and introduces new Contains helper for file content checks. |
| schedule/setup/setup.go | Updates imports and replaces manual file-existence checks with WhenFileNotExists helper. |
| packages/modify/modify_test.go | Adapts tests to new When signature; adds tests for file existence conditional helpers. |
| packages/modify/modify.go | Refactors conditional modifiers into a generic When with option map; adds file existence and facade absence helpers. |
| packages/modify/actions_test.go | Extends test to validate AddConfig annotation support. |
| packages/modify/actions.go | Adds annotations support to AddConfig with comment injection logic. |
| database/setup/stubs.go | Replaces full file stub with structured slice of Config entries plus annotations (module param now unused). |
| database/setup/setup.go | Implements conditional creation of config file and incremental addition of missing database config keys. |
| console/console/stubs.go | Updates import to renamed stubs package. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
📑 Description
config/database.gofile is used by the DB module and the Redis module simultaneously.config/database.goneeds to be judged if it exists when installinggithub.com/goravel/redis.Hence, the database installation process needs to judge ifconfig/database.goexists, if not, create it, then add the required configurations.config/database.goexists, if not, create it, then add the required configurations.✅ Checks