[MAGNOLIA-8341] As a developer, I need a feature flag to enable servlet though annotation or web xml Created: 10/Mar/22  Updated: 02/Sep/22  Resolved: 02/Sep/22

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: None
Fix Version/s: 6.3.0

Type: Story Priority: Neutral
Reporter: David Lopez Assignee: Fernando Cherchi
Resolution: Won't Do Votes: 0
Labels: nucleus
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Cloners
clones MAGNOLIA-8286 As a developer, I can add a servlet v... Closed
Relates
relates to MAGNOLIA-8366 Create a list of all the modules that... Closed
dependency
depends upon MAGNOLIA-8395 As a developer, I need an sdk to inte... Closed
is depended upon by MGNLCE-297 Allow discovering of filters/servlets... Discovery
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Release notes required:
Yes
Date of First Response:
Epic Link: Externalize JCR configuration
Team: Nucleus

 Description   

Problem

Right now , we can exclude servlet context from magnolia filter/servlet chain. but We do not have a way to turn on/off this feature

Expected results

A flag I can use to turn on/off this feature 

Development notes

this flag should be present con the filter manager and the bypass but does not include adding it into the externalized servlet.

we need to double check that if the flag is off and the servlet is being loaded by magnolia filter chain and java filter chain this second one is not triggered



 Comments   
Comment by Rabie Hayoun [ 10/Mar/22 ]

 

Add a flag on the bypass and the filter manager to turn on and off this feature. the flag should be done using microprofile 

Comment by David Lopez [ 14/Mar/22 ]

Hey rhayoun ,

Is awesome to adopt already feature flags

agarcia and/or me would be totally up if you would need any kind of help or if you would like to know more details on how we did it for the hackathon (most likely for technicalities Andres would be right person)

Comment by Rabie Hayoun [ 17/Mar/22 ]

 

  1. Add feature flag and logic to skip request path if had been externalized out of the magnolia filter chain: https://git.magnolia-cms.com/projects/PLATFORM/repos/main/browse/magnolia-core/src/main/java/info/magnolia/cms/filters/MgnlFilterChain.java#76
  2. Add feature flag on NonJcrServletMappingExistsVoter, the feature flag should be the same one as the one on point 1. because both of them are part of the same functionality.
  3. Use the feature flag demoed on the hackathon by dlopez and agarcia 
    1. Code is for it is here: https://git.magnolia-cms.com/projects/CLOUD/repos/norsu/browse/feature-flags. We should extract the code out of norsu.
    2. Example of using a feature flag: https://git.magnolia-cms.com/projects/CLOUD/repos/norsu/browse/magnolia-demo-app/src/main/java/info/magnolia/norsu/demo/app/rules/FeatureFlagRule.java

Feature flag project has 3 submodules:

  1. Module: It is like an sdk to create provider/client to access feature flag service
  2. Service: abstraction layer from the backend so we can change it when ever we see fit
  3. Unleash: backend that will handle the flag's storage

This is not a configuration, this is a feature flag 

Comment by Dominik Maslanka [ 18/Mar/22 ]

is this feature flag use case or regular setting we want to implement rhayoun 

Comment by Rabie Hayoun [ 21/Mar/22 ]

feature are per use case not a regular setting, at some point we should delete it and get rid of the old code.

Comment by Rabie Hayoun [ 03/May/22 ]

Discovery:

  1. Add a feature flag on unleash service
  2. Add feature flag and logic to skip request path if had been externalized out of the magnolia filter chain: https://git.magnolia-cms.com/projects/PLATFORM/repos/main/browse/magnolia-core/src/main/java/info/magnolia/cms/filters/MgnlFilterChain.java#76
  3. Add feature flag on NonJcrServletMappingExistsVoter, the feature flag should be the same one as the one on point 1. because both of them are part of the same functionality.
Comment by Fernando Cherchi [ 29/Aug/22 ]

Discovery:

  1. Add a feature flag on unleash service
  2. Add feature flag and logic to skip request path if had been externalized out of the magnolia filter chain: https://git.magnolia-cms.com/projects/PLATFORM/repos/main/browse/magnolia-core/src/main/java/info/magnolia/cms/filters/MgnlFilterChain.java#76
    1. If feature flag is ON AND if the request URI is NOT one of the registered Servlet (see https://git.magnolia-cms.com/projects/PLATFORM/repos/main/browse/magnolia-core/src/main/java/info/magnolia/voting/voters/NonJcrServletMappingExistsVoter.java#67 as an example)  Do filter
  3. Add feature flag on NonJcrServletMappingExistsVoter, the feature flag should be the same one as the one on point 1. because both of them are part of the same functionality.
    1. In the boolVote Method, check if the Feature Flag is ON, if OFF, ignore the call.
  4. Add the FeaturesToggleProvider to the core.xml.
Comment by David Lopez [ 02/Sep/22 ]

Discussion grooming 02/09/2022

At this stage we see too much complexity on the approach and might be easier to enable/disable and see what are the consequences. Hence closing.

However research is valid in case in the future we would need to come back to the approach we can re-open it.

fcherchi , if any follow up ticket is required to proceed with the straightforward approach, let me know.

 

Generated at Mon Feb 12 04:31:51 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.