Comments (8)
Thanks for the heads up, the task checks if the flag is set and does nothing if that's the case, exactly to avoid it. It really only is for initial setup. 🙂
from fun_with_flags_ui.
I'm happy to submit a PR with a fix. Can you point me to the general direction where this needs to be handled? Maybe here?
fun_with_flags_ui/lib/fun_with_flags/ui/templates.ex
Lines 64 to 66 in d3513e0
from fun_with_flags_ui.
Hi, thank you for trying the library.
That limitation is actually there by design, as explained in the readme:
For this reason this library enforces some stricter rules when creating flags and groups. Blank values are not allowed,
?
neither, and flag names must match/^w+$/
.
(https://github.com/tompave/fun_with_flags_ui#caveats)
I'd rather not change it because I don't want to add too many escaping rules to the routing. The reason is that technically a flag name could contain anything:
iex(1)> is_atom :"foo?=[aa]🍕nope 😬"
true
And allowing the same variety of chars in an URL is a rabbit hole I'd rather stay away from.
from fun_with_flags_ui.
I'm afraid that the solution is to just not use ?
in your flag names.
from fun_with_flags_ui.
That's also why this web dashboard will prevent you from creating flags with those invalid characters: https://github.com/tompave/fun_with_flags_ui/blob/v0.7.1/lib/fun_with_flags/ui/utils.ex#L128-L139
I imagine that you created the flag check_email_verified?
directly in code. On the other hand, if you did manage to create it using the dashboard, then I'd treat that as a bug and I'd be happy to accept a PR that fixes the validation.
from fun_with_flags_ui.
Fair enough. Yes, we created it in code. We have a task which sets some flags with defaults on startup, basically migration like.
from fun_with_flags_ui.
I will close this then. Thank you again. :)
from fun_with_flags_ui.
No worries, I'm glad that the workaround makes sense. 👍
Fair enough. Yes, we created it in code. We have a task which sets some flags with defaults on startup, basically migration like.
@zeeker I see. I'd just suggest caution with this approach though, because you risk to override some manual flag change when a new process starts. For example, an engineer could manually disable a flag because they have a good reason, but then the flag could get automatically re-enabled if a new application process/container/instance (re)starts somewhere.
from fun_with_flags_ui.
Related Issues (15)
- Provide bootstrap.min.css.gz unzipped HOT 4
- Use conn.script_name instead of namespace to construct paths HOT 3
- Stable ordering of gates in index page HOT 2
- Percentage gates display as scientific notation HOT 5
- (UndefinedFunctionError) function FunWithFlags.Store.Persistent.Redis.all_flags/0 is undefined (module FunWithFlags.Store.Persistent.Redis is not available) HOT 4
- ArgumentError :erlang.binary_to_existing_atom/2 HOT 10
- Persistent XSS Vulnerability HOT 1
- Add support to protect from forgery HOT 3
- How to select DB to read flags HOT 2
- Can't use this library if using `fun_with_flags` with `runtime: false` HOT 5
- Assets don't work when hosting with a subpath HOT 3
- CSRF Protection Error when loading script HOT 5
- Customize UI HOT 3
- Problem to load gzipped bootstrap in production HOT 6
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_ui.