-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration Feature Flags
Feature flags enable dynamic activation/deactivation of functional features without code deployment.
Feature flags are cross-context switches that:
- Are centrally defined in
rsgo.features.json - Are passed as environment variables to all containers
- Are evaluated at runtime by services
- Can be changed without redeployment
{
"newColorTheme": true,
"discussionV2": false,
"memoRichEditor": true,
"advancedSearch": true,
"betaFeatures": false
}This configuration is passed to containers as:
RSGO_FEATURE_newColorTheme=true
RSGO_FEATURE_discussionV2=false
RSGO_FEATURE_memoRichEditor=true
RSGO_FEATURE_advancedSearch=true
RSGO_FEATURE_betaFeatures=falsepublic class ProjectService
{
private readonly IConfiguration _config;
public ProjectService(IConfiguration config)
{
_config = config;
}
public async Task<Project> GetProjectAsync(string id)
{
var project = await _repository.GetAsync(id);
// Check feature flag
if (_config.GetValue<bool>("RSGO_FEATURE_advancedSearch"))
{
project.SearchMetadata = await _searchService.GetMetadataAsync(id);
}
return project;
}
}// Load feature flags from backend
const features = await api.getFeatureFlags();
// Conditionally render component
{features.newColorTheme && <NewThemeComponent />}
{!features.newColorTheme && <LegacyThemeComponent />}Feature flags can have default values in the manifest:
{
"manifestVersion": "1.0.0",
"stackVersion": "4.3.0",
"features": {
"newColorTheme": {
"default": true,
"description": "New UI theme with improved UX"
},
"discussionV2": {
"default": false,
"description": "New discussion API (Beta)"
}
}
}These defaults are applied to rsgo.features.json during deployment but can be overridden by the admin later.
The admin UI provides a management page for feature flags:
| Feature | Active | Description | Action |
|---|---|---|---|
| newColorTheme | Yes | New UI theme | Toggle |
| discussionV2 | No | New discussion API (Beta) | Toggle |
| memoRichEditor | Yes | Rich text editor for memos | Toggle |
| advancedSearch | Yes | Advanced search features | Toggle |
POST /api/v1/features/newColorTheme/toggle
Response:
{
"feature": "newColorTheme",
"enabled": false,
"updatedAt": "2025-11-17T10:30:00Z"
}GET /api/v1/featuresResponse:
{
"newColorTheme": true,
"discussionV2": false,
"memoRichEditor": true
}PUT /api/v1/features/discussionV2
Content-Type: application/json
{
"enabled": true
}DELETE /api/v1/features/oldFeatureGood: newColorTheme
Good: discussionV2
Bad: feature1
Bad: temp
Always provide a description in the manifest:
"features": {
"newFeature": {
"default": false,
"description": "What does this feature do?"
}
}Regularly remove old/unused feature flags.
Consider feature flags in tests:
[Theory]
[InlineData(true)]
[InlineData(false)]
public async Task TestWithFeatureFlag(bool featureEnabled)
{
// Test both scenarios
}Log feature flag usage:
_logger.LogInformation(
"Feature {Feature} is {Status}",
"discussionV2",
isEnabled ? "enabled" : "disabled"
);Deploy new feature initially disabled, enable later.
Test different implementations in parallel.
Quickly disable feature in case of problems without rollback.
Customers can enable features as needed.
Experimental features for early adopters.
- No granular control: Feature flags are global, not per user/role
- No percentage rollout: Either on or off, not 50% of users
- No time control: No automatic activation at specific times
These features are planned for future versions.
Getting Started
Architecture
Configuration
Security
Setup Wizard
Development
Operations
CI/CD
Reference
- Roadmap
- API Reference
- Configuration Reference
- Manifest Schema
- Multi-Environment
- Stack Sources
- Plugin System
- Technical Specification
- Full Specification
Specifications
Release Notes