dependabot-core icon indicating copy to clipboard operation
dependabot-core copied to clipboard

What does "include: scope" actually do?

Open jwodder opened this issue 2 years ago • 0 comments

The page "Configuration options for the dependabot.yml file" indicates that the include field under the commit-message key can only be set to the string "scope" and that doing so "specifies that any prefix is followed by a list of the dependencies updated in the commit."

Here is an example Dependabot version update PR that updates a Python dependency with include: scope enabled. Here is a Dependabot PR that updates a Python dependency without include: scope. The only meaningful difference between the two commit messages is that the first one has the string "(deps)" inserted between the commit prefix and the colon, which is not a list of the dependencies updated in the commit.

Searching around, issues like #2996 suggest to me that the purpose of "include: scope" is to include a Conventional Commits scope in the commit message, and apparently Dependabot tries to determine the proper scope to use by analyzing your project's commit messsages.

Neither of the PRs I linked to above are in repositories that use Conventional Commits.

So, is the "include: scope" setting supposed to cause the updated dependencies to be listed in the commit message as the documentation implies — in which case, why isn't it doing that? — or is it for enabling a Conventional Commits scope — in which case, the documentation is very wrong and needs to be corrected.

EDIT: Via this PR, I found what seems to be the only use of the include setting in Dependabot's code:

https://github.com/dependabot/dependabot-core/blob/bb0fe6576bf2fa0e6cb8ba111f87c4b41908065e/common/lib/dependabot/pull_request_creator/pr_name_prefixer.rb#L110

This implies that "include: scope" is indeed for adding a Conventional Commits scope rather than for listing updated dependencies.

jwodder avatar Nov 20 '23 22:11 jwodder