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

Commit

Permalink
Added configuration item to specify SAS token expiration explicitly. …
Browse files Browse the repository at this point in the history
…Removed validation container cleanup on validation set success.
  • Loading branch information
agr committed Jun 13, 2019
1 parent 65edf7e commit 95bbcb3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,10 @@ public class ValidationConfiguration
/// The threshold until a validation set is no longer processed.
/// </summary>
public TimeSpan TimeoutValidationSetAfter { get; set; }

/// <summary>
/// The duration for which SAS tokens are generated for package URLs passed down to validators.
/// </summary>
public TimeSpan NupkgUrlValidityPeriod { get; set; } = TimeSpan.FromDays(7);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ public async Task ProcessValidationOutcomeAsync(PackageValidationSet validationS
{
await ScheduleCheckIfNotTimedOut(validationSet, validatingEntity, tooLongNotificationAllowed: false);
}
else
{
await _packageFileService.DeletePackageForValidationSetAsync(validationSet);
}

// TODO: implement delayed cleanup that would allow internal services
// to access original packages for some time after package become available:
// https://github.com/NuGet/Engineering/issues/2506
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ private async Task<bool> ProcessNotStartedValidations(PackageValidationSet valid
using (_logger.BeginScope("Not started {ValidationType} Key {ValidationId}", packageValidation.Type, packageValidation.Key))
{
_logger.LogInformation("Processing not started validation {ValidationType} for {PackageId} {PackageVersion}, validation set {ValidationSetId}, {ValidationId}",
packageValidation.Type,
validationSet.PackageId,
validationSet.PackageNormalizedVersion,
validationSet.ValidationTrackingId,
packageValidation.Key);
packageValidation.Type,
validationSet.PackageId,
validationSet.PackageNormalizedVersion,
validationSet.ValidationTrackingId,
packageValidation.Key);
var validationConfiguration = GetValidationConfiguration(packageValidation.Type);
if (validationConfiguration == null)
{
Expand Down Expand Up @@ -283,7 +283,7 @@ private async Task<IValidationRequest> CreateValidationRequest(
{
var nupkgUrl = await _packageFileService.GetPackageForValidationSetReadUriAsync(
packageValidationSet,
DateTimeOffset.UtcNow.Add(_validationConfiguration.TimeoutValidationSetAfter));
DateTimeOffset.UtcNow.Add(_validationConfiguration.NupkgUrlValidityPeriod));

var validationRequest = new ValidationRequest(
validationId: packageValidation.Key,
Expand Down

0 comments on commit 95bbcb3

Please sign in to comment.