Issue Details (XML | Word | Printable)

Key: HUDSON-4184
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: redsolo
Reporter: kendoran
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Hudson

TFS plugin does not always detecting changes

Created: 10/Aug/09 01:00 AM   Updated: 11/Aug/09 04:44 PM   Resolved: 10/Aug/09 11:54 PM
Component/s: tfs
Affects Version/s: current
Fix Version/s: None

Environment: Platform: All, OS: All


 Description  « Hide

Original forum post:
http://www.nabble.com/Redsolo-TFS-plugin%2C-not-always-detecting-changes-td24894559.html

Erik Ramfelt suggested I file a bug on this issue.

Running Windows Server 2003, latest Hudson TFS plugin

I have been setting up Hudson as a build server over the last few days and I am
incredibly impressed of how slick it is compared to CruiseControl.net, however I
have been unable to reliably get builds via "poll scm" where the SCM is TFS.

Polling happens on schedule, however no changes are detected (even when edit,
add, remove etc appear under the "Items" heading)

Building happens reliably if I set up periodic builds, or if I manually trigger
the build.

I have seen builds sometimes happen after a check-in, then no builds happening
on subsequent checkins.

I had the polling time initially set to five minutes, however set it to one
minute for trying to find a resolution.

The quiet period is currently set to 0, however I have also tested it with
non-zero values.

Matt.

Last Team Foundation Server Polling Log

Started on 10/08/2009 5:19:00 PM
[LD.Tracker] $ "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\tf.exe"
history $/LD.Tracker -noprompt
-version2009-08-10T05:11:00Z~D2009-08-10T05:19:00Z -recursive -format:detailed
-server:http://tfshost:8080 ********
-------------------------------------------------------------------------------
Changeset: 5516
User: Lo
Date: Monday, 10 August 2009 5:17:36 p.m.

Comment:

Items:
edit $/LD.Tracker/Common/LD.Tracker.Core/Entities/TrackerType.cs

Check-in Notes:
Code Reviewer:
Performance Reviewer:
Security Reviewer:

Done. Took 16 sec
No changes



Sort Order: Ascending order - Click to sort in descending order
redsolo added a comment - 10/Aug/09 04:21 AM

There is something strange with the output, as it says the job was started 5:19
PM, and the TFS polling requests information between 05:11:00Z~05:19:00Z (I think
this param should be GMT), and still it returns a tfs entry of "5:17:36 p.m."

What time zone are you located in? Any idea why it would show as 5 in the morning
when the build was made at 5 in the evening?


kendoran added a comment - 10/Aug/09 04:29 AM

Hi Redsolo, thanks for quick the response. I really appreciate your work on the
TFS plugin for Hudson.

I'm in New Zealand, we're GMT+12 here. That should explain TFS polling at 5am
GMT and 5pm NZ time.


redsolo added a comment - 10/Aug/09 05:24 AM

What locale are you running Hudson as? Im trying to reproduce the issue with the
same environment as you are having. Lang=english (en) and country=new zealand
(NZ), correct?


kendoran added a comment - 10/Aug/09 05:27 AM

Yeah that sounds right. I'll double check the configuration on the server when I
get to work in the morning (just after midnight here) and get back to you.


redsolo added a comment - 10/Aug/09 11:32 AM

Please check these in the /systemInfo page

user.country
user.language
user.timezone


kendoran added a comment - 10/Aug/09 02:24 PM

user.country NZ
user.language en
user.timezone Pacific/Auckland

user.variant
user.name SYSTEM
file.encoding Cp1252
java.runtime.version 1.6.0_14-b08
java.specification.name Java Platform API Specification
java.specification.vendor Sun Microsystems Inc.
java.specification.version 1.6
java.version 1.6.0_14
java.vm.specification.version 1.0
java.vm.vendor Sun Microsystems Inc.
java.vm.version 14.0-b16
line.separator
os.arch x86
os.name Windows 2003
os.version 5.2
path.separator ;
sun.arch.data.model 32
sun.cpu.endian little
sun.cpu.isalist pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86
sun.desktop windows
sun.io.unicode.encoding UnicodeLittle
sun.java.launcher SUN_STANDARD
sun.jnu.encoding Cp1252
sun.management.compiler HotSpot Client Compiler
sun.os.patch.level Service Pack 1


kendoran added a comment - 10/Aug/09 04:00 PM

On the build server (which my team maintains), culture info is set to NZ. On the
source control server (which my team does not maintain), the culture info was
set to US. I arranged to have the culture on the build server set to NZ, and the
plugin initiated a build immediately afterward, however there have been no
automatic builds since.

Culture and time zone details now match between build server and TFS server.

TFS log is attached for reference.

Started on 11/08/2009 10:54:00 AM
[LD.Tracker] $ "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\tf.exe"
history $/LD.Tracker -noprompt
-version2009-08-10T22:04:03Z~D2009-08-10T22:54:00Z -recursive -format:detailed
-server:http://tfshost:8080 ********
-------------------------------------------------------------------------------
Changeset: 5525
User: Lo
Date: Tuesday, 11 August 2009 10:48:50 a.m.

Comment:

Items:
edit $/LD.Tracker/Common/LD.Tracker.Core.Tests/DataAccess/TestDataGenerator.cs
edit
$/LD.Tracker/Common/LD.Tracker.Core/DataAccess/PersistenceServiceResponseTracker.cs
add $/LD.Tracker/Common/LD.Tracker.Core/Entities/Affects.cs
edit $/LD.Tracker/Common/LD.Tracker.Core/Entities/Response.cs
edit $/LD.Tracker/Common/LD.Tracker.Core/LD.Tracker.Core.csproj

Check-in Notes:
Code Reviewer:
Performance Reviewer:
Security Reviewer:

-------------------------------------------------------------------------------
Changeset: 5524
User: Lo
Date: Tuesday, 11 August 2009 10:30:35 a.m.

Comment:

Items:
edit $/LD.Tracker/Common/LD.Tracker.Core/Entities/Response.cs
edit $/LD.Tracker/Common/LD.Tracker.Core/Entities/ResponseStatus.cs

Check-in Notes:
Code Reviewer:
Performance Reviewer:
Security Reviewer:

-------------------------------------------------------------------------------
Changeset: 5523
User: Lo
Date: Tuesday, 11 August 2009 10:20:33 a.m.

Comment:

Items:
edit $/LD.Tracker/Common/LD.Tracker.Core.Tests/DataAccess/TestDataGenerator.cs
edit $/LD.Tracker/Common/LD.Tracker.Core/Entities/Response.cs

Check-in Notes:
Code Reviewer:
Performance Reviewer:
Security Reviewer:

Done. Took 16 sec
No changes


redsolo added a comment - 10/Aug/09 04:07 PM

That is very interesting, and i must say this date parsing is not easy doing.

But when you say "however there have been no automatic builds since."
Do you mean that you are still seeing the problem, or just that nobody has
commited anything yet?


kendoran added a comment - 10/Aug/09 04:44 PM

I'm still seeing the problem. The only automatic build was immediately after the
culture was changed on the TFS server. (in NZ, date format is DD/MM/YYYY)

There have been commits, just the build was not triggered by the plugin.

Just out of curiosity, does it pick up changes via parsing lines such as:

Items:
edit $/LD.Tracker/Common/LD.Tracker.Core/Entities/TrackerType.cs

?

When the prompt at the end of the TFS polling log says "No changes" does that
mean that the text parser did not find the edit/add/remove lines?


redsolo added a comment - 10/Aug/09 09:28 PM

After i have been going through the various date formats for the en_NZ locale, i
can not find any one that looks like the date format outputed by TF.

As you can see below, the "p.m." is not supported by the default date formats
and there is no time zone abbreviation in that TF string. The plugin then parsed
the date incorrectly, and that date was not within the time span specified when
getting the history (polling), ie between 5:11pm and 5:19pm . Therefore, the
change set was not accepted as a change. The TFS plugin has an ugly hack beacuse
the TF command line tool itself may return change sets outside the time span,
which may spawn unnecessary builds.

If I replace "a.m." and "p.m.", and uses the Data.parse() method which is much
more lenient parsing method than the default date formatters, it looks like this
issue can be solved. It seems that no date format supports "a.m" or "p.m.", it
should either be "AM" or "am".

I will do some more tests for this, but this should be solved very soon.

Note for later, these are the DateFormat variants that exists for en_NZ:
Monday, 10 August 2009 05:17:36 PM NZST
Monday, 10 August 2009 17:17:36
Monday, 10 August 2009 17:17:36
Monday, 10 August 2009 17:17
10 August 2009 05:17:36 PM NZST
10 August 2009 17:17:36
10 August 2009 17:17:36
10 August 2009 17:17
10/08/2009 05:17:36 PM NZST
10/08/2009 17:17:36
10/08/2009 17:17:36
10/08/2009 17:17
10/08/09 05:17:36 PM NZST
10/08/09 17:17:36
10/08/09 17:17:36
10/08/09 17:17


scm_issue_link added a comment - 10/Aug/09 11:54 PM

Code changed in hudson
User: : redsolo
Path:
trunk/hudson/plugins/tfs/src/main/java/hudson/plugins/tfs/commands/DetailedHistoryCommand.java
trunk/hudson/plugins/tfs/src/main/java/hudson/plugins/tfs/util/DateParser.java
trunk/hudson/plugins/tfs/src/main/java/hudson/plugins/tfs/util/DateUtil.java
trunk/hudson/plugins/tfs/src/test/java/hudson/plugins/tfs/Util.java
trunk/hudson/plugins/tfs/src/test/java/hudson/plugins/tfs/commands/DetailedHistoryCommandTest.java
trunk/hudson/plugins/tfs/src/test/resources/hudson/plugins/tfs/commands/issue-4184.txt
http://fisheye4.cenqua.com/changelog/hudson/?cs=20616
Log:
[FIXED HUDSON-4184] - Updated parsing of dates, replacing "a.m." and "p.m." with "am" and "pm".


redsolo added a comment - 11/Aug/09 01:45 AM

If you want to try the latest snapshot with the fix, you can get it at http://hudson.ramfelt.se/job/Hudson%20plugin%20Team%20Foundation%20Server/lastSucc
essfulBuild/


kendoran added a comment - 11/Aug/09 02:27 AM

Thanks very much, I'll try it first thing in the morning and let you know how it
goes.


kendoran added a comment - 11/Aug/09 04:44 PM

It's working well. I really appreciate the work you've done on this. Thanks again!