Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
/ NuGet.Jobs Public archive

[Revalidation] Add configurable overrides for revalidation rates #588

Merged
merged 3 commits into from
Oct 19, 2018

Conversation

loic-sharma
Copy link
Contributor

@loic-sharma loic-sharma commented Oct 16, 2018

This will let us speed up/slow down the revalidation job by changing Octopus variables and creating a new deployment.

Addresses https://github.com/NuGet/Engineering/issues/1789

@@ -112,6 +119,12 @@ await scope.ServiceProvider
protected override void ConfigureJobServices(IServiceCollection services, IConfigurationRoot configurationRoot)
{
services.Configure<RevalidationConfiguration>(configurationRoot.GetSection(JobConfigurationSectionName));
services.Configure<RevalidationConfiguration>(config =>
Copy link
Contributor Author

@loic-sharma loic-sharma Oct 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm configuring the same configuration twice to override the event rates. See this documentation:

You can add multiple configuration providers... They're applied in the order that they're registered... When more than one configuration service is enabled, the last configuration source specified wins and sets the configuration value.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't you then have

services.Configure<RevalidationConfiguration>(config =>
{
    config.MinPackageEventRate = _overrideMinPackageEventRate;
    config.MaxPackageEventRate = _overrideMaxPackageEventRate;
});

as the first Configure call, followed by

services.Configure<RevalidationConfiguration>(configurationRoot.GetSection(JobConfigurationSectionName));

Which will override defaults if specified?

Copy link
Contributor Author

@loic-sharma loic-sharma Oct 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CLI arguments should override the settings file as the CLI arguments come from Octopus, which is what I'll be updating.

The Configure methods are called in the order that they're registered:

  1. The setting's files configs are applied
  2. The CLI overrides are applied on top of the setting's files

I've deployed this and verified the behavior is as expected.

@@ -9,6 +9,8 @@ title #{Jobs.nuget.services.revalidate.Title}

start /w NuGet.Services.Revalidate.exe ^
-Configuration #{Jobs.nuget.services.revalidate.Configuration} ^
-OverrideMinPackageEventRate #{Jobs.nuget.services.revalidation.MinPackageEventRate} ^
Copy link
Member

@joelverhagen joelverhagen Oct 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move this to the JSON. As talked about offline, we have other Octopus replacement tokens in the JSON so we can't can just mimic that.

Copy link
Member

@joelverhagen joelverhagen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⌚️

Copy link
Member

@joelverhagen joelverhagen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⌚️

@loic-sharma loic-sharma merged commit ab3301b into dev Oct 19, 2018
@loic-sharma loic-sharma deleted the loshar-config branch October 19, 2018 00:13
joelverhagen pushed a commit that referenced this pull request Sep 27, 2019
I've split tests into two categories:

1. "First results" - These tests that the expected results are first
2. "Top results" - These tests that the expected results are found

I ensured that our tests align with the most frequently selected results, as per our search telemetry.

Addresses NuGet/NuGetGallery#6980
joelverhagen pushed a commit that referenced this pull request Oct 26, 2020
This will let us speed up/slow down the revalidation job by changing Octopus variables and creating a new deployment.

Addresses https://github.com/NuGet/Engineering/issues/1789
joelverhagen pushed a commit that referenced this pull request Oct 26, 2020
I've split tests into two categories:

1. "First results" - These tests that the expected results are first
2. "Top results" - These tests that the expected results are found

I ensured that our tests align with the most frequently selected results, as per our search telemetry.

Addresses NuGet/NuGetGallery#6980
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants