mergeability / mergeable

πŸ€– All the missing GitHub automation πŸ™‚ πŸ™Œ
https://mergeable.us
GNU Affero General Public License v3.0
679 stars 120 forks source link

supportedSettings[key].includes is not a function #729

Closed Paddy-Farmeye closed 11 months ago

Paddy-Farmeye commented 11 months ago

Hi there I'm getting the error below with the following config:

version: 2
mergeable:
  - when: pull_request.*
    validate:
      - do: or
        validate:
          - do: title
            must_include:
              regex: ^\[FE+-\d+\]*
              message: FARMEYE commits should be of the form "[FE-###] A brief description of the feature/bug".
          - do: title
            begins_with: 'Release'

Error:

❗ Validator: INTERNAL ERROR
Status ERROR

❗ Internal error!
Input :
Settings : {}
Error : This is a mergeable bug, please report it on our issue tracker: https://github.com/mergeability/mergeable/issues/new
TypeError: supportedSettings[key].includes is not a function
    at Title.validateSettings (/app/lib/validators/validator.js:89:42)
    at Title.processValidate (/app/lib/validators/validator.js:46:12)
    at validateFuncCall (/app/lib/flex/lib/getValidatorPromises.js:4:74)
    at /app/lib/flex/lib/createPromises.js:8:21
    at Array.forEach (<anonymous>)
    at createPromises (/app/lib/flex/lib/createPromises.js:3:18)
    at getValidatorPromises (/app/lib/flex/lib/getValidatorPromises.js:6:10)
    at logicalConnectiveValidatorProcessor (/app/lib/validators/lib/logicalConnectiveValidatorProcessor.js:43:20)
    at Or.validate (/app/lib/validators/or.js:17:12)
    at Or.processValidate (/app/lib/validators/validator.js:57:17)

Basically, it should pass if the title beginsWith 'Release' or matches the regex ... I've potentially misconfigured. Hopefully you can help, thanks.

shine2lay commented 11 months ago

this error occurs when you use a setting that is not supported, i think you have typo somewhere in your config

Paddy-Farmeye commented 11 months ago

Cool, I reckon I can achieve what I'm after all in the regex tbh: ^Release|^\[FE+-\d+\]]*