Skip to content

Commit

Permalink
Fix feed creation for dnceng-stage and staging scenarios
Browse files Browse the repository at this point in the history
- Don't call GetFeedVisibilityTag when the feed name is explicitly specified
- Alter GetFeedVisibilityTag to support dnceng
- Alter the default permissions setup method to specify null permissions for dnceng.
  • Loading branch information
mmitche committed Oct 22, 2021
1 parent cb683d5 commit 48fa7eb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ public AzureDevOpsArtifactFeed(string name, string organization, string project)
throw new NotImplementedException($"Project '{project}' within organization '{organization}' contains no feed permissions information.");
}
break;
case "dnceng-stage":
// Use the default permissions for dnceng-stage
switch (project)
{
case "public":
case "internal":
Permissions = null;
break;
default:
throw new NotImplementedException($"Project '{project}' within organization '{organization}' contains no feed permissions information.");
}
break;
default:
throw new NotImplementedException($"Organization '{organization}' contains no feed permissions information.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,8 @@ private async Task<bool> ExecuteAsync()
// 1. In nuget.config files (and elsewhere), the name at a glance can identify its visibility
// 2. Existing automation has knowledge of "darc-int" and "darc-pub" for purposes of injecting authentication for internal builds
// and managing the isolated feeds within the NuGet.config files.
string accessTag = GetFeedVisibilityTag(AzureDevOpsOrg, AzureDevOpsProject);
string extraContentInfo = !string.IsNullOrEmpty(ContentIdentifier) ? $"-{ContentIdentifier}" : "";
string baseFeedName = FeedName ?? $"darc-{accessTag}{extraContentInfo}-{feedCompatibleRepositoryName}-{CommitSha.Substring(0, ShaUsableLength)}";
string baseFeedName = FeedName ?? $"darc-{GetFeedVisibilityTag(AzureDevOpsOrg, AzureDevOpsProject)}{extraContentInfo}-{feedCompatibleRepositoryName}-{CommitSha.Substring(0, ShaUsableLength)}";
string versionedFeedName = baseFeedName;
bool needsUniqueName = false;
int subVersion = 0;
Expand Down Expand Up @@ -194,6 +193,7 @@ private string GetFeedVisibilityTag(string organization, string project)
switch (organization)
{
case "dnceng":
case "dnceng-stage":
switch (project)
{
case "internal":
Expand Down

0 comments on commit 48fa7eb

Please sign in to comment.