Comments (3)
Just thinking through some possible approaches (only half baked ideas)
- Do nothing, document, and maybe even switch
persistence_adapter
andnotifications_adapter
to compile time as well. - Switch to run time config for
cache
, likepersistence_adapter
andnotifications_adapter
currently use.
Bigger changes/interface breaking
- Attempt some kind of macro magic so that the actual compilation happens in the app, similar to ecto.
defmodule MyApp.FunWithFlags do
use FunWithFlags,
cache: true
# Generates FunWithFlags interface with either the FunWithFlags.Store or
# FunWithFlags.SimpleStore module
end
- Provide either a
FunWithFlagsCache
module, or <action_name>_cache functions to access the cache, so instead of an config option for using the cache, the developer instead determines based on how they call the flags function?
Thanks for the library and the work you do.
from fun_with_flags.
Hello, thank you for using the library and for opening the issue.
As far as I can see, that warning is working exactly as intended.
Running mix deps.clean fun_with_flags
before your CI runs seems the right way to go. I get it's annoying, but I wonder why it is necessary in the first place. Are you running CI several times with different FWF configs?
On the suggestions on your second message:
1a. There was a Readme section to describe compile-time config issue, but I removed it when I adopted Application.compile_env/3
. The idea was that the warning you get is enough to explain what's happening and what to do, and based on your comment I think that it's working as expected.
1b. I wouldn't switch the persistence and notification adapters to compile-time config. Compile-time config is annoying and I'm using it for the cache only for performance reasons, because those config values are checked often in the read hot path, and I don't want an extra ETS lookup and function calls there. On the other hand the persistence and notification adapters are only used when writing, therefore traditional config management is fine there.
2. See previous point.
3. I actually have an old branch where I'm working towards that kind of API. It's something for version 2.0 though.
4. I see what you mean, but I'd rather not do that. A design goal of FWF is to have a very simple API, and I don't think users should have to decide whether to go through the cache or not every time they check a flag. That's asking for trouble, because code that is "fast enough" without cache today can become painfully slow (and cause an incident) tomorrow if something else changes.
from fun_with_flags.
Hi, thank you for the prompt reply. I'll expand on the issue we are seeing just for clarity. The issue with CI is that is that things are cached from the previous build. When I first introduced fun_with_flags, the build would not complete due to this error. Since the build is automated, the only way to fix it is to do another commit with the instruction to do a mix deps.clean fun_with_flags
. Looking over our docker setup, there may be additional things we can do there....
Thank you for the explanations. I'll close this issue.
from fun_with_flags.
Related Issues (20)
- (UndefinedFunctionError) function Ecto.Query.from/2 is undefined or private HOT 1
- Changing `ecto_table_name` config requires recompile HOT 4
- Setting cache `enabled: false` crashes the app HOT 1
- [Question] Ensuring feature flags are in sync across dev environments HOT 3
- Proposed Postgrex Changes HOT 6
- The module `FunWithFlags.Supervisor` was given as a child to a supervisor but it does not exist HOT 11
- Support redis sentinel HOT 1
- Switch on ecto integration only if Ecto.Adapters.SQL exists HOT 5
- Warnings when FWF is used with ecto HOT 2
- Don't require compile-time configuration HOT 1
- Use case: flag <-> group relationship HOT 5
- mix release issue using Elixir 1.15.0 HOT 2
- Next release and Elixir 1.15 support HOT 2
- `disable/2` returns {:ok, true} HOT 1
- Suggest disabling cache for tests HOT 2
- low priority feature req - automatically remove stale flags HOT 1
- Feature request: Add timestamp columns HOT 1
- Asymmetry between options accepted by `enable`/`disable` compared to `enabled?/2` HOT 5
- Avoid Thundering Herd on Rollout of new Release HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fun_with_flags.