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

test(manager): manager need to exports updateDependency or extractPackageFile when exporting extractAllPackageFiles #27954

Merged
merged 4 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/development/adding-a-package-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ As another example, in order for Gradle to extract dependencies Renovate must fi
The `extractAllPackageFiles` function takes an array of filenames as input.
It returns an array of filenames and dependencies.

If you implement `extractAllPackageFiles` the manger must export as well either `updateDependency` or `extractPackageFile`.
Shegox marked this conversation as resolved.
Show resolved Hide resolved

### `getRangeStrategy(config)` (optional)

Write this optional function if you want the manager to support "auto" range strategies.
Expand Down
8 changes: 8 additions & 0 deletions lib/modules/manager/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ describe('modules/manager/index', () => {
if (!module.extractPackageFile && !module.extractAllPackageFiles) {
return false;
}
// managers must export either extractPackageFile or a custom updateDependency function in addition to extractAllPackageFiles
if (
module.extractAllPackageFiles &&
!module.extractPackageFile &&
!module.updateDependency
) {
return false;
}
if (Object.values(module).some((v) => v === undefined)) {
return false;
}
Expand Down