tinglesoftware / dependabot-azure-devops

Tools for updating dependencies in Azure DevOps repositories using https://dependabot.com
MIT License
191 stars 63 forks source link

Problem trying to use the directories in the dependabot.yml #1253

Closed bm-fez closed 2 months ago

bm-fez commented 2 months ago

Describe the bug We are trying to use the following dependabot.yml file with the directories

version: 2
updates:
  - package-ecosystem: "npm"
    directories:
      - "/api"
      - "/BM.DocumentAddin"

We can see from the logs that this results in the expected docker run command line

/usr/bin/docker run --rm -i -e DEPENDABOT_PACKAGE_MANAGER=npm -e DEPENDABOT_OPEN_PULL_REQUESTS_LIMIT=5 -e DEPENDABOT_DIRECTORIES=["/api","/BM.DocumentAddin"] -e DEPENDABOT_FAIL_ON_EXCEPTION=true -e AZURE_ORGANIZATION=blackmarble-source -e AZURE_PROJECT=BM -e AZURE_REPOSITORY=BlackMarble.DocumentAddin -e AZURE_ACCESS_TOKEN=*** -e AZURE_MERGE_STRATEGY=squash ghcr.io/tinglesoftware/dependabot-updater-npm:1.30.2 update_script

However the logs show the analysis is being done of the default directory

Working in blackmarble-source/BM/_git/BlackMarble.DocumentAddin, 'default' branch under '/' directory

It appears the DEPENDABOT_DIRECTORIES is not being honoured

We have also tried (using a locally hosted docker container

I have no Ruby skills (hence I have not attempted to submit a PR), but unless I missed it I don't think the directories array is passed into the update_script code.

Categorization

To Reproduce Attempt to use the directories as opposed to the directory

Expected behavior Should be able to do analysis of multiple listed directories, or ones specified with Globstar syntax

Extension (please complete the following information):

Server (please complete the following information):

rhyskoedijk commented 2 months ago

@bm-fez support for directories is a relatively new change and isn't supported in the default "update_script" shown in your logs.

You can use directories by switching to "update_script_vnext". Enable it by checking the "Use latest update script (vNext)" checkbox under "Advanced" in the task options, or using useUpdateScriptvNext: true if using YML pipelines.

More info about the vNext script and the new features it supports can be found in https://github.com/tinglesoftware/dependabot-azure-devops/pull/1186.

bm-fez commented 2 months ago

Thanks the useUpdateScriptvNext: true parameter unblocked us.