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

Add a function to allow dynamic configuration of managers based on repository data #29809

Open
secustor opened this issue Jun 23, 2024 Discussed in #29792 · 0 comments
Open
Assignees
Labels
priority-4-low Low priority, unlikely to be done unless it becomes important to more people type:feature Feature (new functionality)

Comments

@secustor
Copy link
Collaborator

Discussed in #29792

Originally posted by secustor June 21, 2024

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.

Other possibilities are the split up of managers which handle multiple package manager but should not be run in parallel. e.g. npm or pep621

@secustor secustor added priority-4-low Low priority, unlikely to be done unless it becomes important to more people type:feature Feature (new functionality) labels Jun 23, 2024
@secustor secustor self-assigned this Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-4-low Low priority, unlikely to be done unless it becomes important to more people type:feature Feature (new functionality)
Projects
None yet
Development

No branches or pull requests

1 participant