cdevents / spec

A common specification for Continuous Delivery events
Apache License 2.0
133 stars 23 forks source link

Branch info in change events #149

Open xibz opened 1 year ago

xibz commented 1 year ago

Currently, there's no metadata around branches, without needing to first consume the event, pull out the URL, fetch the information, and then retrieve all that information.

I propose adding a new branch object field in at least the created change event, but could be argued that it should be in every change event.

"branch": {
    "from": "my-fork-branch", # this may need to also support which fork it's coming from, but we can expand on this concept first
    "to": "main"
}

This would include the branch object with two fields: from and to. The idea would be that from is where the change is coming from, and to is where the change is attempting to be merged. From the comment I mentioned we may need to include fork information or something of that nature, but I think starting simple and expanding once we agree on the from and to names and semantics, we can address the fork specification.

I also noticed that id had some examples of featureBranch1234 as the id, but I think we may be overloading the id in this case and it might not be clear, semantically, on what that should be. Instead, by having the branch object, it becomes very clear on what it is and its purpose