-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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(managers/custom): generic manager for json files #32784
base: main
Are you sure you want to change the base?
feat(managers/custom): generic manager for json files #32784
Conversation
…Singh/renovate into feat/generic-manager
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I definitely want to see an example of this working on a real repo
Test run on renovate repo, targeting the |
Tried to make the matching logic in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
waiting for the refactor PR to be merged and this PR update onto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise LGTM
We also recommend that you also tell Renovate what `versioning` to use. | ||
If the `versioning` field is missing, then Renovate defaults to using `semver` versioning. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't fully true. the datasource can set a different versioning (most data sources doing it). we should suggest this only if the datasource default versioning isn't suitable
const res = await extractPackageFile(json, 'unused', config); | ||
|
||
expect(res).toMatchObject({ | ||
deps: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add templates here because they should returned too?
You may use any of these items: | ||
|
||
- `depType`, _or_ use the `depTypeTemplate` template field | ||
- `versioning`, _or_ the use `versioningTemplate` template field. If neither are present, Renovate defaults to `semver-coerced` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defaults to datasource default
|
||
if ( | ||
!queryResult || | ||
is.emptyObject(queryResult) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we really need to check it here? wouldn't it fail later anyway 🤔
We recommend you use only _one_ of these methods, or you'll get confused. | ||
|
||
We recommend that you also tell Renovate what `versioning` to use. | ||
We also recommend that you also tell Renovate what `versioning` to use. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also recommend that you also tell Renovate what `versioning` to use. | |
Also, we recommend you explicitly set which `versioning` Renovate should use. |
We recommend you use only _one_ of these methods, or you'll get confused. | ||
|
||
We recommend that you also tell Renovate what `versioning` to use. | ||
We also recommend that you also tell Renovate what `versioning` to use. | ||
If the `versioning` field is missing, then Renovate defaults to using `semver` versioning. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copying @viceice
's comment:
this isn't fully true. the datasource can set a different versioning (most data sources doing it). we should suggest this only if the datasource default versioning isn't suitable
What do you think of this text?
If the `versioning` field is missing, then Renovate defaults to using `semver` versioning. | |
Renovate defaults to `semver` versioning if _both_ condition are met: | |
- The `versioning` field is missing in the custom manager config | |
- The Renovate datasource does _not_ set its own default versioning |
Changes
jsonata
queries to extract the deps info from a package file. Details are similar to regex manager implementation, except that we do not need to explicitly handle the recursive matching as that is already handled by thejsonata
query language.Context
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: