gramzivi/flag-it-bundle
FlagItBundle adds a flexible flagging and moderation system to Symfony applications. Users can report content or entities, define configurable flag types, and help teams review and manage flagged items through a simple, integration-friendly workflow.
Architecture fit: The release establishes a configurable feature-flag layer with clients, defaults, ClientContextInterface, DefaultClientContext, and a FeatureFlagManager supporting global, per-client, and default fallback resolution. This fits Laravel/PHP services that need phased rollout, tenant-specific entitlements, kill switches, or experimentation by client. The ClientContextInterface is the key architectural seam: it allows Laravel request/job context to resolve a tenant/client without coupling flag evaluation to a single global environment value.
Integration feasibility: Feasible for a Laravel service on PHP 8.1+ with Symfony 6.4, and potentially Symfony 7.x on PHP 8.2+. The package is still beta, so integration should be treated as a controlled pilot rather than a platform dependency. The explicit array-parameter autowiring fix reduces one class of container wiring risk, but consumers should validate service-provider bindings and configuration publishing in their Laravel version.
Technical risk: Main risks are beta API instability, unclear Laravel version support, and ambiguous flag source/persistence. The release notes describe configuration blocks but not whether flags are static config, cached, or externally sourced; that affects runtime changeability and operational ownership. DefaultClientContext reading client from env or parameter is acceptable for single-tenant or CLI use, but unsafe as a default for multi-tenant HTTP or long-running workers unless request/job-scoped context is explicitly bound and cleared. Symfony 7 requires PHP 8.2 despite the stated PHP 8.1+ requirement, so Composer resolution must be tested across the supported matrix.
Key questions: Which Laravel versions are supported and tested? Is flag state config-only, cached, or externally persisted? What is the exact precedence order among global, per-client, and default flags, and what happens on missing/invalid client IDs? Does DefaultClientContext leak across Octane/queue workers? Is there config validation, schema publishing, and observability for flag resolution? What is the beta support window and expected API stability before GA?
Stack fit: Best fit is a Laravel 10/PHP 8.1/Symfony 6.4 baseline or Laravel 11/PHP 8.2/Symfony 7 baseline, subject to package testing. For multi-tenant use, bind ClientContextInterface to a custom request-scoped resolver rather than relying on DefaultClientContext. If the package does not ship a Laravel service provider/facade, plan a thin application adapter so feature-flag calls stay behind an internal interface.
Migration path: Since there is no prior assessment, start as a greenfield pilot. Install the beta in a non-production environment, publish/define clients and defaults, bind context resolution, and validate global/per-client/default precedence with automated tests. Introduce one low-risk flag in a single service before expanding to tenant-specific entitlements or kill switches.
Compatibility: Verify Composer constraints against the target PHP/Laravel/Symfony matrix, especially PHP 8.1 with Symfony 6.4 versus PHP 8.2 with Symfony 7.x. Test config caching, queue workers, Laravel Octane, and CLI commands. Confirm behavior when a client is unknown, when config is stale, and when env values differ between web and worker processes.
Sequencing: First, run a sandbox compatibility spike and confirm service autowiring. Second, implement single-tenant resolution with DefaultClientContext. Third, implement and test custom multi-tenant context plus fallback precedence. Fourth, add contract tests and a rollback/kill-switch runbook. Fifth, pilot one flag in staging, then one production service. Keep the beta pinned and wrap it behind an internal adapter until GA.
Maintenance: Beta status implies ongoing release tracking, version pinning, and ownership of the adapter layer. Configuration schema for clients and defaults will need governance, naming standards, and validation. Without an admin UI or external flag store, changes may require deployment or config-cache refresh, so the TPM should clarify the operating model before broad adoption.
Support: Support needs runbooks for adding a client, changing a flag, diagnosing unexpected fallback behavior, and handling context-resolution failures. Teams should document precedence and default semantics. Debug logging for resolved client and flag source would materially reduce support load if available or addable via the adapter.
Scaling: Flag evaluation is likely cheap, but config size grows with the number of clients and flags. For many tenants, config distribution and cache invalidation become the scaling concern rather than evaluation latency. Long-running workers require strict context isolation to prevent cross-tenant leakage. If the package is config-only, dynamic per-client changes at runtime may not scale operationally without a deployment workflow.
Failure modes: Watch for missing client config silently falling back to default/global, stale config cache, env-based client leakage across requests/jobs, Composer resolving Symfony 7 on PHP 8.1, misconfigured array parameters after the autowiring change, flag-name typos returning defaults, and absent observability. Each should have explicit tests and a rollback path.
Ramp-up: Single-tenant adoption is low-to-moderate effort: install, configure defaults, and wire one flag. Multi-tenant adoption is moderate-to-high because it requires custom context resolution, precedence testing, config governance, and worker/Octane validation. Allocate a short spike and a pilot before committing to platform-wide rollout.
How can I help you explore Laravel packages today?