使用来自另一个项目(在同一组织内)的工件提要作为上游源

Use artifact feed from another Project (within same organisation) as upstream source

我在一个组织中有以下设置:

目前所有包都添加到本地视图,这是默认设置。在本地视图权限中,我将其配置为 'People in '

当我在 ProjectB 中创建管道时,它使用步骤 'Nuget restore' 和提要 'ProjectB.FeedB' 我在恢复包时总是以错误结束:

Response status code does not indicate success: 502 (Bad Gateway - The upstream source FeedA@Local can't be found because the upstream feed's project with id 'xxxxx-xxxx-xxxx-xxxx-xxxxxxxxx' is deleted or has had its permissions changed. (DevOps Activity ID: XXXXXX-XXXX-XXXX-XXXX-XXXXXX)).)

我发现过去所有的工件提要都是 'Organisation scoped'。现在创建提要时,它们是 'Project-scoped'。然而:

非常欢迎任何有关如何解决此问题的指示!

从有关该主题的文档来看,唯一的方法似乎是使用 API,如您所说(强调我的)。

https://docs.microsoft.com/en-us/azure/devops/artifacts/feeds/project-scoped-feeds?view=azure-devops

If you're concerned that your project will be turned public in the future and you want your feed remain private, you can use the organization-scoped feed that's automatically created when a new organization is created. Alternatively, you can use the Create Feed API to manually create a new organization-scoped feed. You will have to set the default permissions for the new feed manually either by using the Feed Permission API or the Artifacts feed settings. Creating new organization-scoped feeds is not recommended.

所以你有两个选择:

  • 使用 the/an 现有组织供稿,或
  • 通过 API 手动创建组织供稿(不推荐)。

但是,您能否在执行还原之前使用特殊任务对项目范围的 Azure Artifacts 源进行身份验证?我们目前正在使用 NuGet Authenticate 任务使用来自另一个项目(在同一组织内)的一个项目的项目范围的提要:

steps:
- task: UseDotNet@2
  inputs:
    packageType: 'sdk'
    version: 3.1.101
- task: NuGetAuthenticate@0
- task: DotNetCoreCLI@2
  displayName: 'dotnet restore with nuget.config'
  inputs:
    command: 'restore'
    projects: '**/*.csproj'
    feedsToUse: 'config'
    nugetConfigPath: 'nuget.config'

I don't see a way to create an organisation scope feed anywhere (besides using the API).

对于这个问题,恐怕不支持通过UI创建新的organization-scoped feeds。目前,仅支持 rest API 为组织范围创建提要。

到目前为止,在我们对Azure Devops 论坛的官方功能建议中,已经存在这样的建议:Organisation scoped feeds。您可以在那里发表评论和投票。

If I'm able to configure the view in my Project-Scoped feed to be accessible to the entire organisation I guess this should work?

针对此问题,您可以尝试在 Feed 权限设置中将其他 Project 的 Build Service 组添加到 Feed 权限。

我终于明白了。

转到

Project settings > Pipeline > Settings

在那里你可以看到选项:

Limit job authorization scope to current project

组织设置中也有此选项!