Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Parametrize budget rollover into a configuration #1562

Merged
merged 5 commits into from
Feb 20, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public void BeforeScenarioWorkspaceCosts(IObjectContainer objectContainer,
.AddUserSecrets<Hooks>()
.AddJsonFile("appsettings.test.json", optional: true)
.Build();
configuration["EnableRollover"] = "true";

var datahubPortalConfiguration = new DatahubPortalConfiguration();
configuration.Bind(datahubPortalConfiguration);
Expand Down
2 changes: 2 additions & 0 deletions ServerlessOperations/src/Datahub.Functions/AzureConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public AzureConfig(IConfiguration config)
public AzureDevOpsConfiguration AzureDevOpsConfiguration => _azureDevOpsConfiguration;

public string? NotificationPercents => _config["ProjectUsageNotificationPercents"];

public bool EnableRollover => _config.GetValue<bool>("EnableRollover", false);

#region Inactivity

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ internal async Task<bool> UpdateUsage(ProjectUsageUpdateMessage message, Cancell
*/

// Check if the cost rollover is necessary
if (message.ForceRollover || costRollover)
if (message.ForceRollover || (_azConfig.EnableRollover && costRollover))
{
_logger.LogInformation("Rollover starting for {Acronym}...", message.ProjectAcronym);
var rolloverTimer = Stopwatch.StartNew();
Expand Down
Loading