SRunningBuild.getCommitters with SelectPrevBuildPolicy.SINCE_LAST_BUILD returns empty set

I'm using the following code in a BuildServerAdapter:


UserSet<SUser> users = build.getCommitters(SelectPrevBuildPolicy.SINCE_LAST_BUILD);


It seems like this set is empty when it is a build started event when there are actually committers. Is this supposed to be? The expected set of users is returned for other build events, AFAICT. What I expect, is a set of users for the currently running build. The only other option is to use SelectPrevBuildPolicy.SINCE_LAST_SUCCESSFULLY_FINISHED_BUILD.

The full code can be viewed on GitHub, as well as some more issue details.

4 comments
Comment actions Permalink

Pieter,

The method returns committers only after build's changes are collected and only users with proper set VCS usernames can be returned.
You can ensure you call getCommitters on (or after) changesLoaded event.

> The only other option is to use SelectPrevBuildPolicy.SINCE_LAST_SUCCESSFULLY_FINISHED_BUILD.

This can include more changes, (and thus, more committers), but for hte changes displayed in the build SINCE_LAST_BUILD should work fine. Otherwise it would be a bug which we would need some steps to reprodcue to investiage.

0
Comment actions Permalink

Hi Yegor

I'll consider the changesLoaded event. Thanks for pointing that out.

Does the getCommitters only return users that are registered on a TeamCity server, or would it include unresolved VCS usernames too?

0
Comment actions Permalink

> Does the getCommitters only return users that are registered on a  TeamCity server, or would it include unresolved VCS usernames too?

It returns SUser objects, so only the registered users and only those with properly matching VCS usernames.

0

Please sign in to leave a comment.