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

fix(docker-compose): support docker-compose.yml version 1 #6596

Merged
merged 5 commits into from Jun 27, 2020

Conversation

wolfgang42
Copy link
Contributor

Closes #6570. Also contains some other refactorings of the function and its related tests; I recommend reviewing the commits individually rather than trying to look at all the changes at once.

* 'returns null for empty' now actually checks empty string
  (previously this branch was ignored in test coverage)

* 'returns null for non-object YAML' - existing test renamed
  (previously named 'for empty' which isn't what it was checking)
There is a test ('returns null for non-object YAML') for this behaviour,
but it was relying on the loop iterating over individual characters in
the resulting string and not finding anything useful in them,
which seems more like an accident than the way things were intentionally
structured. So, this adds an explicit check for this case.
This was previously necessary to get the test 'returns null for
non-object YAML' to pass, but that seems to have been accidental and was
fixed in the previous commit.

This does change the behaviour of this function, but not (I think) in a way
which will cause issues: it will now return an empty array rather than null
in the case of a compose file that has no services with an image, but doing
so makes sense: the file was extracted successfully, it's just that there's
nothing of interest to be found in it.
@@ -79,9 +90,6 @@ export function extractPackageFile(
.filter(Boolean);

logger.trace({ deps }, 'Docker Compose image');
if (!deps.length) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getPkgReleases() logic in datasource/index will actually convert an empty file to null anyway. We generally prefer to ignore files with no dependencies.

@rarkins rarkins merged commit ec43556 into renovatebot:master Jun 27, 2020
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 21.18.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docker-compose.extractPackageFile silently assumes version 2+
3 participants