Search Unity

Unity's version control component has been upgraded to Plastic SCM.

Are there any scripting hooks for Collab?

Discussion in 'Unity Collaborate' started by cxode, May 4, 2018.

  1. cxode

    cxode

    Joined:
    Jun 7, 2017
    Posts:
    268
    Is there any way to run some code whenever an update is published, or to publish an update through code - so that I can run my other code while doing that?

    There's a little number in my game that corresponds to the Collab commit number of that particular build. I do this so that when a tester reports a bug it's easy for me to see exactly what has changed since the build they're using. Currently I'm keeping this number updated manually, but it would be really nice to have it done automatically.
     
  2. Gurg

    Gurg

    Unity Technologies

    Joined:
    Nov 9, 2016
    Posts:
    73
    There is sort of a hook system but it's probably not what you are expecting. There currently isn't a collab hooks API in the editor itself. That said, we do offer webhooks from server side. If you go to the developer dashboard at https://developer.cloud.unity3d.com you can find the integrations page at the bottom of the side nav.

    Snip20180507_2.png

    It currently supports a generic webhook as well as auto-posting to Slack, Discord, and JIRA* on a collab publish event.

    (* JIRA only gets auto-posted to if the issue key is mentioned in the commit message.)

    Technically these hooks could be used to write something that triggers an action or change on your behalf as a reaction to a commit publish. However, what that something is would need to be written by the game dev. We just provide the event notification with the barebones info about the published commit.

    A quick reminder based on your use case that you describe here, the commits are actually ID'd server side by a randomly generated UUID. The server does not track commits by the incremental commit number you see in the collab history window. So while you will get an ID that can be used to identify the exact commit your tester's build was based off of, it might not be what you expected.
     
    cxode likes this.
  3. cxode

    cxode

    Joined:
    Jun 7, 2017
    Posts:
    268
    @Gurg thanks so much for all the information! I may try my hand at making my own integration for this. If I do, I'll share it here.
     
    Ryan-Unity and Gurg like this.