Delayed commit builds with "old" code

I'm running TeamCity Version 1.2 (build 1771) and IDEA 6.0.2 Build 6107.
The problem is that the build agents doesn't build the lastest code - ie. the code that I'm about to commit (but hasn't been commited yet).

These are my steps:

  • Using the Perforce VCS plugin I open a file for edit.

  • I make changes in it that are intended to break the build.

  • I click Ctrl-k and then push the Remote Run button, and check "Commit if successful" and "with confirmation". And finally click "OK".


The build starts as a "Personal build" but doesn't fail. It tells me that the build was successful and asks me to commit.

So, it's like my code is never transferred to TeamCity.

/jonathan

13 comments
Comment actions Permalink

Hello Jonatan,

Thank you for the report. The problem will be fixed ASAP.

You can watch current state of the issue at http://jetbrains.net/jira/browse/TW-1358

--
Best regards,

Yegor Yarko
Quality Assurance Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

So you belive this is a bug?
I was hoping I was doing something wrong :(

I had the same problem with an earlier build of TC (1.1) so I assume it's a problem in the IDEA Plugin and not in TC. But if it was a bug in the plugin, I'm surprised TC doesn't complain.

Would you recomend me to try an earlier build of the plugin?

/jonathan

0
Comment actions Permalink

Jonathan,

This is indeed a problem with build 1771 that reproduces when Perforce VCS is used. As far as I know SVN is not affected.

IDEA plugin version should correspond to that of the TeamCity server, so I am afraid you cannot use older plugin with newer server.

I hope the fix for the issue will be available next week.

--
Best regards,

Yegor Yarko
Quality Assurance Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Hello Jonatan,

We've made more investigation - I suppose this bug can be workarounded.
The issue is that for remote run to work, you should configure TeamCity project in a way
when relative paths in your IDEA project match paths in TeamCity project.

Imagine you have in P4 server:

//depot/projectDir/project.ipr
//depot/projectDir/src/file.java

If your project content root in IDEA is //depot/projectDir/ you should use the following custom
mapping for p4 in TeamCity:

//depot/projectDir/... //team-city-agent/...

I believe this should resolve your problem with remote run.

Kind regards,
KIR

Jonatan Voxendal wrote:

So you belive this is a bug?
I was hoping I was doing something wrong :(

I had the same problem with an earlier build of TC (1.1) so I assume it's a problem in the IDEA Plugin and not in TC. But if it was a bug in the plugin, I'm surprised TC doesn't complain.

Would you recomend me to try an earlier build of the plugin?

/jonathan



--
Kirill Maximov
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Kirill Maximov (JetBrains) wrote:

We've made more investigation - I suppose this bug can be workarounded.
The issue is that for remote run to work, you should configure
TeamCity project in a way
when relative paths in your IDEA project match paths in TeamCity project.


Is this the same problem as http://www.jetbrains.net/jira/browse/TW-626 ? Although I do
know about the pitfalls of the local checkout path now, I still think this is kind of a
show-stopper if the general design allows a personal build to build something else than
what was requested.

Sascha

0
Comment actions Permalink

Sascha Weinreuter wrote:

Kirill Maximov (JetBrains) wrote:

>> We've made more investigation - I suppose this bug can be workarounded.
>> The issue is that for remote run to work, you should configure
>> TeamCity project in a way
>> when relative paths in your IDEA project match paths in TeamCity
>> project.


Is this the same problem as http://www.jetbrains.net/jira/browse/TW-626


Yes, this is the same problem. We discussed the issue - it can be fixed
for some cases, but this may require to extend IDEA's VCS OpenAPI.

Kind regards,
KIR


--
Kirill Maximov
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Kirill, thanks for your answer. I've tried to do what you told me to but still can't get it working.

This is the directory structure on my development machine on which I run IDEA.

-



    [platform]
        [administration]
            [src]
            Admin.iml
            build.xml
        [theme]
            [src]
            Theme.iml
            build.xml
    [statistics]
        [import]
            [src]
            Import.iml
            build.xml
        [report]
            [src]
            Report.iml
            build.xml
    xxxx-Platform-Head.ipr
    build.xml
-



The directory structure in Perforce is the same:

//software/main/src/java/xxxxx_Platform/head/
    [platform]
        [administration]
        [theme]
    [statistics]
        [import]
        [report]

(except is does not contain my xxxxx-Platform-Head.ipr or *.iml's)

As you can see, my project contains multiple modules. (administration, theme, import, report)

My TeamCity project is setup like this:
Perforce Settings
Client mapping: //software/main/src/java/xxxxx_Platform/head/... //team-city-agent/...

I have one Build Configuration per module and one for the "common" build.xml (//software/main/src/java/xxxxx_Platform/head/build.xml)
For the import module, I have a Build Configuration called 'Import'
The 'Path to a build.xml file" is set to "statistics/import/build.xml". Ie, it's relative to the projects root (//software/main/src/java/xxxxx_Platform/head/)

I checkout a file from Perforce using IDEA's Perforce plugin, make a change in it that should fail to compile, press Ctrl-k, click in Remote Run,
select the Import Teamcity module, and click "OK". A Personal build starts but succeedes.

As far as I can see, the projects directory structure matches the perfroce- and the teamcity structure.

Do you see anything wrong with this configuration?

Regards
Jonathan

0
Comment actions Permalink

Hello Jonatan,

I took a look at our code - in order for delayed commit to work, you have to have a module with content root pointing to xxxx_Platform/head directory. As I understand, you don't have such a module by the moment. We'll fix the problem before TeamCity 1.2 is out.

Hope this helps,
KIR

--
Kirill Maximov
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Ok, thanks for your help. I will keep an eye on the EAPs.

/jonathan

0
Comment actions Permalink

Hi Jonatan,

Please add property agent.save.patch=true to the configuration
(Administration->Edit configuration->Properties and requirement
variables->Add new property...) and try personal build again.

Agent log will contain line "Patch is saved to file ${file.name}"
Please add yourself to watchers of the request
http://www.jetbrains.net/jira/browse/TW-1411 and attach the file there

(it contains changed file sources so please choose some unimportant file).



Thanks!

--
Olesya Smirnova
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


"Jonatan Voxendal" <no_reply@jetbrains.com> wrote in message
news:11201970.1167813881073.JavaMail.itn@is.intellij.net...

Kirill, thanks for your answer. I've tried to do what you told me to but
still can't get it working.

>

This is the directory structure on my development machine on which I run
IDEA.

>

-----------------------------------------------------

    [platform]
        [administration]
            [src]
            Admin.iml
            build.xml
        [theme]
            [src]
            Theme.iml
            build.xml
    [statistics]
        [import]
            [src]
            Import.iml
            build.xml
        [report]
            [src]
            Report.iml
            build.xml
    xxxx-Platform-Head.ipr
    build.xml
-----------------------------------------------------

>

The directory structure in Perforce is the same:

>

//software/main/src/java/xxxxx_Platform/head/
    [platform]
        [administration]
        [theme]
    [statistics]
        [import]
        [report]

>

(except is does not contain my xxxxx-Platform-Head.ipr or *.iml's)

>

As you can see, my project contains multiple modules. (administration,
theme, import, report)

>

My TeamCity project is setup like this:
Perforce Settings
Client mapping: //software/main/src/java/xxxxx_Platform/head/...
//team-city-agent/...

>

I have one Build Configuration per module and one for the "common"
build.xml (//software/main/src/java/xxxxx_Platform/head/build.xml)
For the import module, I have a Build Configuration called 'Import'
The 'Path to a build.xml file" is set to "statistics/import/build.xml".
Ie, it's relative to the projects root
(//software/main/src/java/xxxxx_Platform/head/)

>

I checkout a file from Perforce using IDEA's Perforce plugin, make a
change in it that should fail to compile, press Ctrl-k, click in Remote
Run,
select the Import Teamcity module, and click "OK". A Personal build starts
but succeedes.

>

As far as I can see, the projects directory structure matches the
perfroce- and the teamcity structure.

>

Do you see anything wrong with this configuration?

>

Regards
Jonathan



0
Comment actions Permalink

This is what I got in the agent log now:

INFO - rver.agent.impl.BuildAgentImpl - Applying patch...
INFO - rver.agent.impl.BuildAgentImpl - Requesting patch from server, cleanPatch=false
INFO - Server.vcs.patches.PatcherImpl - Clearing working directory /usr/local/TeamCity/buildAgent/work/Q-MATIC_Platform

INFO - rver.agent.impl.BuildAgentImpl - Patch is saved to file /tmp/temp58961patch127
INFO - rver.agent.impl.BuildAgentImpl - Patch applied in 27 seconds
INFO - rver.agent.impl.BuildAgentImpl - Run actual runner for build 127
INFO - er.agent.runner.PropertyFinder - Took value for target.jdk.home from env.JAVA_HOME, value: /usr/local/java/jdk1.
5.0_10/


I guess this is the line you were asking for:

INFO - rver.agent.impl.BuildAgentImpl - Patch is saved to file /tmp/temp58961patch127

0
Comment actions Permalink

I missed the last line in your post.
So the patch file will contain the changes I made? It seems that it contains a little but more than that since the file is 111.9 MB

0
Comment actions Permalink

It seems the agent did not contain previous version or you're using clean
build option...
BTW, patch file has to be saved by IDEA.
${idea.system.directory}/buildServer contains several files with personal
changes. Could you attach the last one?
Thanks!

--
Olesya Smirnova
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


"Jonatan Voxendal" <no_reply@jetbrains.com> wrote in message
news:18183468.1168419536431.JavaMail.itn@is.intellij.net...
>I missed the last line in your post.

So the patch file will contain the changes I made? It seems that it
contains a little but more than that since the file is 111.9 MB



0

Please sign in to leave a comment.