laboratory icon indicating copy to clipboard operation
laboratory copied to clipboard

Expiration dates

Open AlexKrupa opened this issue 1 year ago • 3 comments

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.

AlexKrupa avatar Jul 02 '23 12:07 AlexKrupa

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.

MiSikora avatar Jul 02 '23 13:07 MiSikora

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.

AlexKrupa avatar Jul 02 '23 14:07 AlexKrupa

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 avatar Jul 02 '23 17:07 MiSikora

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

MiSikora avatar May 21 '24 16:05 MiSikora