Change in Changesets

Hi,

the notification template lists changesets included by the build. However the order of the changesets seems not to be sorted. At least it is different to the changes view of the build. My main concern though, is that it is not possible to recognize on which changeset the build actually was run. What i am looking for is $Source.MyRepo.BuiltChangeset.Id$

How can the template be configured to show the relevant changeset?

Thomas

The changesets are not explicitly sorted. We’ll change that for the next update.

Meanwhile you can sort them in the template as follows

{% assign sortedChangeSets = (Changesets | sort: "Created") -%}
{% for change in sortedChangeSets -%}
    {{change.RepositoryName}} / {{change.RepositoryChangeId}} / {{change.Created}} / {{change.Branch}} / {{change.RepositoryUserName}} / {{change.ToBuild}} / {{change.Comment}}
{% endfor -%}

We will also add a BuiltChangesets property (note that a build can include changesets from multiple repositories so this will need to be a collection). Meanwhile you can do this:

Built Changesets Revision: {% for change in Changesets -%} {% if change.ToBuild -%}{{change.RepositoryName}}: {{change.RepositoryChangeId}} {% endif -%}{% endfor -%}

Great.

…and this text is to make Discourse happy :slight_smile:

Yes i could use the “like” icon. However the icon is related to the complete post, whereas my answer is limited to a part only.

As i only want the one and only relevant changeset i did the following:

{% assign sortedChangeSets = (Changesets | sort: "Created") -%}
{% for change in sortedChangeSets reversed -%}
    {% if change.ToBuild -%}
        {{change.RepositoryChangeId}}
        {% break %}
    {% endif -%}
{% endfor -%}

I also applied this function to get the relevant branch name. I want exactly the same information that i get by these variables:
$Source.MyRepo.BuiltChangeset.Id$
$Source.MyRepo.BranchName$

1 Like

Build 205 now supports the “BuildChangesets”.

The properties are the same as with the regular “Changesets”, right?
However, i understand that “ToBuild” is always TRUE for BuildChangesets, right?
Are there any other differences?

Hi Thomas,

The BuiltChangesets is the list of Changesets filtered to those with the “Built” flag set to True. The ToBuild flag is actually used internally to signal which changesets to build. The Built flag marks which changeset is built.

There may be multiple ToBuild changesets per repository if, for example, a new changeset is detected while a build is waiting in a Quiet Period. There is only ever one Built changeset per repository.

Prior to version 1.9.0.205 the Built flag was not populated correctly, so I suggested using ToBuild in my previous post.

Each changeset in BuiltChangesets has the exact same properties as each changeset in Changesets, as shown in the Available Variables sidebar.