feat(storage): add fetch_policy configuration option#4920
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v2 #4920 +/- ##
==========================================
+ Coverage 59.01% 59.07% +0.05%
==========================================
Files 135 135
Lines 16874 16908 +34
==========================================
+ Hits 9959 9988 +29
- Misses 6234 6239 +5
Partials 681 681
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ebc5039 to
9dda6ef
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds a configurable remote_startup_fetch_policy option that controls how Flipt handles remote Git fetch failures during startup. The policy can be set to "required" (default) or "optional", allowing Flipt to continue operating with stale local data when the remote repository is temporarily unavailable.
Key changes:
- Added
RemoteStartupFetchPolicyconfiguration field supporting "required" (default) and "optional" policies - Implemented connection error detection logic to differentiate network issues from other errors
- Modified startup fetch logic to conditionally allow failures when policy is "optional" and local commits exist
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| magefile.go | Updated test command to run specific test instead of full suite |
| internal/storage/git/repository_test.go | Added comprehensive tests for new fetch policy behavior and connection error handling |
| internal/storage/git/repository.go | Implemented fetch policy logic, connection error detection, and configuration option |
| internal/storage/environments/environments.go | Integrated fetch policy into environment manager's repository initialization and fetch logic |
| internal/config/storage.go | Added RemoteStartupFetchPolicy field to storage configuration |
| config/flipt.schema.json | Added schema validation for remoteStartupFetchPolicy enum values |
| config/flipt.schema.cue | Added CUE schema definition with default value for remote_startup_fetch_policy |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
a534d9c to
e12d18f
Compare
|
Documentation Updates 1 document(s) were updated by changes in this PR |
markphelps
left a comment
There was a problem hiding this comment.
looks great! just some thoughts on naming things
Add configurable policy for handling remote git fetch failures during startup. This allows Flipt to continue operating with stale local data when the remote repository is temporarily unavailable. Signed-off-by: Roman Dmytrenko <[email protected]> Co-authored-by: Copilot <[email protected]> Signed-off-by: Roman Dmytrenko <[email protected]>
Co-authored-by: Mark Phelps <[email protected]> Signed-off-by: Roman Dmytrenko <[email protected]>
Co-authored-by: Mark Phelps <[email protected]> Signed-off-by: Roman Dmytrenko <[email protected]>
Co-authored-by: Mark Phelps <[email protected]> Signed-off-by: Roman Dmytrenko <[email protected]>
Signed-off-by: Roman Dmytrenko <[email protected]>
70f7abb to
6814190
Compare
markphelps
left a comment
There was a problem hiding this comment.
looks great! i'll likely create a release tomorrow
Add configurable policy for handling remote git fetch failures during
startup. This allows Flipt to continue operating with stale local data
when the remote repository is temporarily unavailable.
Related #4907