Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@
<_VersionLabel>$(_VersionLabel.Replace('/merge', ''))</_VersionLabel>
<!-- Finally sanitize the branch with dashes, so we can build path-separated branches, like rel/v1.0.0 or feature/foo -->
<_VersionLabel>$(_VersionLabel.Replace('/', '-'))</_VersionLabel>
<!-- And underscores which are also invalid labels, so we can use branches like dev/feature_foo -->
<_VersionLabel>$(_VersionLabel.Replace('_', '-'))</_VersionLabel>

<!-- Set sanitized version to the actual version suffix used in build/pack -->
<VersionSuffix Condition="!$(VersionLabel.Contains('refs/tags/'))">$(_VersionLabel)</VersionSuffix>
Expand Down
8 changes: 5 additions & 3 deletions src/WhatsApp/FeatureFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ namespace Devlooped.WhatsApp;
/// application's dependency injection container. It supports evaluating features such as <see
/// cref="FeatureFlags.Storage"/> and <see cref="FeatureFlags.Conversation"/>.</remarks>
/// <param name="serviceProvider"></param>
[FilterAlias(nameof(FeatureFilter))]
[FilterAlias(Alias)]
public class FeatureFilter(IServiceProvider serviceProvider) : IFeatureFilter
{
public const string Alias = "whatsapp_features";

public Task<bool> EvaluateAsync(FeatureFilterEvaluationContext context)
{
var result = default(bool);
Expand All @@ -36,8 +38,8 @@ public static void AddFeatures(this IServiceCollection services, IConfiguration
.AddConfiguration(configuration)
.AddInMemoryCollection(new Dictionary<string, string?>
{
{ $"FeatureManagement:{FeatureFlags.Storage.ToString()}:EnabledFor:0:Name", nameof(FeatureFilter) },
{ $"FeatureManagement:{FeatureFlags.Conversation.ToString()}:EnabledFor:0:Name", nameof(FeatureFilter) }
{ $"FeatureManagement:{FeatureFlags.Storage}:EnabledFor:0:Name", FeatureFilter.Alias },
{ $"FeatureManagement:{FeatureFlags.Conversation}:EnabledFor:0:Name", FeatureFilter.Alias }
})
.Build();

Expand Down
2 changes: 1 addition & 1 deletion src/WhatsApp/FeatureFlags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Devlooped.WhatsApp;
/// </summary>
/// <remarks>Feature flags are used to control the availability of specific features within the application. Use
/// this enumeration to specify which features are being targeted for configuration or runtime checks.</remarks>
public enum FeatureFlags
enum FeatureFlags
{
Storage,
Conversation
Expand Down