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

Merged packages are not updated by Dependabot and are actually removed #228

Open
driskell opened this issue Jan 31, 2022 · 1 comment
Open

Comments

@driskell
Copy link

Hello

We've discovered that dependabot is not aware of the merged requirements or repositories added by composer-merge-plugin. This is intentional as dependabot does not run plugin scripts and likely never will. So in a way the two are not compatible.

Worst still, however, is that Dependabot's composer update will then not know about the requirements and strip them from the resulting lock file. This is intentional. As far as composer is concerned the new updated package meant these packages were no longer needed and so are removed since there is no longer a requirement for them anywhere (scripts didn't run.)

I think the way to resolve this potentially is for merge plugin to actually write the merged repository and requirements to the composer JSON file. Could this be a valid feature request?

It has two advantages:

  1. Currently when you merge a composer JSON and commit - in a code review you would never see what is merged. So any new repository definitions that get added will not be reviewable. By merging into composer.json directly you would see these. This enhances the security as at the moment if you merge in a composer JSON and it gets updated you'd never know what changes happened and it could add spurious repository definitions.
  2. When Dependabot or other tools run without scripts - it wouldn't matter - all requirements and repositories are in the composer JSON file.

For now we're doing the merge manually into composer JSON as it gives both benefits.

@gapple
Copy link

gapple commented Mar 27, 2022

Related: dependabot/dependabot-core#4030

For my repositories, I've created a Github Actions Workflow that fixes up dependabot PRs with the correct lock file changes
https://github.com/gapple/dpbot-merge/blob/main/.github/workflows/dependabot-composer.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants