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: Allow multiple autodiscover filter #9453

Merged
merged 3 commits into from Apr 19, 2021

Conversation

l0nax
Copy link
Contributor

@l0nax l0nax commented Apr 8, 2021

To support multiple filters when using the autodiscover feature, the
type of the configuration value is changed to an array.

Closes #8763

Changes:

Type of autodiscoverFilter configuration value changed to string[].

Context:

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please tick one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added unit tests, or
  • No new tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@l0nax l0nax force-pushed the autodiscover-support-array branch from 1deb3da to d11739c Compare April 8, 2021 13:34
@l0nax l0nax changed the title Change autodiscoverFilter type to array refactor: Change autodiscoverFilter type to array Apr 8, 2021
@l0nax l0nax force-pushed the autodiscover-support-array branch from d11739c to a0e7944 Compare April 8, 2021 13:34
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.

config definition needs update too, see schedule as sample.

type: 'string',

Also needs a migration for compatibility, see baseBranch as sample

migratedConfig.baseBranches = (is.array(val) ? val : [val]) as string[];

@l0nax
Copy link
Contributor Author

l0nax commented Apr 8, 2021

Also needs a migration for compatibility, see baseBranch as sample

autodiscoverFilter is defined in the GlobalOnlyConfig interface, how do I access this field inside of migrateConfig?

@rarkins
Copy link
Collaborator

rarkins commented Apr 8, 2021

Would it work if you defined it as allowStrong=true in definitions? That way massaging might happen automatically and massaging isn't required.

@l0nax
Copy link
Contributor Author

l0nax commented Apr 8, 2021

What do you mean by defining it as allowStrong=true? I could find any occurrence of allowStrong in the code base.

@viceice
Copy link
Member

viceice commented Apr 8, 2021

allowString a typo. 😉

Check config/definitions.ts

@l0nax l0nax force-pushed the autodiscover-support-array branch from a0e7944 to 7aba1ef Compare April 8, 2021 18:15
@l0nax
Copy link
Contributor Author

l0nax commented Apr 8, 2021

Oh, I'm sorry 😅

I've added allowString to the type definition.

@viceice
Copy link
Member

viceice commented Apr 9, 2021

Did you tested a single string too for autodiscoverFilter ? so it will be backward compatible?

@viceice
Copy link
Member

viceice commented Apr 9, 2021

ok i see this

if (!allowedStrings) {
allowedStrings = [];
options.forEach((option) => {
if (option.allowString) {
allowedStrings.push(option.name);
}
});
}

if (allowedStrings.includes(key) && is.string(val)) {
massagedConfig[key] = [val];

So it should work, because all configs are passed to this massageConfig function.

lib/workers/global/autodiscover.ts Outdated Show resolved Hide resolved
lib/workers/global/autodiscover.ts Outdated Show resolved Hide resolved
lib/workers/global/autodiscover.ts Outdated Show resolved Hide resolved
@rarkins rarkins marked this pull request as draft April 14, 2021 15:29
@l0nax l0nax force-pushed the autodiscover-support-array branch from 2a3cb9b to b1992b0 Compare April 15, 2021 14:39
@l0nax l0nax marked this pull request as ready for review April 15, 2021 14:39
@l0nax l0nax force-pushed the autodiscover-support-array branch from b1992b0 to eb737c8 Compare April 15, 2021 14:40
@l0nax l0nax requested a review from viceice April 15, 2021 14:40
To support multiple filters when using the autodiscover feature, the
type of the configuration value is changed to an array.

Closes renovatebot#8763

BREAKING CHANGE: The type of the 'autodiscoverFilter' configuration
value has changed to an string array.
@l0nax l0nax force-pushed the autodiscover-support-array branch from b4bf1be to d25b498 Compare April 19, 2021 13:29
@l0nax l0nax requested a review from viceice April 19, 2021 13:29
@viceice viceice changed the title refactor: Change autodiscoverFilter type to array feat: Allow multiple autodiscover filter Apr 19, 2021
@viceice viceice enabled auto-merge (squash) April 19, 2021 13:39
@viceice viceice merged commit 45739cd into renovatebot:master Apr 19, 2021
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 24.118.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

rarkins added a commit that referenced this pull request Apr 20, 2021
rarkins added a commit that referenced this pull request Apr 20, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 20, 2021
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.

Make autodiscover filter more useful
4 participants