Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Official Cloud Mergebots now available for all

Discussion in 'Unity Version Control' started by vitor-unity, May 31, 2023.

  1. vitor-unity

    vitor-unity

    Unity Technologies

    Joined:
    Feb 13, 2023
    Posts:
    14
    We just released Mergebots to Unity DevOps. Previously only available to our on-prem customers, Mergebots are now available to everyone, including cloud users.

    Benefits of Mergebots

    Mergebots can check for conflicts to further automate your CI pipeline. They do this by checking for conflicts and automatically triggering merges once several qualifying conditions have been met.

    Set up requires a few clicks: Define triggers that monitor one or more branches, so that mergebots will scan and find merge conflicts before performing the merge. This process will keep your branches clean and enable easy connectivity with your preferred CI tool.
    1. Using mergebots makes merging faster, more transparent, and more secure.

    2. Mergebots remove repetitive and manual tasks that may slow down your programmers and artists in their day-to-day tasks.
    You can find the mergebots configuration wizard under the 'Settings' button of your repository, in the Unity Dashboard website.

    upload_2023-5-31_11-30-41.png

    Within this configuration menu, you can automate your merge workflow, enable notifications, and integrate with external CI tools.

    Before merging content in your cloud repository, mergebots reduce conflicts by checking if certain conditions are met:
    • Checking if a code review has been created and approved
    • Automatically detecting merge conflicts
    • Automatically re-enqueuing failed merge requests if these were due to new changesets found in the destination branch
    • Checking for individual status parameter attributes and values in order to be triggered and start the merge request automatically (Status, Resolved, Failed, Merge and Testing)

    upload_2023-5-31_11-30-41.png

    After the content has been merged, mergebots offer handy options:
    • Labeling the merged changeset with your preferred nomenclature
      (for example: LABEL.${AUTO_INCREMENT_NUMBER}_${BUILD_DATE_FORMATTED, yyyy-MM-dd} will create this label, after each successful merge request handled by mergebots: LABEL.128.2018-10-23)
    • Triggering a build automatically via the integration of popular third-party CI tools such as Jenkins, Team City, and Bamboo

    upload_2023-5-31_11-30-41.png

    Sample configuration

    Once you have configured them, you can trigger mergebots by creating a code review from the Branch menu of your repository, from the Unity DevOps Dashboard.

    upload_2023-5-31_11-30-41.png

    Finally, once all the conditions are satisfied (Approved Code Review, No merge conflicts, Correct destination branch, etc.), the mergebots will be triggered as soon as you set the Branch attribute to “Resolved” (or whatever value you entered in the configuration wizard).

    upload_2023-5-31_11-30-41.png

    Once the Merge Request has been finalized, your code review screen should look similar to this screenshot, with 2 color indicators showing its status (pending, failed, or successful).

    In the screenshot below, this is an example of how a conflict bot would look like.
    It checked whether your merge request created a conflict with the main branch, or if it did not.

    upload_2023-5-31_11-30-41.png

    Finally, you may see your mergebots current status and configuration in the Settings menu of your repository. You can edit or delete your configuration settings at any time.

    upload_2023-5-31_11-30-41.png

    Comment with feedback or questions


    Let us know if this suits your needs and how we could further improve the mergebot capabilities.
     
  2. GMG-Sam

    GMG-Sam

    Joined:
    Jan 19, 2023
    Posts:
    25
    @vitor-unity Hi, we're very excited to get this going. Are there any logs or anything we can use for troubleshooting? I am trying to work out why the merge bots aren't triggering when I expect them to be triggered. Thanks.
     
  3. Tracecat

    Tracecat

    Joined:
    Mar 20, 2014
    Posts:
    23
    @vitor-unity Is there a way to access the source code of these bots? There are some github projects like https://github.com/PlasticSCM/multiliner-mergebot but they don't seem to be very well maintained. It would be great to have access to the current sources of merge,conflict and multiliner bots and maybe some up to date guide how we setup our own custom bots by adapting the existing ones. Even if this only possible on on-premise servers due to security concerns. The bots are really great but some custom changes are often needed to fully integrate them into dev workflows.
     
  4. croquer

    croquer

    Unity Technologies

    Joined:
    Mar 15, 2021
    Posts:
    43
    @GMG-Sam I'm sorry, but everything is server side. But, please open a ticket with support using this form: https://support.unity.com/hc/en-us/requests/new?ticket_form_id=360001051792 and we will request your org details and what's going on so we can check the logs and determine if there's a problem.
     
    vitor-unity likes this.
  5. croquer

    croquer

    Unity Technologies

    Joined:
    Mar 15, 2021
    Posts:
    43
    Hey @Tracecat, that's right. For security reasons, custom mergebots are not available in the cloud offering. But they are for the on-prem solution.

    You have the trunkbot code as well online here: https://github.com/PlasticSCM/trunk-mergebot
    It's correct both of them haven't been updated in a while, but the core functionality still stands. That being said, feel free to contact me at manuel.lucio at unity3d dot com if you want more details or guidance.
     
    vitor-unity likes this.
  6. sr4mu

    sr4mu

    Joined:
    Jul 17, 2023
    Posts:
    2
    Hello,
    Coming from a more traditional CI/CD background, I have the opportunity to discover Plastic SCM during a (very) short work placement in an independent studio.
    The studio has modest financial means, the use of an integration server is not feasible, so I decided to try and implement one of the cloud mergebots as they are supposed to work with a cloud repository.

    In practice I find that the bot works erratically for similar situations, even in the very simple case like the change of a character in a string in a cs file.

    Sometimes the bot merges instantly, sometimes it takes 10 minutes and sometimes its status gets stuck on 'pending' in the branches details dropdown in the dashboard. In this case, editing the bot's config and saving systematically triggers a successful merge.

    Here is the bot config :

    Plastic SCM DevOps Portal.png

    The team is working with distributed repositories and i have the feeling that the problem comes from the reposirory attributes that don't sync. There's very little documentation about this : are they it even syncable, it seems so but only when retrieving repository data ? Sometimes there's several ' status ' entries in the Attributes section of the branches details dropdown on the dashboard.
     
  7. carlosalba1985

    carlosalba1985

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    799
    Hi, I'm afraid that the attributes are not syncable on demand. They will be synced only when you also synced some repository data. Please always use the attributed on the central repo (even if you are using a distributed workflow).
    After pushing your branch, set the attribute value.

    Please let us know if it helps.

    Regards,
    Carlos.
     
  8. sr4mu

    sr4mu

    Joined:
    Jul 17, 2023
    Posts:
    2
    Hi, sorry for the late response i had finished my work placement since then. That's what I thought, I would have liked the process to be the simpliest possible, so no switching between local and centralized repo. But that'll do I guess !
    Thanks again for taking the time to give me an input .