Skip to content

Commit

Permalink
Don't fail if AzdoApiToken or ArtifactsBasePath are empty if UseStrea…
Browse files Browse the repository at this point in the history
…mingPublishing is false (#7308)

These are not required if not using streaming publishing, as is the case when publishing post-build signed assets
  • Loading branch information
mmitche committed Apr 28, 2021
1 parent 67737ae commit 7736546
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ public abstract class PublishArtifactsInManifestBase : Microsoft.Build.Utilities

private readonly string AzureDevOpsBaseUrl = $"https://dev.azure.com";

/// <summary>
/// Instead of relying on pre-downloaded artifacts, 'stream' artifacts in from the input build.
/// Artifacts are downloaded one by one from the input build, and then immediately published and deleted.
/// This allows for faster publishing by utilizing both upload and download pipes at the same time,
/// and reduces maximum disk usage.
/// This is not appplicable if the input build does not contain the artifacts for publishing
/// (e.g. when publishing post-build signed assets)
/// </summary>
public bool UseStreamingPublishing { get; set; }

public readonly Dictionary<TargetFeedContentType, HashSet<TargetFeedConfig>> FeedConfigs =
Expand Down Expand Up @@ -1853,14 +1861,14 @@ protected bool AnyMissingRequiredBaseProperties()
Log.LogError($"The property {nameof(BuildAssetRegistryToken)} is required but doesn't have a value set.");
}

if (string.IsNullOrEmpty(AzdoApiToken))
if (UseStreamingPublishing && string.IsNullOrEmpty(AzdoApiToken))
{
Log.LogError($"The property {nameof(AzdoApiToken)} is required but doesn't have a value set.");
Log.LogError($"The property {nameof(AzdoApiToken)} is required when using streaming publishing, but doesn't have a value set.");
}

if (string.IsNullOrEmpty(ArtifactsBasePath))
if (UseStreamingPublishing && string.IsNullOrEmpty(ArtifactsBasePath))
{
Log.LogError($"The property {nameof(ArtifactsBasePath)} is required but doesn't have a value set.");
Log.LogError($"The property {nameof(ArtifactsBasePath)} is required when using streaming publishing, but doesn't have a value set.");
}
return Log.HasLoggedErrors;
}
Expand Down

0 comments on commit 7736546

Please sign in to comment.