Regex are not working in Control Freak Plugin

Issue #51 closed
Ashok G created an issue

I'm facing the issue to implement the regex in the JIRA Policy section of control freak , I want to implement the regex to accept the JIRA issues if it matches to this string "DEFECT_ID:CIP-12345" the same regex i have been using in many of the python scripts its working but in control freak plugin its not working for JIRA Policy section .

Bitbucket version : Atlassian Bitbucket v5.13.1

Control Freak Plugin version : v. 2018.10.10

My Regex : (^DEFECT_ID\s:(\sFI-[0-9]+)+) Input pattern : DEFECT_ID : FI-1234 FI-34567

Could you please help me to resolve this ?

Comments (7)

  1. Ashok G reporter

    Error message :

    Writing objects: 100% (4/4), 424 bytes, done. Total 4 (delta 1), reused 0 (delta 0) remote: remote: Control Freak remote: ----- remote: Commit 230c2c60c25784f9 rejected. remote: remote: Commit messages must satisfy the configured regex. remote: Failed Regex: ((^DEFECT_ID\s:(\sFI-[0-9]+)+)) remote: ----- remote:

  2. Julius Davies [bit-booster.com] repo owner

    All commit messages have a trailing newline, and your regex hates that trailing newline. Simply adding "\s*" outside your right-most parentheses should probably fix things.

    Or you could add ".*" to the end of your regex. That would probably also fix things, assuming you don't mind if commit messages include trailing text. Like so:

    (^DEFECT_ID\s:(\sFI-[0-9]+)+).*

    Note: the regex is applied against the entire commit message. The entire message must match.

  3. Julius Davies [bit-booster.com] repo owner

    Marking this bug INVALID - I believe Control-Freak is behaving correctly. The regex is tripping up because all commit-messages end in a newline.

    But please don't hesitate to reopen this ticket if you disagree.

  4. Ashok G reporter

    remote: Control Freak remote: ----- remote: Commit c94eb43a4d3517d6 rejected. remote: remote: Commit messages must satisfy the configured regex. remote: Failed Regex: ((DEFECT_ID\s:(\sFI-[0-9]+)+).) remote: ----- remote: remote: Control Freak remote: ----- remote: Commit c94eb43a4d3517d6 rejected. remote: remote: Commit messages must satisfy the configured regex. remote: Failed Regex: ((DEFECT_ID\s:(\sFI-[0-9]+)+)\s) remote: ----- remote:

    Regex : (DEFECT_ID\s:(\sFI-[0-9]+)+)\s , Regex : (DEFECT_ID\s:(\sFI-[0-9]+)+).

    Input : DEFECT_ID : FI-12345

    Please help me to fix this .

  5. Ashok G reporter

    Its working now , thanks for the support --> "\n" is the crack here

    worked one : [ .\nDEFECT_ID\s:\s(FI-[0-9]+\s)+([\n\t]+).*]

  6. Log in to comment