-
Notifications
You must be signed in to change notification settings - Fork 267
feat(storage): add fetch_policy configuration option #4920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
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 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <rdmytrenko@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Roman Dmytrenko <rdmytrenko@gmail.com>
Co-authored-by: Mark Phelps <209477+markphelps@users.noreply.github.com> Signed-off-by: Roman Dmytrenko <rdmytrenko@gmail.com>
Co-authored-by: Mark Phelps <209477+markphelps@users.noreply.github.com> Signed-off-by: Roman Dmytrenko <rdmytrenko@gmail.com>
Co-authored-by: Mark Phelps <209477+markphelps@users.noreply.github.com> Signed-off-by: Roman Dmytrenko <rdmytrenko@gmail.com>
70f7abb to
6814190
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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