renovatebot / renovate

Home of the Renovate CLI: Cross-platform Dependency Automation by Mend.io
https://mend.io/renovate
GNU Affero General Public License v3.0
16.67k stars 2.16k forks source link

New self-hosted config option `platformOptions` #29716

Open RahulGautamSingh opened 1 month ago

RahulGautamSingh commented 1 month ago

Describe the proposed change(s).

To improve the organization and accessibility of platform-specific configuration options, combine them under a single config option named platformOptions.

Example:

{
  "platformOptions": {

  // global-only config 
  "bbUseDevelopmentBranch": true,
   "gitlabAutoMergeableCheckAttempts": 3, // prev. RENOVATE_X_GITLAB_AUTO_MERGEABLE_CHECKS_ATTEMPTS
   "gitlabBranchStatusDelay": 4, // prev. RENOVATE_X_BRANCH_STATUS_DELAY
   "gitlabMergeRequestDelay": 100, // prev. RENOVATE_X_MERGE_REQUEST_DELAY

  // repo config
    "gitLabIgnoreApprovals": true,
    "bbUseDefaultReviewers": true
    "azureWorkItemId": 123213
  }
}

_Originally posted by @viceice in https://github.com/renovatebot/renovate/pull/29137#discussion_r1617788554_

RahulGautamSingh commented 1 month ago

Should azureWorkItemId, bbUseDefaultReviewers, gitLabIngoreApprovals be included in this list too? These 3 are a repo config options, whereas all the others options that I included in the pr description are global only options.

viceice commented 1 month ago

Should azureWorkItemId be included in this list too? It is a repo config option currently whereas all the others are already global only options.

I'm not sure about that 🤔

RahulGautamSingh commented 1 month ago

Blocked by: https://github.com/renovatebot/renovate/pull/29137

RahulGautamSingh commented 3 weeks ago

Should azureWorkItemId, bbUseDefaultReviewers, gitLabIngoreApprovals be included in this list too? These 3 are a repo config options, whereas all the others options that I included in the pr description are global only options.

@secustor @rarkins

secustor commented 3 weeks ago

I'm in favor of including these options there too, as else it is confusing why similar options have to be set at different places.

RahulGautamSingh commented 3 weeks ago

Then platformOptions will need to be a repo config option. But we cannot include the global config fields (ie. githubTokenWarn) when we add platformOptions to the repo config.

What should we do in this case? I think maybe we can make this option context-aware:

If found in the repo config:

If found in repo config:

viceice commented 3 weeks ago

we can mark the specific child options as global only, so only they fail validation on repo config. platformOptions should be mergable.

RahulGautamSingh commented 2 weeks ago

There is an internal variable with the same name platformOptions which we use for passing options to the createPr/updatePr functions. I will need to rename it to say, platformPrOptions before hand so it doesn't create confusion.

RahulGautamSingh commented 2 weeks ago

Rhys suggested this option needs a new name. So, I'm adding this to get some recommendations. MAybe platformSettings ?

RahulGautamSingh commented 6 days ago

I don't think githubTokenWarn should be included in this. Even, though it has a platform in its name, it is used to supress github token warning which can be used by users of any platform while self-hosting.

rarkins commented 6 days ago

Can't it be replaced with a log level remap now anyway?

RahulGautamSingh commented 6 days ago

Yes