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

Simplify hybrid manifest/lockfile cases in NPM ecosystem #7184

Open
deivid-rodriguez opened this issue Apr 27, 2023 · 2 comments
Open

Simplify hybrid manifest/lockfile cases in NPM ecosystem #7184

deivid-rodriguez opened this issue Apr 27, 2023 · 2 comments
Labels

Comments

@deivid-rodriguez
Copy link
Contributor

Code improvement description

In the updater implementation living at npm_and_yarn/, there's quite a few places that establish a priority of package managers when mixed files are found, like when both Yarn & NPM lockfiles are present. For example, if both NPM and Yarn files are present, we choose Yarn 🤷‍♂️.

We should probably raise in these mixed cases and raise an error during file fetching when they happen. If we also persist the resolved package manager somewhere that the rest of the update components can access, we should be able to fully eliminate this "priority of package managers" from everywhere.

@jeffwidman
Copy link
Member

Examples of this in our code:

Additionally, I expect us to hit more edge cases over time where we actually aren't sure with 100% confidence which package manager the user wants to use... so IMO we should consider dropping all the guessing in favor of switching to having the user explicitly configure in dependabot.yaml which package manager they want us to use, rather than guessing:

@deivid-rodriguez
Copy link
Contributor Author

I'm starting to improve this at #7134, by only fetching files for the selected package manager if packageManager is configured in the package.json file.

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

No branches or pull requests

2 participants