Preflight to checks to enable/disable managers based on function returns #29792
secustor
started this conversation in
Suggest an Idea
Replies: 1 comment
-
sounds good |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Tell us more.
From time to time we have the use case to enable managers instead of another one based on e.g. the presence of a file.
The most recent case is this #29786 (reply in thread)
The manager interfaces would get a new optional field
preflight
which provides the ability to add functions/methods which are run before the extraction.export interface ManagerApi extends ModuleApi { defaultConfig: Record<string, unknown>; categories?: Category[]; supportsLockFileMaintenance?: boolean; supersedesManagers?: string[]; supportedDatasources: string[]; +preflight?(): ((RenovateConfig) => RenovateConfig)[] extractPackageFile?( content: string, packageFile?: string, config?: ExtractConfig, ): Result<PackageFileContent | null>; ...
That way we can provide dynamic configuration based on the state of the repository and we can pull logic from the
extractAllPackagesFiles
.Specific to the use case above. We would check if dot files contain OpenTofu references instead of Terraform and then configure the Terraform manager accordingly.
Beta Was this translation helpful? Give feedback.
All reactions