Groovy plugin revision number for copied configurations

this thread is rather old, but I have an  issue with the groovy plugin solution: It works correctly in many cases and defines a  nice revision number of the latest change of the codeline.
But in some case this fails: If a build  configuration is copied and/or its vcsRoot (URL) is changed, the vcs changes are  empty till a TeamCity restart or a first checkin in this codeline.
Is there a change for a workaround? Or is  there a change to got the desired revision number as a "normal" TeamCity  feature?
Regards,
Alex
3 comments
Comment actions Permalink

Alex,

I branched your post from original thread seems it seems to cover more specific topic.

> But in some case this fails: If a build  configuration is copied and/or its vcsRoot (URL) is changed, the vcs changes are  empty till a TeamCity restart or a first checkin in this codeline.

Suppose the VCS root URL is changed, what revision would you need then? Revision of the last change included into the build? But generally, it's revision may be invalid in the repository pointed to by the new URL.

One more issue: if there is no last change in the build configuraiton (e.g. the build configuraiton is just created), what revision do you need? The current revision of the repository?


> Or is  there a change to got the desired revision number as a "normal" TeamCity  feature?

This should be done in the scope of TW-4527 : build.vcs.number.* properties should probably denote "last affected" revision instead of "current repository revision".

0
Comment actions Permalink

Our copying use case is the following: A project team is working on project branch branchA and in TC we have a build project projectA with several build configurations working on a vcsRoot with the URL of branch branchA . Now they create a new project branch branchB from the TRUNK --- and the TC build project projectB created by copying projectA. This copies the vcsRoot for A, too, which is changed to the URL of branchB. At this point in time there are already some commits in the new project branch branchB.

I expect the following behavior:
After this copy operation I expect that in GroovyPropertyProvider.groovy and GroovyReferencePropertiesProvider.groovy the call

   dataProviders.getLastModificationsRevisions(build)

returns the list of changes in branchB.


--a.

0
Comment actions Permalink

Alex,

This seems like a TeamCity limitation/as designed behavior: TeamCity monitors only the branches that are used in the builds, so it does not "know" there are changes in the repository belonging to the branch that was just created to be monitored in TeamCity. Seems, that the most we can do is to return current repository revision, but I am not sure this is an appropriate solution.

Even more, TeamCity relates changes to a build configuraiton only after the VCS root is attached, so previous changes are not displayed in UI. Here is an issue on that.

BTW, for your case, there is a related feature request to preserve build history on project copy.

0

Please sign in to leave a comment.