Associated Branch "Create" button not visible for certain projects #2866
Zak Siddiqui opened 1 day ago

Description:

There appears to be a regression where the Create button under the Associated Branch label is not visible in certain projects. I suspect this primarily affects older projects, though I cannot confirm this with certainty.

As you may know, the ability to create a branch directly from an issue is a recently added feature. It presents a Create button under the Associated Branch section of an issue. However, in some projects, this section and its corresponding button are entirely missing, and I have been unable to identify a consistent pattern as to why.

Workaround:

  1. Create a new root project.
  2. Move the affected project inside the new root project.
  3. The Associated Branch section and Create button become visible and functional after the move.

image.png

Request for Permanent Fix:

While the workaround is functional, it is cumbersome and not practical as a long-term solution, especially for instances with many affected projects. Could you please investigate the root cause of this regression and implement a permanent fix so that the Associated Branch feature is consistently available across all projects without requiring structural changes?

  • Chief Work Horse commented 1 day ago

    @zaakiy you are not entitled to interact with me

  • Zak Siddiqui removed comment 1 day ago
  • Robin Shen commented 1 day ago

    @wh investigate why this happens

  • Work Horse commented 1 day ago

    @zaakiy Investigated why Associated Branch / Create can be missing.

    The side panel only shows that section when the current user can read code and either an associated branch already exists, or the user is allowed to create one (IssueSidePanel.newBranchContainer). Creation is allowed only if the user can write code and branch protection does not prevent creation of the prospective branch name issue-<number> (or <prefix>/issue-<number> when an issue branch prefix is set).

    BranchProtection.preventCreation defaults to true, so any enabled protection rule whose branch pattern matches that name (commonly a catch-all like *) hides the whole section—even if the rule was mainly intended to block force-push/deletion. Protections are inherited from parent projects via getHierarchyBranchProtections(), which fits the workaround: moving the project under a new root drops the old parent's protections, so Create becomes visible again.

    Please check an affected project (and its parent chain) under Settings → Code → Branch Protection for a rule matching issue-* / * with Prevent branch creation enabled. If present, either uncheck that option, narrow the pattern (e.g. main), or exclude issue branches (e.g. * -issue-*).

    Want to confirm whether that matches what you see before proposing any code change.

  • Zak Siddiqui commented 1 day ago

    @robin @wh I can confirm that there were no branch protection rules in place.

    In fact, I checked every single setting within the project and within its parent project to look for something like this. It's the first thing I checked, and I can confirm that there was no branch protection rule in place.

    Furthermore, this issue was not happening in a different project, and I compared the two projects to try to figure out what was different. Wherever I found even the most minute difference, I reset the settings of the "problem" project in question to be similar to the other "good" project in which I was able to create branches using this button. It still did not work.

    It is entirely baffling to me, which is why I call it a regression.

  • Work Horse commented 1 day ago

    @zaakiy you are not entitled to interact with me

  • Robin Shen commented 1 day ago

    @zaakiy have you checked branch protections of all parents to the root? Also make sure that you have write code permission over the project.

  • Davide Beatrici commented 19 hours ago

    @robin I apologize for hijacking this issue, but I'm unable to open a new one:

    Even changing the type alone from "Question" to "Bug" causes it.

  • Robin Shen commented 16 hours ago
  • Zak Siddiqui commented 11 hours ago

    @robin yes, I can confirm that I checked all branch protections of all parents to the root.

  • Robin Shen commented 11 hours ago

    I have no idea why this happens, as branch protection and write permission is the only gate. It might be helpful if you can attach a database reproducing the issue.

  • Zak Siddiqui commented 11 hours ago

    @robin Unfortunately, as part of testing the workaround, the original state is no longer available. Since this is a production server, I needed to also do some parent project hygiene to ensure that users did not face ambiguity in finding their projects within the project tree. Unfortunately, I am unable to reproduce this.

    Happy to close this in the meantime, and I hope that the record of this issue may assist in identifying the root cause if it happens again in the future to us, or if somebody else raises it again in the future.

  • Robin Shen commented 11 hours ago

    Closing now. Reopen if there is more clue.

  • Robin Shen changed state to 'Closed' 11 hours ago
    Previous Value Current Value
    Open
    Closed
  • Zak Siddiqui commented 7 hours ago

    @robin sorry for trying out Workhorse on this site. I was very curious.

  • Robin Shen commented 7 hours ago

    @zaakiy no problem at all. Just need to triage issues myself and assign to AI user as necessary.

1/1
Type
Bug
Priority
Normal
Assignee
Affected Versions
OneDev 16.2.0
Labels
No labels
Issue Votes (0)
Watchers (4)
Reference
OD-2866
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover