Hacker News new | ask | show | jobs
by forgotmypw17 977 days ago
I have a directory of feature flags IN THE REPO that look like this:

    $ cat default/setting/html/avatar_link_to_person_when_approved
    0
I then have a directory of local config (NOT in the repo) that look like this:

    $ cat config/setting/html/avatar_link_to_person_when_approved
    1
Then my feature flag code looks like this:

    if (GetConfig('setting/html/avatar_link_to_person_when_approved')) {
        # do some stuff
    }
Later on, when the feature is stable, and if it makes sense to make it a default feature, I can change the default without affecting existing installations.

The "feature flag tool" I use is a procedure called GetConfig() which is ~250 lines of code with comments and logic for overlays.

Please let me know if you have any questions about this method.

1 comments

Nice. Something home grown effectively then? What kind of application are you building with?
I'm building a static site generator with optional dynamic components and lots of quirky features.