-
-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question targetRepositoryName is set but configuration cannot be found #1095
Comments
I found out that using a service connection (parameter This works: - task: dependabot@1
inputs:
packageManager: 'nuget'
targetRepositoryName: 'repo2'
dockerImageTag: '1.24' # another open issue in this repo
azureDevOpsServiceConnection: myconnection This doesn't: - task: dependabot@1
inputs:
packageManager: 'nuget'
targetRepositoryName: 'repo2'
dockerImageTag: '1.24' # another open issue in this repo |
I have set all permissions to allow on the Project collection service account but doesn't help. |
The error dependabot-azure-devops/extension/task/utils/parseConfigFile.ts Lines 68 to 82 in 4ffc72b
|
I see it. This is then very strange. Can it be something with Again, when I click the link that is logged by the error, the configuration file is downloaded. Enabling the service connection (only change) works. This is my complete setup: My pipeline: trigger: none
schedules:
- cron: '0 2 * * *'
always: true
branches:
include:
- main
batch: true
displayName: Nightly
variables:
# Define the system.debug variable
system.debug: true
parameters:
- name: myObject
type: object
default:
repos:
- 'my.repo2'
stages:
- stage: dependabot
displayName: dependabot
pool:
name: Azure Pipelines
vmImage: ubuntu-latest
jobs:
- job: dependabot
displayName: Run dependabot
steps:
- ${{ each repo in parameters.myObject.repos }}:
- task: dependabot@1
displayName: ${{ repo }}
continueOnError: true
inputs:
targetRepositoryName: ${{ repo }}
# azureDevOpsServiceConnection: my-service-connection # without service connection configuration file can't be found.
dockerImageTag: '1.24' # https://github.com/tinglesoftware/dependabot-azure-devops/issues/921
env:
AZURE_ARTIFACTS_TOKEN: $(System.AccessToken) In repo 2 config version: 2
registries:
foo:
type: nuget-feed
url: https://pkgs.dev.azure.com/MyCollection/MyProject/_packaging/foo/nuget/v3/index.json
token: PAT:${{AZURE_ARTIFACTS_TOKEN}}
updates:
- package-ecosystem: nuget
registries:
- foo
directory: "/"
target-branch: main
commit-message:
prefix: fix
include: scope
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major", "version-update:semver-minor"] Output log:
|
Are we sure that when a user (in our example the build service) is getting a 403 or a 401 with azure devops rest api when it's trying to get a file that it hasn't permissions to? I also tried something else for more debugging. So that is the reason why I think the rest client is returning a 404 when the user has not enough permissions. |
@Lukejkw Thank you for the reply. I checked this setting and it brought me in the right direction. This option is of course for safety so it's not recommended to turn it off. It's on by default and mostly forced on organization/collection level. So I digged into it because turning this setting off made it working. But! I found a better workaround. I now knew the reason so it's easier to search for it. If you read the documentation for the setting But you can use the resources:
repositories:
- repository: R1
type: git
name: MyDevOpsProject/R1
- repository: R2
type: git
name: MyDevOpsProject/R2
- repository: R3
type: git
name: MyDevOpsProject/R3
- repository: Rnnn
type: git
name: MyDevOpsProject/Rnnn So I ended with the following pipeline: trigger: none
schedules:
- cron: '0 2 * * *'
always: true
branches:
include:
- main
batch: true
displayName: Nightly
variables:
# Define the system.debug variable
system.debug: true
parameters:
- name: repositories
displayName: Repositories
type: object
default:
names:
- 'my.repo2'
resources:
repositories:
- repository: my.repo2
type: git
name: my.repo2 # I didn't use project because repo is in the same project
stages:
- stage: dependabot
displayName: dependabot
pool:
name: Azure Pipelines
vmImage: ubuntu-latest
jobs:
- job: dependabot
displayName: Run dependabot
uses:
repositories: # List of referenced repositories
- 'my.repo2' # Repository reference from the resources section
# or
# uses:
# repositories: ${{ parameters.repositories.names }}
steps:
- ${{ each repo in parameters.repositories.names }}:
- task: dependabot@1
displayName: ${{ repo }}
continueOnError: true
inputs:
targetRepositoryName: ${{ repo }}
dockerImageTag: '1.24' # https://github.com/tinglesoftware/dependabot-azure-devops/issues/921
env:
AZURE_ARTIFACTS_TOKEN: $(System.AccessToken) When you queue the pipeline, you need to Only need to find a way to remove the duplicate repository names here in the pipeline. |
I'm trying to setup a pipeline for multiple repositories. My setup is as follow:
Repo 1:
config file:
.azuredevops/dependabot.yml
pipeline yaml file:
Repo 2:
config file:
.azuredevops/dependabot.yml
I'm getting the error:
Configuration file not found at possible locations: /.azuredevops/dependabot.yml, /.azuredevops/dependabot.yaml, /.github/dependabot.yaml, /.github/dependabot.yml
When I set system.debug to true I see the following log:
But when I navigate to that url the file is downloaded. How can that be?
The text was updated successfully, but these errors were encountered: