MiSikora / laboratory

Feature flags for multi-module Kotlin Android projects
https://mehow.io/laboratory/
Apache License 2.0
82 stars 3 forks source link

Expiration dates #310

Closed AlexKrupa closed 5 months ago

AlexKrupa commented 1 year ago

Problem

Feature flagging requires discipline and sometimes it's easy to forget about cleaning up. It'd be nice to set flag expiration dates, which — when passed — would, e.g., fail compilation, or warn.

Idea

Simpler variant:

laboratory {
  feature("ShinyObject") {
    expirationDate = "2023-07-24" // Or java.time.* ?
  }
}

Richer variant:

laboratory {
  feature("ShinyObject") {
    expiration {
      date = "2023-07-24"
      severity = None | Deprecate | Warn | Error
    }
  }
}

Maybe severity could somehow be related to current deprecation feature? Just thinking out loud here.

Effectively, flags with expiration dates would usually be temporary development flags, while ones without would be more like feature kill-switches.

MiSikora commented 1 year ago

I was thinking about it some time ago but there is one main problem. Builds become backwards incompatible. If I have a build that works now I won't be able to build it in the feature when a feature flag expires.

AlexKrupa commented 1 year ago

Personally, I wouldn't use errors or I'd lower the severity right after the first failure. 🙈

It only applies to severity = Error though, right? It can still be an issue if you have a separate tool that turns all warnings into errors, but that'd have to be your explicit choice.

MiSikora commented 1 year ago

Yeah, builds compatibility applies only if an expiration date is treated as an error. Personally, I don't believe in effectiveness of warnings so I didn't bother with implementing this feature also for that reason. I'll keep the issue open but I'm not convinced I want to get into business of project management.

MiSikora commented 5 months ago

I'm going to close it. I don't see adding it to the library,