This repository has been archived by the owner on Mar 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Package Renames] Add feature flag to disable popularity transfers (#773
) Adds the feature flag `Search.TransferPopularity` that, if disabled, removes all popularity transfers on the search index. Note that download overrides are still applied even if the popularity transfer feature flag is disabled. Addresses NuGet/NuGetGallery#7944 The feature flag staleness monitoring is tracked by NuGet/NuGetGallery#7966
- Loading branch information
1 parent
42d2c4f
commit 136e8b1
Showing
13 changed files
with
363 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using NuGet.Services.FeatureFlags; | ||
|
||
namespace NuGet.Services.AzureSearch | ||
{ | ||
public class FeatureFlagService : IFeatureFlagService | ||
{ | ||
private const string SearchPrefix = "Search."; | ||
|
||
private readonly IFeatureFlagClient _featureFlagClient; | ||
|
||
public FeatureFlagService(IFeatureFlagClient featureFlagClient) | ||
{ | ||
_featureFlagClient = featureFlagClient ?? throw new ArgumentNullException(nameof(featureFlagClient)); | ||
} | ||
|
||
public bool IsPopularityTransferEnabled() | ||
{ | ||
return _featureFlagClient.IsEnabled(SearchPrefix + "TransferPopularity", defaultValue: true); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
namespace NuGet.Services.AzureSearch | ||
{ | ||
public interface IFeatureFlagService | ||
{ | ||
bool IsPopularityTransferEnabled(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.