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

feat: dynamic manager config #5392

Merged
merged 14 commits into from Feb 7, 2020
Merged

Conversation

rarkins
Copy link
Collaborator

@rarkins rarkins commented Feb 6, 2020

Move manager definitions and default configs from lib/config/definitions to lib/manager/x

Closes #5279

@rarkins rarkins changed the title Feat/5279 manager dynamic config feat: dynamic manager config Feb 6, 2020
@rarkins
Copy link
Collaborator Author

rarkins commented Feb 6, 2020

I think we may still have a circular import problem however it's hidden by the dynamic manager requires. Linting and building both work, but yarn start errors out:

FATAL: Can not load manager "bundler".
       "err": {
         "message": "options is not defined",
         "stack": "ReferenceError: options is not defined\n    at getOptions (/Users/rhys/src/renovate/lib/config/definitions.ts:2234:3)\n    at Object.<anonymous> (/Users/rhys/src/renovate/lib/platform/index.ts:12:28)\n    at Module._compile (internal/modules/cjs/loader.js:778:30)\n    at Module._compile (/Users/rhys/src/renovate/node_modules/pirates/lib/index.js:99:24)\n    at Module._extensions..js (internal/modules/cjs/loader.js:789:10)\n    at Object.newLoader [as .ts] (/Users/rhys/src/renovate/node_modules/pirates/lib/index.js:104:7)\n    at Module.load (internal/modules/cjs/loader.js:653:32)\n    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)\n    at Function.Module._load (internal/modules/cjs/loader.js:585:3)\n    at Module.require (internal/modules/cjs/loader.js:692:17)"
       }

@viceice
Copy link
Member

viceice commented Feb 6, 2020

can we move it to new dynamic import syntax? then we need to call a promise await on startup to init managers instead of auto init.

@viceice
Copy link
Member

viceice commented Feb 6, 2020

ok, platform should be loaded dynamically too

@viceice
Copy link
Member

viceice commented Feb 6, 2020

const supportedPlatforms = getOptions().find(
option => option.name === 'platform'
).allowedValues;

@rarkins rarkins marked this pull request as ready for review February 6, 2020 15:28
@rarkins rarkins requested a review from viceice February 6, 2020 15:28
viceice
viceice previously approved these changes Feb 6, 2020
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, hopefully no mistake while copy'n'paste config. 😅

@rarkins
Copy link
Collaborator Author

rarkins commented Feb 6, 2020

LGTM, hopefully no mistake while copy'n'paste config. 😅

I think the JSON schema works as a good check in this case. From what I can see, the only field that changed was the "description" one.

@viceice
Copy link
Member

viceice commented Feb 6, 2020

image

Looks like we have some missing test await again

@rarkins rarkins merged commit 864e554 into master Feb 7, 2020
@rarkins rarkins deleted the feat/5279-manager-dynamic-config branch February 7, 2020 18:25
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 19.126.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: move manager config inside manager/x instead of config/definitions
3 participants