Skip to content
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

Handle branch names containing dependency group #565

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

CloudNStoyan
Copy link
Contributor

Fixes #489

When extracting the directory from the branch name of a Dependabot PR that uses groups, the branch name will only include the group name instead of dependency names as described below:

This issue is caused by https://github.com/dependabot/fetch-metadata/blob/main/src/dependabot/update_metadata.ts#L52
That code is expecting the branch name to contain the dependency name when for grouped updates it will only contain the group name, and because all the dependency names contain multiple /s it is failing to get the directory name.
This is similar to #493 and #494, but it is not addressed by my pr #495.
Originally posted by @dreid in #489 (comment)

I have fixed that and I have added 3 tests to test the new logic

I also had to edit this test because it depended on the broken group logic

test('it supports returning information about grouped updates', async () => {

Here the test checks if the directory is set to / while the PR is a group one and the branch name is this: dependabot/docker/gh-base-image/docker-1234566789 which is incorrect, here the directory should be gh-base-image

@CloudNStoyan CloudNStoyan requested a review from a team as a code owner October 24, 2024 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fetch-metadata action returns / for directory output
1 participant