Skip to content

Commit

Permalink
Fix feed creation for dnceng-stage and staging scenarios (#8082)
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 non-dnceng
- Alter the default permissions setup method to specify null permissions for non-dnceng
  • Loading branch information
mmitche authored Oct 22, 2021
1 parent 15c5951 commit 0f4c86f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ public AzureDevOpsArtifactFeed(string name, string organization, string project)
}
break;
default:
throw new NotImplementedException($"Organization '{organization}' contains no feed permissions information.");
// Use the default permissions
Permissions = null;
break;

}
}
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 @@ -204,7 +203,7 @@ private string GetFeedVisibilityTag(string organization, string project)
throw new NotImplementedException($"Project '{project}' within organization '{organization}' has no visibility mapping.");
}
default:
throw new NotImplementedException($"Organization '{organization}' has no visibility mapping.");
return project.Substring(0, Math.Min(3, project.Length));
}
}
}
Expand Down

0 comments on commit 0f4c86f

Please sign in to comment.