The Build Dashboard Current Activity widget truncates the master plan name in branch build entries when the plan name contains " - "

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Low
    • 13.0.0
    • Affects Version/s: 8.0.0, 9.0.0, 10.0.0, 11.0.0, 12.0.0, 12.1.7
    • Component/s: Dashboard
    • None
    • 1
    • Severity 3 - Minor
    • 1

      Issue Summary

      The Build Dashboard Current Activity widget (URL: <BAMBOO_BASE_URL/currentActivity.action) truncates the master plan name in branch build entries when the plan name contains a space-dash-space sequence (" - ").

      Steps to Reproduce

      1. Create a plan whose master plan name contains a space-dash-space sequence (" - ").
        For example: "CI - Plan1"
      2. Create a branch plan off the master plan
      3. Trigger a build on the branch plan
      4. Navigate to the Build Dashboard (Current Activity) - from the menu, access: "Build > Build activity" or access <BAMBOO_BASE_URL>/currentActivity.action
      5. Check the entries in the dashboard.

      Expected Results

      The breadcrumb displays the full plan name.

      Sample expected result: "Project 1 > CI - Plan 1 > branch_name"

      Actual Results

      The plan names for branch build entries are truncated after the first " - "

      Sample actual result:

      • The entry just shows "Project 1 > CI > branch_name".
      • The "- Plan 1" part of the plan name is dropped.

      Impact: If there are multiple plans that have the same prefix (e.g. "CI - Plan 1", "CI - Plan 2", "CI - Plan 3", etc), users will not be able to distinguish between them from the build dashboard entries.

      Workarounds

      Replace " - " in plan names

      Replace the space-dash-space (" - ") in master plan names, (e.g. use a single "-" character).

      Use a Byteman script

      If " - " is still preferred to be used in master plan names, an alternative workaround is to use the following Byteman script:

      # --- Set trace : boolean = true to see the logs in catalina.out
      RULE Fix Build Dashboard master plan name truncation
      CLASS com.atlassian.bamboo.ww2.actions.build.BuildQueueItemViewForJsonDecorator
      METHOD getPlanName
      HELPER org.jboss.byteman.rule.helper.Helper
      NOCOMPILE
      AT EXIT
      BIND
        fullName   : String  = $!;
        project    : String  = $0.getProjectName();
        branch     : String  = $0.getChainName();
        branchFlag : boolean = $0.isBranch();
        nbsp       : String  = Character.toString(160);
        sep        : String  = nbsp + "-" + nbsp;
        trace      : boolean = false
      IF fullName != null && branchFlag && project != null && branch != null && fullName.length() >
      project.length() + branch.length() + 6 && fullName.substring(project.length() + 3, fullName.length()
      - branch.length() - 3).contains(" - ")
      DO
        $! = "x - " + fullName.substring(project.length() + 3, fullName.length() - branch.length() -
      3).replace(" - ", sep);
        trace = trace && traceln("[BYTEMAN] Fixed dashboard planName: " + $!)
      ENDRULE
      

      See How to enable Byteman in Bamboo for details on enabling and loading Byteman scripts.

              Assignee:
              Mateusz Szmal
              Reporter:
              JP Mariano
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: