PR-Booster/Control Freak Ignore clean rebases and cherry-picks of previously verified commits no longer works

Issue #267 open
Przemyslaw Kalucki created an issue

After upgrade to Bitbucket 8.6.1, PR-Booster 2023.01.18 and Control Freak Hook for Bitbucket Data Center 2023.01.03, option “Ignore clean rebases and cherry-picks of previously verified commits" no longer works.

Comments (12)

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

    I just tried to reproduce this (Control-Freak 2023.01.03, Jira 9.6.0, Bitbucket 8.8.0) and it’s working fine in my test.

    Are you sure the rebase was clean ?

    Also, cherry pick’s MUST include the “(cherry picked from commit f17fa493f23bdb681b3ddf104fb30472030fa8b4)” bit in their commit message for this feature to work (equivalent to running 'git cherry-pick -x”). (Rebases don’t require this).

  2. Paul Wagland

    Hi Julius,

    So doing purely the rebase does work, what fails is the rebase while merging.

    That is, when we get the above error message, then if we “rebase” from the UI, using “rebase” button from PR-Booster, then it the rebase works, and after that we can merge. But it fails if we attempt to use the “rebase and merge” merge strategy.

    Cheers,
    Paul

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

    Fixed in v2023.04.05 of Control Freak

    The fix assumes "[x] - Ignore merge commits" is checked, although if it's NOT checked the "rebase-and-fast-forward" option now works.

    Thanks for your bug report and for your patience.

  4. Przemyslaw Kalucki Account Deactivated reporter
    • changed status to open

    The issue still occurs in Control Freak Version: 2023.04.05

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

    Are you sure ?

    Testing this just now:

    • Control Freak 2023.04.05
    • Bitbucket 8.6.1

    • Two commits on “feature” branch. Both reference “Done” Jira tickets.

    • Config unset: [ ] - Ignore clean rebases and cherry-picks of previously verified commits
    • I click “Rebase and Merge”. Merge fails like how you reported:

    There is 1 issue preventing this action.

    Some referenced JIRA tickets failed the JQL validation check. JQL: "(status not in (Done))" Failing JIRA tickets: [TKT-10]. Either remove references to those tickets from your commit messages, or adjust the tickets in JIRA so they satisfy the JQL validation.

    Then I set:

    • [X] - Ignore clean rebases and cherry-picks of previously verified commits
    • “Rebase and Merge” now works.

    Can you include more information to help me reproduce this please !

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

    p.s. Is there any chance the PR where you’re seeing this problem spans a fork ? (e.g., two distinct repositories instead of just two branches within the same repository)

  7. Przemyslaw Kalucki Account Deactivated reporter

    My settings:

    It is a single repository, it does not span a fork.

    When using both Rebase and Rebase and Merge it fails

    {
      "readyState": 4,
      "responseText": "{\"errors\":[{\"context\":null,\"message\":\"The rebase completed without conflicts, but updating 'feature/xxx' was canceled by a plugin.\",\"exceptionName\":\"com.atlassian.bitbucket.hook.repository.RepositoryHookVetoedException\",\"details\":[\"\\nControl Freak v2023.04.05: Push rejected. Commits on \\\"feature/xxx\\\" must satisfy Control-Freak JIRA policy.\\n-----\\nPush rejected. Commits on \\\"feature/xxx\\\" must satisfy Control-Freak JIRA policy.\\n\\nSome referenced JIRA tickets failed the JQL validation check.\\n\\nJQL:   \\\"(status not in (Cancelled,Merged,Verified,Backlog,New) and sprint is not EMPTY and sprint in openSprints() or project in (REL,QAT))\\\"\\n\\nFailing JIRA tickets:\\n\\n  [ROSO-11366]. \\n\\nEither remove references to those tickets from your commit messages,\\nor adjust the tickets in JIRA so they satisfy the JQL validation.\\n-----\\n\"],\"trigger\":{\"id\":\"git-rebase\",\"abortOnFirstVeto\":true}}]}",
      "responseJSON": {
        "errors": [
          {
            "context": null,
            "message": "The rebase completed without conflicts, but updating 'feature/xxx' was canceled by a plugin.",
            "exceptionName": "com.atlassian.bitbucket.hook.repository.RepositoryHookVetoedException",
            "details": [
              "\nControl Freak v2023.04.05: Push rejected. Commits on \"feature/xxx\" must satisfy Control-Freak JIRA policy.\n-----\nPush rejected. Commits on \"feature/xxx\" must satisfy Control-Freak JIRA policy.\n\nSome referenced JIRA tickets failed the JQL validation check.\n\nJQL:   \"(status not in (Cancelled,Merged,Verified,Backlog,New) and sprint is not EMPTY and sprint in openSprints() or project in (REL,QAT))\"\n\nFailing JIRA tickets:\n\n  [ROSO-11366]. \n\nEither remove references to those tickets from your commit messages,\nor adjust the tickets in JIRA so they satisfy the JQL validation.\n-----\n"
            ],
            "trigger": {
              "id": "git-rebase",
              "abortOnFirstVeto": true
            }
          }
        ]
      },
      "status": 400,
      "statusText": "Bad Request"
    }
    

  8. Przemyslaw Kalucki Account Deactivated reporter

    How is the “no-change” detected? As far as I understand, this is based on the `git patch-id` matching on both the old and new commits, right? If so, would it be possible to add something like this to the error message, as I think that would help developers to diagnose the issue, since sometimes even a clean rebase can result in a different patch-id.

  9. Paul Wagland

    Isn’t the fix for this already released in Version 2023.04.05?

    From those release notes:

    One bugfix:
    * The "rebase-and-merge" / "rebase-and-fast-forward" merge options are not respecting the "Ignore Clean Rebases" check under Jira Policy. Fixed ! Thanks to PW for reporting this (issue #267).

  10. Log in to comment