Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Symfony profiler doesn't show configured features #78

Open
simcen opened this issue May 25, 2020 · 3 comments
Open

Symfony profiler doesn't show configured features #78

simcen opened this issue May 25, 2020 · 3 comments
Labels

Comments

@simcen
Copy link

simcen commented May 25, 2020

Hello,

We're running quite old Symfony 2.8.x based application.
The symfony profiles shows "Features" section but not the configured features. However, I can actually work with them in the code.

Configuration in config.php:

$container->loadFromExtension('flagception', [
    'features' => [
        'feature_123' => [
            'default' => true,
        ],
        
        'feature_abc' => [
            'default' => false,
        ],
    ],
]);

--> can access feature manager, e.g. from a view with:
$this->container->get('flagception.manager.feature_manager')->isActive('feature_123')

Any idea?

Debug container output:

# ./app/console debug:container --env=dev | grep -i flagception
  flagception.activator.array_activator                                                                  Flagception\Activator\ArrayActivator
  flagception.activator.constraint_activator                                                             Flagception\Activator\ConstraintActivator
  flagception.activator.environment_activator                                                            Flagception\Activator\EnvironmentActivator
  flagception.configurator.array_configurator                                                            Flagception\Bundle\FlagceptionBundle\DependencyInjection\Configurator\ArrayConfigurator
  flagception.configurator.constraint_configurator                                                       Flagception\Bundle\FlagceptionBundle\DependencyInjection\Configurator\ConstraintConfigurator
  flagception.configurator.contentful_configurator                                                       Flagception\Bundle\FlagceptionBundle\DependencyInjection\Configurator\ContentfulConfigurator
  flagception.configurator.cookie_configurator                                                           Flagception\Bundle\FlagceptionBundle\DependencyInjection\Configurator\CookieConfigurator
  flagception.configurator.database_configurator                                                         Flagception\Bundle\FlagceptionBundle\DependencyInjection\Configurator\DatabaseConfigurator
  flagception.configurator.environment_configurator                                                      Flagception\Bundle\FlagceptionBundle\DependencyInjection\Configurator\EnvironmentConfigurator
  flagception.listener.routing_metadata_subscriber                                                       Flagception\Bundle\FlagceptionBundle\Listener\RoutingMetadataSubscriber
  flagception.manager.feature_manager                                                                    Flagception\Manager\FeatureManager
  flagception\manager\featuremanagerinterface                                                            alias for "flagception.manager.feature_manager"
@migo315
Copy link
Contributor

migo315 commented May 25, 2020

Can you tell me which flagception bundle and flagception sdk version you are using?

In your debug container output, I'm missing the traceable chain activator. He is responsible for executing all activators and collect data for the profiler:
https://github.com/bestit/flagception-bundle/blob/3.5.1/src/Activator/TraceableChainActivator.php

The traceable chain decorator should be injected normally:
https://github.com/bestit/flagception-bundle/blob/3.5.1/src/Resources/config/services.yml#L5

@simcen
Copy link
Author

simcen commented May 26, 2020

"flagception/flagception-bundle" 3.5.1 and "flagception/flagception" 1.5.0

@migo315
Copy link
Contributor

migo315 commented Oct 26, 2020

Ah, perhaps there is a misunderstanding here. The profiler does not show the features that are configured, only those that are actually requested (by '->isActive' for example).

So if you call a page where no features are requested, then there will be no features in the profiler. Does that help you?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants