Creating a WIT Adapter for the TFS Integration Platform for a source with no history
Join the DZone community and get the full member experience.
Join For Freealthough i have had my test track pro tip adapter working for quite some time, the customer came back and asked if they could have a rolling migration. i.e. shipping changes on a regular basis, but only the tip each time.
<?xml version="1.0" encoding="utf-16"?> <configuration xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema" uniqueid="add2d39c-c44a-4046-93ac-03a4970b2312" friendlyname="(3)northwest cadence test track pro to tfs"> <providers> <provider referencename="c0e63c2b-e06c-48bb-8698-243a82bb950e" friendlyname="testtrackpro tip adapter" /> <provider referencename="04201d39-6e47-416f-98b2-07f0013f8455" friendlyname="tfs 2010 migration wit provider" /> </providers> <addins> <addin referencename="cdde6b6b-72fc-43b6-bbd1-b8a89a788c6f" friendlyname="tfs active directory user id lookup service addin" /> </addins> <sessiongroup creationtime="2011-04-14t14:59:58.72-07:00" friendlyname="(3)northwest cadence test track pro to tfs" sessiongroupguid="fece4d93-8498-4ed4-87d2-22599336a07d" creator="martinhinshelwood" syncintervalinseconds="0" syncdurationinminutes="0"> <migrationsources> <migrationsource internaluniqueid="c513f930-2602-400d-a0bf-a2a3ab434df5" friendlyname="testtrackpro source" serveridentifier="ttpdatabase@http://ttpserver.domain.com:80" serverurl="http://10.191.164.95:80" sourceidentifier="ttpdatabase" providerreferencename="c0e63c2b-e06c-48bb-8698-243a82bb950e"> <settings> <addins /> <useridentitylookup> <lookupaddin precedence="1" referencename="cdde6b6b-72fc-43b6-bbd1-b8a89a788c6f" /> </useridentitylookup> <defaultuseridproperty useridpropertyname="displayname" /> </settings> <customsettings> <customsetting settingkey="username" settingvalue="mhinshelwood" /> <customsetting settingkey="password" settingvalue="password" /> <!--<customsetting settingkey="overridehwm" settingvalue="2011-05-5t14:59:58.72-07:00" />--> </customsettings> <storedcredential /> </migrationsource> <migrationsource internaluniqueid="6e3bdf70-f1ae-4cd5-8ee4-133c8aee0857" friendlyname="tfs01.nwcadence.com (wit)" serveridentifier="346dd524-18b0-4eda-ba05-0f4d6b14e076" serverurl="http://tfs01.nwcadence.com:8080/tfs/defaultcollection" sourceidentifier="ttpimporttest" providerreferencename="04201d39-6e47-416f-98b2-07f0013f8455"> <settings> <addins /> <useridentitylookup> <lookupaddin precedence="1" referencename="cdde6b6b-72fc-43b6-bbd1-b8a89a788c6f" /> </useridentitylookup> <defaultuseridproperty useridpropertyname="displayname" /> </settings> <customsettings> <customsetting settingkey="enablebypassruledatasubmission" settingvalue="true" /> <customsetting settingkey="disableareapathautocreation" settingvalue="false" /> <customsetting settingkey="disableiterationpathautocreation" settingvalue="false" /> </customsettings> <storedcredential /> </migrationsource> </migrationsources> <sessions> <session creationtime="2011-04-14t14:59:58.703-07:00" sessionuniqueid="adea805d-51df-489a-b2fd-9717b4af3703" friendlyname="work item tracking session" leftmigrationsourceuniqueid="c513f930-2602-400d-a0bf-a2a3ab434df5" rightmigrationsourceuniqueid="6e3bdf70-f1ae-4cd5-8ee4-133c8aee0857" sessiontype="workitemtracking"> <eventsinks /> <customsettings> <settingxml> <witsessioncustomsetting> <workitemtypes> <workitemtype leftworkitemtypename="defect" rightworkitemtypename="bug" fieldmap="defect2bugfieldmap" /> </workitemtypes> <fieldmaps> <fieldmap name="defect2bugfieldmap"> <mappedfields> <mappedfield leftname="summary" rightname="system.title" mapfromside="left" valuemap="" /> <mappedfield leftname="description" rightname="system.description" mapfromside="left" valuemap="" /> <mappedfield leftname="severity" rightname="microsoft.vsts.common.severity" mapfromside="left" valuemap="severitymapttp2tfs" /> <mappedfield leftname="status" rightname="system.state" mapfromside="left" valuemap="statusmapttp2tfs" /> <mappedfield leftname="reason" rightname="system.reason" mapfromside="left" valuemap="reasonmapttp2tfs" /> <mappedfield leftname="priority" rightname="microsoft.vsts.common.priority" mapfromside="left" valuemap="prioritymapttp2tfs" /> <mappedfield leftname="steps to reproduce" rightname="microsoft.vsts.tcm.reprosteps" mapfromside="left" /> <mappedfield leftname="history" rightname="system.history" mapfromside="left" /> <mappedfield leftname="assigned to user" rightname="system.assignedto" mapfromside="left" valuemap="usermapttp2tfs" /> <mappedfield leftname="date created" rightname="microsoft.vsts.common.createddate" mapfromside="left" /> <mappedfield leftname="found by" rightname="microsoft.vsts.common.howfoundcategory" mapfromside="left" valuemap="howfoundcategorytfs" /> <!-- workaround using unused field: manual testing --> <!-- <mappedfield leftname="@@missingfield@@" rightname="microsoft.vsts.common.triage" mapfromside="left" valuemap="tfstriagemapping" /> <mappedfield leftname="@@missingfield@@" rightname="microsoft.vsts.common.regression" mapfromside="left" valuemap="tfsregressionmapping" /> <mappedfield leftname="@@missingfield@@" rightname="microsoft.vsts.build.changelist" mapfromside="left" valuemap="tfschangelistmapping" /> --> <mappedfield leftname="date modified" rightname="system.changeddate" mapfromside="left" /> <!--<mappedfield leftname="modified by" rightname="system.changedby" mapfromside="left" valuemap="statusmapttp2tfs" /--> <mappedfield leftname="verify version" rightname="microsoft.vsts.build.foundin" mapfromside="left" valuemap="verifyversionmapttp2tfs" /> </mappedfields> <aggregatedfields> <fieldsaggregationgroup mapfromside="left" targetfieldname="system.areapath" format="testtrackproimport\{0}\{1}"> <sourcefield index="0" sourcefieldname="component" valuemap="componentmapttp2tfs" /> <sourcefield index="1" sourcefieldname="functional area" valuemap="functionalareamapttp2tfs" /> </fieldsaggregationgroup> <fieldsaggregationgroup mapfromside="left" targetfieldname="system.iterationpath" format="testtrackproimport\{0}"> <sourcefield index="0" sourcefieldname="version found" valuemap="verifyversionmapttp2tfs"/> </fieldsaggregationgroup> </aggregatedfields> <useridentityfields> <leftuseridentityfields /> <rightuseridentityfields> <useridfield fieldreferencename="system.assignedto" useridpropertyname="displayname" /> </rightuseridentityfields> </useridentityfields> </fieldmap> </fieldmaps> <valuemaps> <valuemap name="howfoundcategorytfs"> <value leftvalue="*" rightvalue="manual testing"> </value> </valuemap> <valuemap name="severitymapttp2tfs"> <value leftvalue="" rightvalue="2" /> <value leftvalue="3-usability" rightvalue="3" /> <value leftvalue="4-cosmetic" rightvalue="4" /> <value leftvalue="2-feature not functioning" rightvalue="2" /> <value leftvalue="1-critical, crash" rightvalue="1" /> <value leftvalue="5-security" rightvalue="4" /> </valuemap> <valuemap name="tfschangelistmapping"> <value leftvalue="" rightvalue="unknown" /> <value leftvalue="*" rightvalue="*" /> </valuemap> <valuemap name="tfstriagemapping"> <!-- approved rejected submitted --> <value leftvalue="" rightvalue="approved"> <when conditionalsrcfieldname="status" conditionalsrcfieldvalue="submitted" /> </value> <value leftvalue="" rightvalue="rejected"> <when conditionalsrcfieldname="status" conditionalsrcfieldvalue="verify failed" /> </value> </valuemap> <valuemap name="tfsregressionmapping"> <!-- no yes --> <value leftvalue="" rightvalue="yes"> <when conditionalsrcfieldname="status" conditionalsrcfieldvalue="new (re-opened)" /> </value> <value leftvalue="" rightvalue="yes"> <when conditionalsrcfieldname="status" conditionalsrcfieldvalue="verify failed" /> </value> </valuemap> <valuemap name="statusmapttp2tfs"> <!-- strip all after the "," --> <value leftvalue="" rightvalue="proposed" /> <value leftvalue="*" rightvalue="proposed" /> <value leftvalue="verified" rightvalue="validated" /> <value leftvalue="closed" rightvalue="closed" /> <value leftvalue="fixed" rightvalue="resolved" /> <value leftvalue="release to testing" rightvalue="resolved" /> <value leftvalue="verify failed" rightvalue="resolved" /> <value leftvalue="new (re-opened)" rightvalue="proposed" /> <value leftvalue="deferred" rightvalue="resolved" /> </valuemap> <valuemap name="reasonmapttp2tfs"> <value leftvalue="" rightvalue="new"> <when conditionalsrcfieldname="status" conditionalsrcfieldvalue="new (re-opened)" /> </value> <value leftvalue="" rightvalue="resolved"> <when conditionalsrcfieldname="status" conditionalsrcfieldvalue="release to testing" /> </value> <value leftvalue="" rightvalue="verification rejected"> <when conditionalsrcfieldname="status" conditionalsrcfieldvalue="verify failed" /> </value> <value leftvalue="" rightvalue="resolved"> <when conditionalsrcfieldname="status" conditionalsrcfieldvalue="fixed" /> </value> <value leftvalue="" rightvalue="verified"> <when conditionalsrcfieldname="status" conditionalsrcfieldvalue="validated" /> </value> <value leftvalue="" rightvalue="cut"> <when conditionalsrcfieldname="status" conditionalsrcfieldvalue="deferred" /> </value> <value leftvalue="duplicate" rightvalue="duplicate" /> <value leftvalue="not a bug" rightvalue="not a bug" /> <value leftvalue="not reproducible" rightvalue="not reproducible" /> <value leftvalue="deprecated functionality" rightvalue="deprecated functionality" /> <value leftvalue="functions as designed" rightvalue="functions as designed" /> </valuemap> <valuemap name="componentmapttp2tfs"> <value leftvalue="*" rightvalue="*" /> <value leftvalue="" rightvalue="none" /> </valuemap> <valuemap name="functionalareamapttp2tfs"> <value leftvalue="*" rightvalue="*" /> <value leftvalue="" rightvalue="none" /> </valuemap> <valuemap name="verifyversionmapttp2tfs"> <value leftvalue="*" rightvalue="*" /> <value leftvalue="" rightvalue="none" /> </valuemap> <valuemap name="prioritymapttp2tfs"> <value leftvalue="*" rightvalue="2" /> <value leftvalue="4-low" rightvalue="3" /> <value leftvalue="3-medium" rightvalue="3" /> <value leftvalue="2-high" rightvalue="2" /> <value leftvalue="1-must be fixed" rightvalue="1" /> <value leftvalue="highest (qa)" rightvalue="0" /> </valuemap> <valuemap name="usermapttp2tfs"> <value leftvalue="*" rightvalue="*" /> <value leftvalue="" rightvalue="triage"> <when conditionalsrcfieldname="status" conditionalsrcfieldvalue="new" /> </value> </valuemap> <valuemap name="typeofcrmapttp2tfs"> <value leftvalue="*" rightvalue="*" /> </valuemap> </valuemaps> </witsessioncustomsetting> </settingxml> <settingxmlschema /> </customsettings> <filters> <filterpair neglect="false"> <filteritem migrationsourceuniqueid="c513f930-2602-400d-a0bf-a2a3ab434df5" filterstring="nwc_test" /> <filteritem migrationsourceuniqueid="6e3bdf70-f1ae-4cd5-8ee4-133c8aee0857" filterstring="[system.id] = 0" /> </filterpair> </filters> </session> </sessions> <linking> <customsettings /> <linktypemappings /> </linking> <workflowtype frequency="continuousmanual" directionofflow="unidirectional" synccontext="disabled" /> <customsettings /> <useridentitymappings enablevalidation="false"> <useridentitylookupaddins /> </useridentitymappings> <errormanagement> <errorrouters /> <reportingsettings /> </errormanagement> </sessiongroup> </configuration>
the problem i ran into was that as all of the example adapters are tip adapters they do not take into account history at all. here is the code for my first run through that was heavily based on robert maclean’s code from how to create an adapter for the tfs integration platform :
imports microsoft.teamfoundation.migration.toolkit imports system.componentmodel.design imports system.collections.objectmodel imports microsoft.teamfoundation.migration.toolkit.services imports microsoft.teamfoundation.migration.businessmodel imports microsoft.teamfoundation.migration.toolkit.errormanagement imports system.globalization imports system.xml imports microsoft.teamfoundation.migration.toolkit.syncorchestrator imports system.net imports system.io imports system.servicemodel imports system.servicemodel.security imports northwestcadence.ttptipadapter.ttpsoapsdk imports northwestcadence.ttptipadapter.ttpsoapsdk.api public class ttpanalysisprovider inherits analysisproviderbase ' fields private _analysisservicecontainer as iservicecontainer private _changegroupservice as changegroupservice private _configurationservice as configurationservice private _conflictmanagerservice as conflictmanager private _highwatermarkdelta as highwatermark(of datetime) private _highwatermarkchangeset as highwatermark(of integer) private _supportedchangeactions as dictionary(of guid, changeactionhandler) private _supportedcontenttypes as collection(of contenttype) private _datasourceconfig as ttpmigrationdatasource ' properties public overrides readonly property supportedchangeactions as dictionary(of guid, changeactionhandler) get return me._supportedchangeactions end get end property public overrides readonly property supportedcontenttypes as collection(of contenttype) get return me._supportedcontenttypes end get end property ' methods private function createchangegroup(byval changeset as integer, byval executionorder as long) as changegroup dim group as changegroup = me._changegroupservice.createchangegroupfordeltatable(changeset.tostring(cultureinfo.currentculture)) group.owner = nothing group.comment = string.format(cultureinfo.currentculture, "changeset {0}", new object() {changeset}) group.changetimeutc = datetime.utcnow group.status = changestatus.delta group.executionorder = executionorder return group end function private shared function createfieldrevisiondescriptiondoc(row as ttpdefectmigrationitem) as xmldocument dim columns as new xelement("columns", new object() {new xelement("column", new object() {new xattribute("displayname", "author"), new xattribute("referencename", "author"), new xattribute("type", "string"), new xelement("value", row.authorid)}), new xelement("column", new object() {new xattribute("displayname", "displayname"), new xattribute("referencename", "displayname"), new xattribute("type", "string"), new xelement("value", row.displayname)}), new xelement("column", new object() {new xattribute("displayname", "id"), new xattribute("referencename", "id"), new xattribute("type", "string"), new xelement("value", row.id.tostring)})}) dim column as keyvaluepair(of string, object) for each column in row.columns if not string.isnullorempty(column.value) then columns.add(new xelement("column", new object() {new xattribute("displayname", column.key), new xattribute("referencename", column.key), new xattribute("type", "string"), new xelement("value", column.value)})) end if next dim descriptiondoc as new xelement("workitemchanges", new object() {new xattribute("revision", "0"), new xattribute("workitemtype", row.woritemtype), new xattribute("author", iif(string.isnullorempty(row.authorid), "", row.authorid)), new xattribute("changedate", row.modifiedon.tostring(cultureinfo.currentculture)), new xattribute("workitemid", row.id.tostring), columns}) dim doc as new xmldocument doc.loadxml(descriptiondoc.tostring) return doc end function public overrides sub generatedeltatable() dim viewname as string = me._configurationservice.filters.item(0).path tracemanager.traceinformation("ttpwit:ap:generatedeltatable:view - {0}", new object() {viewname}) me._highwatermarkdelta.reload() me.getttpupdates(viewname) me._highwatermarkdelta.update(datetime.now) me._changegroupservice.promotedeltatopending() end sub public overrides sub initializeclient() tracemanager.traceinformation("ttpwit:ap:initializeclient") end sub private shared function initializemigrationdatasource() as ttpmigrationdatasource return new ttpmigrationdatasource end function public overrides sub initializeservices(byval analysisservice as iservicecontainer) tracemanager.traceinformation("ttpwit:ap:initializeservices") if (analysisservice is nothing) then throw new argumentnullexception("analysisservice") end if me._analysisservicecontainer = analysisservice me._configurationservice = directcast(analysisservice.getservice(gettype(configurationservice)), configurationservice) dim migrationsourceconfiguration as migrationsource = me._configurationservice.migrationsource _datasourceconfig = ttpanalysisprovider.initializemigrationdatasource dim customsetting as customsetting dim username as string = "" dim password as string = "" for each customsetting in me._configurationservice.migrationsource.customsettings.customsetting if customsetting.settingkey.equals("username", stringcomparison.ordinalignorecase) then username = customsetting.settingvalue end if if customsetting.settingkey.equals("password", stringcomparison.ordinalignorecase) then password = customsetting.settingvalue end if next _datasourceconfig.credentials = new networkcredential(username, password) _datasourceconfig.databasename = migrationsourceconfiguration.sourceidentifier _datasourceconfig.filtername = iif(migrationsourceconfiguration.serveridentifier = "[enterfiltername]", "", migrationsourceconfiguration.serveridentifier) _datasourceconfig.url = migrationsourceconfiguration.serverurl me._supportedcontenttypes = new collection(of contenttype) me.supportedcontenttypes.add(wellknowncontenttype.workitem) dim handler as new ttpchangeactionhandlers(me) me._supportedchangeactions = new dictionary(of guid, changeactionhandler) me.supportedchangeactions.add(wellknownchangeactionid.add, new changeactionhandler(addressof handler.basicactionhandler)) me.supportedchangeactions.add(wellknownchangeactionid.edit, new changeactionhandler(addressof handler.basicactionhandler)) me.supportedchangeactions.add(wellknownchangeactionid.delete, new changeactionhandler(addressof handler.basicactionhandler)) me._highwatermarkdelta = new highwatermark(of datetime)("hwmdelta") me._highwatermarkchangeset = new highwatermark(of integer)("lastchangeset") me._configurationservice.registerhighwatermarkwithsession(me._highwatermarkdelta) me._configurationservice.registerhighwatermarkwithsession(me._highwatermarkchangeset) me._changegroupservice = directcast(me._analysisservicecontainer.getservice(gettype(changegroupservice)), changegroupservice) me._changegroupservice.registerdefaultsourceserializer(new ttpdefectmigrationitemserializer) end sub public overrides sub registerconflicttypes(byval conflictmanager as conflictmanager) tracemanager.traceinformation("ttpwit:ap:registerconflicttypes") me._conflictmanagerservice = directcast(me._analysisservicecontainer.getservice(gettype(conflictmanager)), conflictmanager) me._conflictmanagerservice.registerconflicttype(new genericconflicttype) me._conflictmanagerservice.registerconflicttype(new ttpgeneralconflicttype, conflictssyncorchoptions.continue) end sub public overrides sub registersupportedchangeactions(byval changeactionregistrationservice as changeactionregistrationservice) tracemanager.traceinformation("ttpwit:ap:registersupportedchangeactions") changeactionregistrationservice = directcast(me._analysisservicecontainer.getservice(gettype(changeactionregistrationservice)), changeactionregistrationservice) dim supportedchangeaction as keyvaluepair(of guid, changeactionhandler) for each supportedchangeaction in me.supportedchangeactions dim contenttype as contenttype for each contenttype in me.supportedcontenttypes changeactionregistrationservice.registerchangeaction(supportedchangeaction.key, contenttype.referencename, supportedchangeaction.value) next next end sub public overrides sub registersupportedcontenttypes(contenttyperegistrationservice as microsoft.teamfoundation.migration.toolkit.services.contenttyperegistrationservice) end sub private sub getttpupdates(byval viewname as string) tracemanager.traceinformation("ttpwit:ap:getttpdefectupdates") dim ttpserver as uri = new uri(string.format("{0}/scripts/ttsoapcgi.exe", _datasourceconfig.url)) tracemanager.traceinformation(chrw(9) & "ttpwit:ap:loading ttp {0}", new object() {ttpserver}) try dim _ttpsoapclient = new ttpsoapsdkapi(ttpserver) dim _sourceproject as cproject = nothing tracemanager.traceinformation("ttp:ap:getttpdefectsasdeltafromsource:getprojectlist") dim projects() as cproject = _ttpsoapclient.getprojectlist(_datasourceconfig.credentials.username, _datasourceconfig.credentials.password) tracemanager.traceinformation("ttp:ap:getttpdefectsasdeltafromsource:findsourceproject") for each project in projects if project.database.name.tolower = _datasourceconfig.databasename.tolower then _sourceproject = project tracemanager.traceinformation("ttp:ap:getttpdefectsasdeltafromsource:sourceprojectfound") exit for end if next if _sourceproject is nothing then tracemanager.traceinformation("ttp:ap:getttpdefectsasdeltafromsource:project not found") exit sub end if tracemanager.traceinformation("ttp:ap:initializeclient:getsessionid") dim _lsession = _ttpsoapclient.projectlogon(_sourceproject, _datasourceconfig.credentials.username, _datasourceconfig.credentials.password) tracemanager.traceinformation("ttp:ap:initializeclient:logged onto {0}", _sourceproject.database.name) dim _deltatablestarttime as datetime = datetime.now ' dim atc() as ctablecolumn = {new ctablecolumn with {.name = "number"}, new ctablecolumn with {.name = "date modified"}} dim atc() as ctablecolumn = _ttpsoapclient.getcolumnsfortable(_lsession, "defect") dim tstart as datetime = now tracemanager.traceinformation("ttp:ap:initializeclient:atempting get on all data") dim rows as crecordlistsoap = _ttpsoapclient.getrecordlistfortable(_lsession, "defect", viewname, atc) tracemanager.traceinformation("ttp:ap:initializeclient:found {0} records in {1} seconds", rows.records.count, now.subtract(tstart).totalseconds) dim currentrecord as integer = 1 dim countrecords = rows.records.count for each record in rows.records ' item has been modified since hwm & before deltra table start time try dim defectmi as ttpdefectmigrationitem = ttpdefectmigrationitem.convertcdefecttottpdefectmigrationitem(atc, record) ' dim modified as datetime = datetime.parse(record.row(1).value) if defectmi.modifiedon.compareto(_highwatermarkdelta.value) > 0 and defectmi.modifiedon.compareto(_deltatablestarttime) then ' atempt to import additional data from objects defectmi.importdefectdata(_ttpsoapclient, _lsession) ' create and add acction group dim actionguid as guid = wellknownchangeactionid.add if ((not _highwatermarkdelta.value = datetime.minvalue) andalso (defectmi.modifiedon.compareto(_highwatermarkdelta.value) > 0)) then actionguid = wellknownchangeactionid.edit else actionguid = wellknownchangeactionid.add end if dim changegroup as changegroup = me.createchangegroup(_highwatermarkchangeset.value, 0) changegroup.createaction(actionguid, defectmi, string.empty, _datasourceconfig.databasename, string.empty, string.empty, wellknowncontenttype.workitem.referencename, ttpanalysisprovider.createfieldrevisiondescriptiondoc(delta)) changegroup.save() _highwatermarkchangeset.update((_highwatermarkchangeset.value + 1)) ' done tracemanager.traceinformation(" {0} of {1} - '{2}' number '{3}' has {4} processing in {5} seconds", currentrecord, countrecords, defectmi.woritemtype, defectmi.id, "passed", now.subtract(tstart).totalseconds) else tracemanager.traceinformation(" {0} of {1} - '{2}' number '{3}' has {4} processing in {5} seconds", currentrecord, countrecords, defectmi.woritemtype, defectmi.id, "skipped", now.subtract(tstart).totalseconds) end if catch ex as exception tracemanager.traceerror(" {0} of {1} - '{2}' number '{3}' has {4} processing in {5} seconds", currentrecord, countrecords, "unknown", "unknown", "failed", now.subtract(tstart).totalseconds) tracemanager.traceexception(ex) end try currentrecord = currentrecord + 1 next catch ex as exception tracemanager.traceexception(ex) end try end sub end class
figure: full source for the analysis provider v1
dim changegroup as changegroup = me.createchangegroup(_highwatermarkchangeset.value, 0) changegroup.createaction(actionguid, defectmi, string.empty, _datasourceconfig.databasename, string.empty, string.empty, wellknowncontenttype.workitem.referencename, ttpanalysisprovider.createfieldrevisiondescriptiondoc(delta)) changegroup.save()
figure: snipit of the analysis provider v1
the problem that i have encountered is that although it adds new work items that come into scope, it does not do any updates to those work item. now, i can understand this if there had been any updates on the tfs side, but i can guarantee that there has not. so i sought help:
- action == edit when pushing changes and == add for a new one is correct.
- version … without debugging the consensus is that the lack of version information is causing the tip type migration, rather than auctioning the history (edits).
- version merge property … for vc only.
- ideas for version property:
- option 1 – create fake version numbers for the ttp side and using a single incrementing integer watermark across all of the ttp items.
- option 1 – create fake version numbers for the ttp side and just copy the changeaction’s changeactionid value for this.
- willy-peter schaub , vsalm ranger mother
so i changed my code so that when the create action occurred it passed in a version (work item revision) number. as my source system does not have revisions, and does not even keep track of edits i just have to make up the number as long as it is greater than the one before. i went for option 1 provided by willy.
imports microsoft.teamfoundation.migration.toolkit imports system.componentmodel.design imports system.collections.objectmodel imports microsoft.teamfoundation.migration.toolkit.services imports microsoft.teamfoundation.migration.businessmodel imports microsoft.teamfoundation.migration.toolkit.errormanagement imports system.globalization imports system.xml imports microsoft.teamfoundation.migration.toolkit.syncorchestrator imports system.net imports system.io imports system.servicemodel imports system.servicemodel.security imports northwestcadence.ttptipadapter.ttpsoapsdk imports northwestcadence.ttptipadapter.ttpsoapsdk.api public class ttpanalysisprovider inherits analysisproviderbase ' fields private _analysisservicecontainer as iservicecontainer private _changegroupservice as changegroupservice private _configurationservice as configurationservice private _conflictmanagerservice as conflictmanager private _highwatermarkdelta as highwatermark(of datetime) private _highwatermarkchangeset as highwatermark(of integer) private _highwatermarkrevision as highwatermark(of integer) private _supportedchangeactions as dictionary(of guid, changeactionhandler) private _supportedcontenttypes as collection(of contenttype) private _datasourceconfig as ttpmigrationdatasource ' properties public overrides readonly property supportedchangeactions as dictionary(of guid, changeactionhandler) get return me._supportedchangeactions end get end property public overrides readonly property supportedcontenttypes as collection(of contenttype) get return me._supportedcontenttypes end get end property private shared function createfieldrevisiondescriptiondoc(row as ttpdefectmigrationitem) as xmldocument dim columns as new xelement("columns", new object() {new xelement("column", new object() {new xattribute("displayname", "author"), new xattribute("referencename", "author"), new xattribute("type", "string"), new xelement("value", row.authorid)}), new xelement("column", new object() {new xattribute("displayname", "displayname"), new xattribute("referencename", "displayname"), new xattribute("type", "string"), new xelement("value", row.displayname)}), new xelement("column", new object() {new xattribute("displayname", "id"), new xattribute("referencename", "id"), new xattribute("type", "string"), new xelement("value", row.id.tostring)})}) dim column as keyvaluepair(of string, object) for each column in row.columns if not string.isnullorempty(column.value) then columns.add(new xelement("column", new object() {new xattribute("displayname", column.key), new xattribute("referencename", column.key), new xattribute("type", "string"), new xelement("value", column.value)})) end if next dim descriptiondoc as new xelement("workitemchanges", new object() {new xattribute("revision", row.revision), new xattribute("workitemtype", row.woritemtype), new xattribute("author", iif(string.isnullorempty(row.authorid), "", row.authorid)), new xattribute("changedate", row.modifiedon.tostring(cultureinfo.currentculture)), new xattribute("workitemid", row.id.tostring), columns}) dim doc as new xmldocument doc.loadxml(descriptiondoc.tostring) return doc end function public overrides sub generatedeltatable() dim viewname as string = me._configurationservice.filters.item(0).path tracemanager.traceinformation("ttpwit:ap:generatedeltatable:view - {0}", new object() {viewname}) me._highwatermarkdelta.reload() me.getttpupdates(viewname) me._highwatermarkdelta.update(datetime.now) me._changegroupservice.promotedeltatopending() end sub public overrides sub initializeclient() tracemanager.traceinformation("ttpwit:ap:initializeclient") end sub private shared function initializemigrationdatasource() as ttpmigrationdatasource return new ttpmigrationdatasource end function public overrides sub initializeservices(byval analysisservice as iservicecontainer) tracemanager.traceinformation("ttpwit:ap:initializeservices") if (analysisservice is nothing) then throw new argumentnullexception("analysisservice") end if me._analysisservicecontainer = analysisservice me._configurationservice = directcast(analysisservice.getservice(gettype(configurationservice)), configurationservice) dim migrationsourceconfiguration as migrationsource = me._configurationservice.migrationsource _datasourceconfig = ttpanalysisprovider.initializemigrationdatasource dim customsetting as customsetting dim username as string = "" dim password as string = "" dim hwmdateoveride as datetime = datetime.minvalue for each customsetting in me._configurationservice.migrationsource.customsettings.customsetting if customsetting.settingkey.equals("username", stringcomparison.ordinalignorecase) then username = customsetting.settingvalue end if if customsetting.settingkey.equals("password", stringcomparison.ordinalignorecase) then password = customsetting.settingvalue end if if customsetting.settingkey.equals("overridehwm", stringcomparison.ordinalignorecase) then if not datetime.tryparse(customsetting.settingvalue, hwmdateoveride) then throw new invalidcastexception("date is not in the correct format: overridehwm") end if end if next _datasourceconfig.credentials = new networkcredential(username, password) _datasourceconfig.databasename = migrationsourceconfiguration.sourceidentifier _datasourceconfig.filtername = iif(migrationsourceconfiguration.serveridentifier = "[enterfiltername]", "", migrationsourceconfiguration.serveridentifier) _datasourceconfig.url = migrationsourceconfiguration.serverurl me._supportedcontenttypes = new collection(of contenttype) me.supportedcontenttypes.add(wellknowncontenttype.workitem) dim handler as new ttpchangeactionhandlers(me) me._supportedchangeactions = new dictionary(of guid, changeactionhandler) me.supportedchangeactions.add(wellknownchangeactionid.add, new changeactionhandler(addressof handler.basicactionhandler)) me.supportedchangeactions.add(wellknownchangeactionid.edit, new changeactionhandler(addressof handler.basicactionhandler)) me.supportedchangeactions.add(wellknownchangeactionid.delete, new changeactionhandler(addressof handler.basicactionhandler)) me._highwatermarkdelta = new highwatermark(of datetime)("hwmdelta") me._highwatermarkchangeset = new highwatermark(of integer)("lastchangeset") _highwatermarkrevision = new highwatermark(of integer)("revision") me._configurationservice.registerhighwatermarkwithsession(me._highwatermarkdelta) me._configurationservice.registerhighwatermarkwithsession(me._highwatermarkchangeset) me._configurationservice.registerhighwatermarkwithsession(me._highwatermarkrevision) if hwmdateoveride > datetime.minvalue then _highwatermarkdelta.update(hwmdateoveride) end if me._changegroupservice = directcast(me._analysisservicecontainer.getservice(gettype(changegroupservice)), changegroupservice) me._changegroupservice.registerdefaultsourceserializer(new ttpdefectmigrationitemserializer) end sub public overrides sub registerconflicttypes(byval conflictmanager as conflictmanager) tracemanager.traceinformation("ttpwit:ap:registerconflicttypes") me._conflictmanagerservice = directcast(me._analysisservicecontainer.getservice(gettype(conflictmanager)), conflictmanager) me._conflictmanagerservice.registerconflicttype(new genericconflicttype) me._conflictmanagerservice.registerconflicttype(new ttpgeneralconflicttype, conflictssyncorchoptions.continue) end sub public overrides sub registersupportedchangeactions(byval changeactionregistrationservice as changeactionregistrationservice) tracemanager.traceinformation("ttpwit:ap:registersupportedchangeactions") changeactionregistrationservice = directcast(me._analysisservicecontainer.getservice(gettype(changeactionregistrationservice)), changeactionregistrationservice) dim supportedchangeaction as keyvaluepair(of guid, changeactionhandler) for each supportedchangeaction in me.supportedchangeactions dim contenttype as contenttype for each contenttype in me.supportedcontenttypes changeactionregistrationservice.registerchangeaction(supportedchangeaction.key, contenttype.referencename, supportedchangeaction.value) next next end sub public overrides sub registersupportedcontenttypes(contenttyperegistrationservice as microsoft.teamfoundation.migration.toolkit.services.contenttyperegistrationservice) end sub private sub getttpupdates(byval viewname as string) tracemanager.traceinformation("ttpwit:ap:getttpdefectupdates") dim ttpserver as uri = new uri(string.format("{0}/scripts/ttsoapcgi.exe", _datasourceconfig.url)) tracemanager.traceinformation(chrw(9) & "ttpwit:ap:loading ttp {0}", new object() {ttpserver}) try dim _ttpsoapclient = new ttpsoapsdkapi(ttpserver) dim _sourceproject as cproject = nothing tracemanager.traceinformation("ttp:ap:getttpdefectsasdeltafromsource:getprojectlist") dim projects() as cproject = _ttpsoapclient.getprojectlist(_datasourceconfig.credentials.username, _datasourceconfig.credentials.password) tracemanager.traceinformation("ttp:ap:getttpdefectsasdeltafromsource:findsourceproject") for each project in projects if project.database.name.tolower = _datasourceconfig.databasename.tolower then _sourceproject = project tracemanager.traceinformation("ttp:ap:getttpdefectsasdeltafromsource:sourceprojectfound") exit for end if next if _sourceproject is nothing then tracemanager.traceinformation("ttp:ap:getttpdefectsasdeltafromsource:project not found") exit sub end if tracemanager.traceinformation("ttp:ap:initializeclient:getsessionid") dim _lsession = _ttpsoapclient.projectlogon(_sourceproject, _datasourceconfig.credentials.username, _datasourceconfig.credentials.password) tracemanager.traceinformation("ttp:ap:initializeclient:logged onto {0}", _sourceproject.database.name) dim _deltatablestarttime as datetime = datetime.now ' dim atc() as ctablecolumn = {new ctablecolumn with {.name = "number"}, new ctablecolumn with {.name = "date modified"}} dim atc() as ctablecolumn = _ttpsoapclient.getcolumnsfortable(_lsession, "defect") dim tstart as datetime = now tracemanager.traceinformation("ttp:ap:initializeclient:atempting get on all data") dim rows as crecordlistsoap = _ttpsoapclient.getrecordlistfortable(_lsession, "defect", viewname, atc) tracemanager.traceinformation("ttp:ap:initializeclient:found {0} records in {1} seconds", rows.records.count, now.subtract(tstart).totalseconds) _highwatermarkrevision.reload() _highwatermarkrevision.update(_highwatermarkrevision.value + 1) dim currentrecord as integer = 1 dim countrecords = rows.records.count for each record in rows.records ' item has been modified since hwm & before deltra table start time try dim defectmi as ttpdefectmigrationitem = ttpdefectmigrationitem.convertcdefecttottpdefectmigrationitem(atc, record) ' dim modified as datetime = datetime.parse(record.row(1).value) if defectmi.modifiedon.compareto(_highwatermarkdelta.value) > 0 and defectmi.modifiedon.compareto(_deltatablestarttime) then ' atempt to import additional data from objects defectmi.importdefectdata(_ttpsoapclient, _lsession) ' create and add acction group dim actionguid as guid = wellknownchangeactionid.add if ((not _highwatermarkdelta.value = datetime.minvalue) andalso (defectmi.createdon.compareto(_highwatermarkdelta.value) > 0)) then actionguid = wellknownchangeactionid.add tracemanager.traceinformation(" {0} of {1} - '{2}' number '{3}' has {4} processing revision {5} as add in {6} seconds", currentrecord, countrecords, defectmi.woritemtype, defectmi.id, "passed", _highwatermarkrevision.value, now.subtract(tstart).totalseconds) elseif ((not _highwatermarkdelta.value = datetime.minvalue) andalso (defectmi.modifiedon.compareto(_highwatermarkdelta.value) > 0)) then actionguid = wellknownchangeactionid.edit tracemanager.traceinformation(" {0} of {1} - '{2}' number '{3}' has {4} processing revision {5} as edit in {6} seconds", currentrecord, countrecords, defectmi.woritemtype, defectmi.id, "passed", _highwatermarkrevision.value, now.subtract(tstart).totalseconds) else tracemanager.traceinformation(" {0} of {1} - '{2}' number '{3}' has {4} processing revision {5} as edit in {6} seconds", currentrecord, countrecords, defectmi.woritemtype, defectmi.id, "skipped", _highwatermarkrevision.value, now.subtract(tstart).totalseconds) end if ' add revision to obejct defectmi.revision = _highwatermarkrevision.value dim changegroup as changegroup = me._changegroupservice.createchangegroupfordeltatable(string.format("{0}:{1}", defectmi.id, defectmi.revision)) changegroup.createaction(actionguid, defectmi, defectmi.id, "", _highwatermarkrevision.value, "", wellknowncontenttype.workitem.referencename, ttpanalysisprovider.createfieldrevisiondescriptiondoc(defectmi)) tracemanager.traceinformation(" {0} of {1} - '{2}' number '{3}' createaction: action={4};sourceitem={5};frompath={5};version={6};mergeversionto=;itemtyperefname={7};actiondetails=[xml]", currentrecord, countrecords, defectmi.woritemtype, defectmi.id, actionguid, defectmi.id, _highwatermarkrevision.value, wellknowncontenttype.workitem.referencename) changegroup.save() _highwatermarkchangeset.update((_highwatermarkchangeset.value + 1)) ' done else tracemanager.traceinformation(" {0} of {1} - '{2}' number '{3}' has {4} processing in {5} seconds", currentrecord, countrecords, defectmi.woritemtype, defectmi.id, "skipped", now.subtract(tstart).totalseconds) end if catch ex as exception tracemanager.traceerror(" {0} of {1} - '{2}' number '{3}' has {4} processing in {5} seconds", currentrecord, countrecords, "unknown", "unknown", "failed", now.subtract(tstart).totalseconds) tracemanager.traceexception(ex) end try currentrecord = currentrecord + 1 next catch ex as exception tracemanager.traceexception(ex) end try end sub end class
figure: full source code for new analysis provider v2
dim changegroup as changegroup = me._changegroupservice.createchangegroupfordeltatable(string.format("{0}:{1}", defectmi.id, defectmi.revision)) changegroup.createaction(actionguid, defectmi, defectmi.id, "", _highwatermarkrevision.value, "", wellknowncontenttype.workitem.referencename, ttpanalysisprovider.createfieldrevisiondescriptiondoc(defectmi)) tracemanager.traceinformation(" {0} of {1} - '{2}' number '{3}' createaction: action={4};sourceitem={5};frompath={5};version={6};mergeversionto=;itemtyperefname={7};actiondetails=[xml]", currentrecord, countrecords, defectmi.woritemtype, defectmi.id, actionguid, defectmi.id, _highwatermarkrevision.value, wellknowncontenttype.workitem.referencename) changegroup.save()
figure: snipit of the analysis provider v2
you can see in the full source for v2 of the analysis provider that i have added a new high watermark for the revision that should stay in sync with the number of runs of the migration there have been. this way, all of the edit’s that happen on the third run will have a revision number of 3.
figure: none of the originally imported data has a revision.
the problem now is that no matter how many times i run the import in my test environment i can’t get it to perform an edit. i am hoping that someone will be able to spot a silly mistake on my code that will solve this problem. it is one of those “stare at it for hours hoping it will just work” problems.
and it gets worse, now when i try to run the code i get an “index was out of range” exception for the tfs server that i just can’t track down. i have even backed all my code back to a known working version and i still get the error. i have even gone so far as to restart the target tfs server and try another one. here is the log i keep getting:
[02/06/2011 18:14:15] migrationconsole started... [02/06/2011 18:14:29] migrationconsole.exe information: 0 : configurationchangetracker did not detect any non-transient changes. no cached data will be deleted for session group '00000000-0000-0000-0000-000000000000' [02/06/2011 18:14:29] migrationconsole.exe information: 0 : : startsessiongroup: enter with sessiongroupuniqueid: a69d4175-24ad-4f12-8fb5-4edd33f40ada [02/06/2011 18:14:29] migrationconsole.exe information: 0 : : startsessiongroup: creating new syncorchestrator [02/06/2011 18:14:30] migrationconsole.exe information: 0 : : provider changegroup label analysisaddin provider a4f53905-25b6-4311-ac0c-637da6688f2b is available [02/06/2011 18:14:30] migrationconsole.exe information: 0 : : provider clearquest adapter d9637401-7385-4643-9c64-31585d77ed16 is available [02/06/2011 18:14:30] migrationconsole.exe information: 0 : : provider northwest cadence csv adapter 06a2457f-ebba-4979-bc5f-0f5006b8b4e6 is available [02/06/2011 18:14:30] migrationconsole.exe information: 0 : : provider tfs 2008 user identity lookup add-in provider eecc0227-8006-45f0-888d-10ab03019ad5 is available [02/06/2011 18:14:30] migrationconsole.exe information: 0 : : provider semaphore file analysis addin provider e8cec3c5-5848-4b83-904f-4324094c3f78 is available [02/06/2011 18:14:30] migrationconsole.exe information: 0 : : provider tfs 2010 migration vc provider febc091f-82a2-449e-aed8-133e5896c47a is available [02/06/2011 18:14:31] migrationconsole.exe information: 0 : : provider tfs 2010 migration wit provider 04201d39-6e47-416f-98b2-07f0013f8455 is available [02/06/2011 18:14:31] migrationconsole.exe information: 0 : : provider testtrackpro tip adapter c0e63c2b-e06c-48bb-8698-243a82bb950e is available [02/06/2011 18:14:31] migrationconsole.exe information: 0 : : csvadapter:getservice - microsoft.teamfoundation.migration.toolkit.iaddin [02/06/2011 18:14:31] migrationconsole.exe information: 0 : : provider tfs 2010 migration wit provider 04201d39-6e47-416f-98b2-07f0013f8455 is loaded [02/06/2011 18:14:31] migrationconsole.exe information: 0 : : ttpadapter:getservice - microsoft.teamfoundation.migration.toolkit.iaddin [02/06/2011 18:14:31] migrationconsole.exe information: 0 : : ttpadapter:getservice - cant find-- [02/06/2011 18:14:31] migrationconsole.exe information: 0 : : provider testtrackpro tip adapter c0e63c2b-e06c-48bb-8698-243a82bb950e is loaded [02/06/2011 18:14:31] migrationconsole.exe information: 0 : : 2 adapter instance(s) loaded [02/06/2011 18:14:31] migrationconsole.exe information: 0 : : 5 add-ins loaded [02/06/2011 18:14:35] migrationconsole.exe information: 0 : : active directory lookup will be used for this end point. [02/06/2011 18:14:39] migrationconsole.exe information: 0 : : ttpadapter:getservice - microsoft.teamfoundation.migration.toolkit.ianalysisprovider [02/06/2011 18:14:39] migrationconsole.exe information: 0 : : ttpadapter:getservice creating - ttpanalysisprovider [02/06/2011 18:14:39] migrationconsole.exe information: 0 : : ttpadapter:getservice returning - northwestcadence.ttptipadapter.ttpanalysisprovider [02/06/2011 18:14:39] migrationconsole.exe information: 0 : : ttpwit:ap:initializeservices [02/06/2011 18:14:39] migrationconsole.exe information: 0 : : ttpwit:ap:registersupportedchangeactions [02/06/2011 18:14:39] migrationconsole.exe information: 0 : : ttpwit:ap:registerconflicttypes [02/06/2011 18:14:39] migrationconsole.exe information: 0 : : ttpadapter:getservice - microsoft.teamfoundation.migration.toolkit.services.iserverpathtranslationservice [02/06/2011 18:14:39] migrationconsole.exe information: 0 : : ttpadapter:getservice - cant find-- [02/06/2011 18:14:39] migrationconsole.exe information: 0 : : ttpadapter:getservice - microsoft.teamfoundation.migration.toolkit.imigrationprovider [02/06/2011 18:14:39] migrationconsole.exe information: 0 : : ttpadapter:getservice creating - ttpmigrationprovider [02/06/2011 18:14:39] migrationconsole.exe information: 0 : : ttpadapter:getservice returning - northwestcadence.ttptipadapter.ttpanalysisprovider [02/06/2011 18:14:39] migrationconsole.exe information: 0 : : ttpwit:ap:registerconflicttypes [02/06/2011 18:14:39] migrationconsole.exe information: 0 : : ttpadapter:getservice - microsoft.teamfoundation.migration.toolkit.ilinkprovider [02/06/2011 18:14:39] migrationconsole.exe information: 0 : : ttpadapter:getservice - cant find-- [02/06/2011 18:14:39] migrationconsole.exe information: 0 : : connecting to 'http://tfs01.nwcadence.com:8080/tfs/sandbox' [02/06/2011 18:14:41] migrationconsole.exe information: 0 : : connected to 'http://tfs01.nwcadence.com:8080/tfs/sandbox' [02/06/2011 18:14:42] migrationconsole.exe information: 0 : : connecting to 'http://tfs01.nwcadence.com:8080/tfs/sandbox' [02/06/2011 18:14:42] migrationconsole.exe information: 0 : : connected to 'http://tfs01.nwcadence.com:8080/tfs/sandbox' [02/06/2011 18:14:42] migrationconsole.exe information: 0 : : ttpwit:ap:initializeclient [02/06/2011 18:14:42] migrationconsole.exe information: 0 : : connecting to 'http://tfs01.nwcadence.com:8080/tfs/sandbox' [02/06/2011 18:14:42] migrationconsole.exe information: 0 : : connected to 'http://tfs01.nwcadence.com:8080/tfs/sandbox' [02/06/2011 18:14:43] migrationconsole.exe information: 0 : : connecting to 'http://tfs01.nwcadence.com:8080/tfs/sandbox' [02/06/2011 18:14:43] migrationconsole.exe information: 0 : : connected to 'http://tfs01.nwcadence.com:8080/tfs/sandbox' [02/06/2011 18:14:44] migrationconsole.exe information: 0 : : startsessiongroup: starting syncorchestrator; now 0 running sessions [02/06/2011 18:14:44] migrationconsole.exe information: 0 : workitemtracking: session worker thread [workitemtracking] started [02/06/2011 18:14:44] migrationconsole.exe information: 0 : workitemtracking: pipeline flow from bcf2ef19-dbaf-48a3-bbd1-82424ef9d7f2 to 90acdef5-e512-4df5-a680-cb2f386b08fd [02/06/2011 18:14:44] migrationconsole.exe information: 0 : workitemtracking: generating delta tables for the migration source bcf2ef19-dbaf-48a3-bbd1-82424ef9d7f2 [02/06/2011 18:14:44] migrationconsole.exe information: 0 : workitemtracking: ttpwit:ap:generatedeltatable:view - nwc_test [02/06/2011 18:14:44] migrationconsole.exe information: 0 : workitemtracking: ttpwit:ap:getttpdefectupdates [02/06/2011 18:14:44] migrationconsole.exe information: 0 : workitemtracking: ttpwit:ap:loading ttp http://ttp01.nwcadence.com/scripts/ttsoapcgi.exe [02/06/2011 18:14:45] migrationconsole.exe information: 0 : workitemtracking: ttp:ap:getttpdefectsasdeltafromsource:getprojectlist [02/06/2011 18:14:47] migrationconsole.exe information: 0 : workitemtracking: ttp:ap:getttpdefectsasdeltafromsource:findsourceproject [02/06/2011 18:14:47] migrationconsole.exe information: 0 : workitemtracking: ttp:ap:getttpdefectsasdeltafromsource:sourceprojectfound [02/06/2011 18:14:47] migrationconsole.exe information: 0 : workitemtracking: ttp:ap:initializeclient:getsessionid [02/06/2011 18:14:48] migrationconsole.exe information: 0 : workitemtracking: ttp:ap:initializeclient:logged onto expresso_vergence [02/06/2011 18:14:49] migrationconsole.exe information: 0 : workitemtracking: ttp:ap:initializeclient:atempting get on all data [02/06/2011 18:14:51] migrationconsole.exe information: 0 : workitemtracking: ttp:ap:initializeclient:found 3 records in 1.9663932 seconds [02/06/2011 18:14:52] migrationconsole.exe information: 0 : workitemtracking: 1 of 3 - 'defect' number '3284' has skipped processing revision 1 as edit in 3.2796558 seconds [02/06/2011 18:14:52] migrationconsole.exe information: 0 : workitemtracking: 1 of 3 - 'defect' number '3284' createaction: action=cb71d043-bede-4092-aa87-cf0f14586625;sourceitem=3284;frompath=3284;version=0;mergeversionto=;itemtyperefname=microsoft.teamfoundation.migration.toolkit.workitem;actiondetails=[xml] [02/06/2011 18:14:54] migrationconsole.exe information: 0 : workitemtracking: 2 of 3 - 'defect' number '3285' has skipped processing revision 1 as edit in 4.8739746 seconds [02/06/2011 18:14:54] migrationconsole.exe information: 0 : workitemtracking: 2 of 3 - 'defect' number '3285' createaction: action=cb71d043-bede-4092-aa87-cf0f14586625;sourceitem=3285;frompath=3285;version=0;mergeversionto=;itemtyperefname=microsoft.teamfoundation.migration.toolkit.workitem;actiondetails=[xml] [02/06/2011 18:14:55] migrationconsole.exe information: 0 : workitemtracking: 3 of 3 - 'defect' number '3243' has skipped processing revision 1 as edit in 6.1952388 seconds [02/06/2011 18:14:55] migrationconsole.exe information: 0 : workitemtracking: 3 of 3 - 'defect' number '3243' createaction: action=cb71d043-bede-4092-aa87-cf0f14586625;sourceitem=3243;frompath=3243;version=0;mergeversionto=;itemtyperefname=microsoft.teamfoundation.migration.toolkit.workitem;actiondetails=[xml] [02/06/2011 18:14:55] migrationconsole.exe information: 0 : workitemtracking: generating linking delta for the migration source bcf2ef19-dbaf-48a3-bbd1-82424ef9d7f2 [02/06/2011 18:14:55] migrationconsole.exe information: 0 : workitemtracking: generating delta tables for the migration source 90acdef5-e512-4df5-a680-cb2f386b08fd [02/06/2011 18:14:55] migrationconsole.exe information: 0 : workitemtracking: getting modified items from '90acdef5-e512-4df5-a680-cb2f386b08fd!http://tfs01.nwcadence.com:8080/tfs/sandbox (testtrackpro)' [02/06/2011 18:14:55] migrationconsole.exe information: 0 : workitemtracking: connecting to 'http://tfs01.nwcadence.com:8080/tfs/sandbox' [02/06/2011 18:14:55] migrationconsole.exe information: 0 : workitemtracking: connected to 'http://tfs01.nwcadence.com:8080/tfs/sandbox' [02/06/2011 18:14:55] migrationconsole.exe information: 0 : workitemtracking: tfs query: select [system.id], [system.rev] from workitems where ([system.teamproject]=@project and ([system.id] = 0)) order by [system.id] [02/06/2011 18:14:56] migrationconsole.exe information: 0 : workitemtracking: tfs query: returned 0 item(s) [02/06/2011 18:14:56] migrationconsole.exe information: 0 : workitemtracking: received modified items from '90acdef5-e512-4df5-a680-cb2f386b08fd!http://tfs01.nwcadence.com:8080/tfs/sandbox (testtrackpro)' [02/06/2011 18:14:56] migrationconsole.exe information: 0 : workitemtracking: persisted wit hwm: hwmdeltawit [02/06/2011 18:14:56] migrationconsole.exe information: 0 : workitemtracking: updated high watermark to '06/02/2011 22:14:55' [02/06/2011 18:14:56] migrationconsole.exe information: 0 : workitemtracking: generating migration instructions for the migration source 90acdef5-e512-4df5-a680-cb2f386b08fd [02/06/2011 18:14:56] migrationconsole.exe information: 0 : workitemtracking: ttpdefectmigrationitemserializer:loaditem [02/06/2011 18:14:57] migrationconsole.exe information: 0 : workitemtracking: ttpdefectmigrationitemserializer:loaditem [02/06/2011 18:14:57] migrationconsole.exe information: 0 : workitemtracking: ttpdefectmigrationitemserializer:loaditem [02/06/2011 18:14:57] migrationconsole.exe information: 0 : workitemtracking: generating migration instruction for changegroup 4382 [02/06/2011 18:14:57] migrationconsole.exe information: 0 : workitemtracking: generating migration instruction for changegroup 4383 [02/06/2011 18:14:58] migrationconsole.exe information: 0 : workitemtracking: generating migration instruction for changegroup 4384 [02/06/2011 18:14:58] migrationconsole.exe information: 0 : workitemtracking: starting basic conflict detection [02/06/2011 18:14:58] migrationconsole.exe information: 0 : workitemtracking: finishing basic conflict detection [02/06/2011 18:14:58] migrationconsole.exe information: 0 : workitemtracking: loading 50 changegroup(s) [02/06/2011 18:14:58] migrationconsole.exe information: 0 : workitemtracking: ttpdefectmigrationitemserializer:loaditem [02/06/2011 18:14:58] migrationconsole.exe information: 0 : workitemtracking: ttpdefectmigrationitemserializer:loaditem [02/06/2011 18:14:58] migrationconsole.exe information: 0 : workitemtracking: ttpdefectmigrationitemserializer:loaditem [02/06/2011 18:14:58] migrationconsole.exe information: 0 : workitemtracking: target analysisprovider detecting conflicts in changegroup #4385 [02/06/2011 18:14:58] migrationconsole.exe information: 0 : workitemtracking: target analysisprovider detecting conflicts in changegroup #4386 [02/06/2011 18:14:58] migrationconsole.exe information: 0 : workitemtracking: target analysisprovider detecting conflicts in changegroup #4387 [02/06/2011 18:14:58] migrationconsole.exe information: 0 : workitemtracking: post-processing delta table entries from the migration source 90acdef5-e512-4df5-a680-cb2f386b08fd [02/06/2011 18:14:58] migrationconsole.exe information: 0 : workitemtracking: marking as 'deltacomplete' the target-side delta table for uni-directional session [02/06/2011 18:14:58] migrationconsole.exe information: 0 : workitemtracking: migrating to the migration source 90acdef5-e512-4df5-a680-cb2f386b08fd [02/06/2011 18:14:58] migrationconsole.exe information: 0 : workitemtracking: loading 50 changegroup(s) [02/06/2011 18:14:58] migrationconsole.exe information: 0 : workitemtracking: ttpdefectmigrationitemserializer:loaditem [02/06/2011 18:14:58] migrationconsole.exe information: 0 : workitemtracking: ttpdefectmigrationitemserializer:loaditem [02/06/2011 18:14:58] migrationconsole.exe information: 0 : workitemtracking: ttpdefectmigrationitemserializer:loaditem [02/06/2011 18:14:58] migrationconsole.exe information: 0 : workitemtracking: processing changegroup #4385, change 3284:0 [02/06/2011 18:14:58] migrationconsole.exe information: 0 : workitemtracking: connecting to 'http://tfs01.nwcadence.com:8080/tfs/sandbox' [02/06/2011 18:14:58] migrationconsole.exe information: 0 : workitemtracking: connected to 'http://tfs01.nwcadence.com:8080/tfs/sandbox' [02/06/2011 18:14:59] migrationconsole.exe information: 0 : workitemtracking: area 'testtrackpro\testtrackproimport\administrators desktop\installation' does not exist in the tfs work item store 'http://tfs01.nwcadence.com:8080/tfs/sandbox (testtrackpro)' or access is denied. [02/06/2011 18:15:00] migrationconsole.exe information: 0 : workitemtracking: wake up from 100 millisec sleep for polling css node id [02/06/2011 18:15:01] migrationconsole.exe information: 0 : workitemtracking: wake up from 500 millisec sleep for polling css node id [02/06/2011 18:15:01] migrationconsole.exe information: 0 : workitemtracking: created path 'testtrackpro\testtrackproimport\administrators desktop\installation'(id: 605) in the tfs work item store 'http://tfs01.nwcadence.com:8080/tfs/sandbox (testtrackpro)' [02/06/2011 18:15:01] migrationconsole.exe information: 0 : workitemtracking: iteration 'testtrackpro\testtrackproimport\expresso 2.5 sp3 cd5' does not exist in the tfs work item store 'http://tfs01.nwcadence.com:8080/tfs/sandbox (testtrackpro)' or access is denied. [02/06/2011 18:15:02] migrationconsole.exe information: 0 : workitemtracking: wake up from 100 millisec sleep for polling css node id [02/06/2011 18:15:03] migrationconsole.exe information: 0 : workitemtracking: wake up from 500 millisec sleep for polling css node id [02/06/2011 18:15:03] migrationconsole.exe information: 0 : workitemtracking: wake up from 500 millisec sleep for polling css node id [02/06/2011 18:15:04] migrationconsole.exe information: 0 : workitemtracking: created path 'testtrackpro\testtrackproimport\expresso 2.5 sp3 cd5'(id: 607) in the tfs work item store 'http://tfs01.nwcadence.com:8080/tfs/sandbox (testtrackpro)' [02/06/2011 18:15:04] migrationconsole.exe information: 0 : workitemtracking: workitem type 'bug' does not contain field 'tfsmigrationtool.reflectedworkitemid'. writing source item id will be skipped. [02/06/2011 18:15:04] migrationconsole.exe information: 0 : workitemtracking: connecting to 'http://tfs01.nwcadence.com:8080/tfs/sandbox' [02/06/2011 18:15:04] migrationconsole.exe information: 0 : workitemtracking: connected to 'http://tfs01.nwcadence.com:8080/tfs/sandbox' [02/06/2011 18:15:04] migrationconsole.exe error: 0 : workitemtracking: system.web.services.protocols.soapexception: index was out of range. must be non-negative and less than the size of the collection. [02/06/2011 18:15:04] parameter name: index ---> index was out of range. must be non-negative and less than the size of the collection. [02/06/2011 18:15:04] parameter name: index [02/06/2011 18:15:04] at microsoft.teamfoundation.workitemtracking.proxy.retryhandler.handlesoapexception(soapexception se) [02/06/2011 18:15:04] at microsoft.teamfoundation.workitemtracking.proxy.workitemserver.update(string requestid, xmlelement package, xmlelement& result, metadatatablehaveentry[] metadatahave, string& dbstamp, imetadatarowsets& metadata) [02/06/2011 18:15:04] at microsoft.teamfoundation.migration.tfs2010witadapter.tfs2010workitemserver.update(string requestid, xmlelement package, xmlelement& result, metadatatablehaveentry[] metadatahave, string& dbstamp, imetadatarowsets& metadata) [02/06/2011 18:15:04] at microsoft.teamfoundation.migration.tfs2010witadapter.tfsbatchupdatehelper.submit(int32 firstitem, int32 lastitem) [02/06/2011 18:15:05] migrationconsole.exe information: 0 : workitemtracking: unresolved conflict: [02/06/2011 18:15:05] session: 1c1faa2a-0d43-4381-b877-2df1d232694c [02/06/2011 18:15:05] source: 90acdef5-e512-4df5-a680-cb2f386b08fd [02/06/2011 18:15:05] message: cannot find applicable resolution rule. [02/06/2011 18:15:05] conflict type: tfs wit invalid submission conflict type [02/06/2011 18:15:05] conflict type reference name: c9d80b52-bb8a-4f7b-a40c-f8f63d6fd374 [02/06/2011 18:15:05] conflict details: <?xml version="1.0"?> [02/06/2011 18:15:05] <invalidsubmissionconflictdetails xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> [02/06/2011 18:15:05] <exceptiontype>system.web.services.protocols.soapexception</exceptiontype> [02/06/2011 18:15:05] <exceptionmessage>index was out of range. must be non-negative and less than the size of the collection. [02/06/2011 18:15:05] parameter name: index ---> index was out of range. must be non-negative and less than the size of the collection. [02/06/2011 18:15:05] parameter name: index</exceptionmessage> [02/06/2011 18:15:05] <innerexceptiontype /> [02/06/2011 18:15:05] <innerexceptionmessage /> [02/06/2011 18:15:05] <actiondata /> [02/06/2011 18:15:05] <sourceitemid>3284</sourceitemid> [02/06/2011 18:15:05] <sourceitemrevision>0</sourceitemrevision> [02/06/2011 18:15:05] </invalidsubmissionconflictdetails> [02/06/2011 18:15:05] [02/06/2011 18:15:05] [02/06/2011 18:15:05] migrationconsole.exe information: 0 : workitemtracking: processing changegroup #4386, change 3285:0 [02/06/2011 18:15:05] migrationconsole.exe information: 0 : workitemtracking: area 'testtrackpro\testtrackproimport\administrators desktop\bridges' does not exist in the tfs work item store 'http://tfs01.nwcadence.com:8080/tfs/sandbox (testtrackpro)' or access is denied. [02/06/2011 18:15:06] migrationconsole.exe information: 0 : workitemtracking: wake up from 100 millisec sleep for polling css node id [02/06/2011 18:15:06] migrationconsole.exe information: 0 : workitemtracking: wake up from 500 millisec sleep for polling css node id [02/06/2011 18:15:07] migrationconsole.exe information: 0 : workitemtracking: created path 'testtrackpro\testtrackproimport\administrators desktop\bridges'(id: 608) in the tfs work item store 'http://tfs01.nwcadence.com:8080/tfs/sandbox (testtrackpro)' [02/06/2011 18:15:07] migrationconsole.exe information: 0 : workitemtracking: workitem type 'bug' does not contain field 'tfsmigrationtool.reflectedworkitemid'. writing source item id will be skipped. [02/06/2011 18:15:07] migrationconsole.exe error: 0 : workitemtracking: system.web.services.protocols.soapexception: index was out of range. must be non-negative and less than the size of the collection. [02/06/2011 18:15:07] parameter name: index ---> index was out of range. must be non-negative and less than the size of the collection. [02/06/2011 18:15:07] parameter name: index [02/06/2011 18:15:07] at microsoft.teamfoundation.workitemtracking.proxy.retryhandler.handlesoapexception(soapexception se) [02/06/2011 18:15:07] at microsoft.teamfoundation.workitemtracking.proxy.workitemserver.update(string requestid, xmlelement package, xmlelement& result, metadatatablehaveentry[] metadatahave, string& dbstamp, imetadatarowsets& metadata) [02/06/2011 18:15:07] at microsoft.teamfoundation.migration.tfs2010witadapter.tfs2010workitemserver.update(string requestid, xmlelement package, xmlelement& result, metadatatablehaveentry[] metadatahave, string& dbstamp, imetadatarowsets& metadata) [02/06/2011 18:15:07] at microsoft.teamfoundation.migration.tfs2010witadapter.tfsbatchupdatehelper.submit(int32 firstitem, int32 lastitem) [02/06/2011 18:15:07] migrationconsole.exe information: 0 : workitemtracking: unresolved conflict: [02/06/2011 18:15:07] session: 1c1faa2a-0d43-4381-b877-2df1d232694c [02/06/2011 18:15:07] source: 90acdef5-e512-4df5-a680-cb2f386b08fd [02/06/2011 18:15:07] message: cannot find applicable resolution rule. [02/06/2011 18:15:07] conflict type: tfs wit invalid submission conflict type [02/06/2011 18:15:07] conflict type reference name: c9d80b52-bb8a-4f7b-a40c-f8f63d6fd374 [02/06/2011 18:15:07] conflict details: <?xml version="1.0"?> [02/06/2011 18:15:07] <invalidsubmissionconflictdetails xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> [02/06/2011 18:15:07] <exceptiontype>system.web.services.protocols.soapexception</exceptiontype> [02/06/2011 18:15:07] <exceptionmessage>index was out of range. must be non-negative and less than the size of the collection. [02/06/2011 18:15:07] parameter name: index ---> index was out of range. must be non-negative and less than the size of the collection. [02/06/2011 18:15:07] parameter name: index</exceptionmessage> [02/06/2011 18:15:07] <innerexceptiontype /> [02/06/2011 18:15:07] <innerexceptionmessage /> [02/06/2011 18:15:07] <actiondata /> [02/06/2011 18:15:07] <sourceitemid>3285</sourceitemid> [02/06/2011 18:15:07] <sourceitemrevision>0</sourceitemrevision> [02/06/2011 18:15:07] </invalidsubmissionconflictdetails> [02/06/2011 18:15:07] [02/06/2011 18:15:07] [02/06/2011 18:15:07] migrationconsole.exe information: 0 : workitemtracking: processing changegroup #4387, change 3243:0 [02/06/2011 18:15:07] migrationconsole.exe error: 0 : workitemtracking: system.formatexception: string was not recognized as a valid datetime. [02/06/2011 18:15:07] at system.datetimeparse.parse(string s, datetimeformatinfo dtfi, datetimestyles styles) [02/06/2011 18:15:07] at system.datetime.parse(string s, iformatprovider provider) [02/06/2011 18:15:07] at system.convert.todatetime(string value) [02/06/2011 18:15:07] at microsoft.teamfoundation.migration.tfs2010witadapter.tfsupdatedocument.addcolumn(xmlelement cs, string workitemtype, string fieldname, string fieldreferencename, string stringval) [02/06/2011 18:15:07] at microsoft.teamfoundation.migration.tfs2010witadapter.tfsupdatedocument.addfields(imigrationaction action, string workitemtype, string author, string changedtime, boolean insertworkitem) [02/06/2011 18:15:07] at microsoft.teamfoundation.migration.tfs2010witadapter.tfsmigrationworkitemstore.createnewworkitemoperation(imigrationaction action, conflictmanager conflictmgrservice) [02/06/2011 18:15:07] at microsoft.teamfoundation.migration.tfs2010witadapter.tfsmigrationworkitemstore.createupdateoperationdoc(imigrationaction action) [02/06/2011 18:15:07] at microsoft.teamfoundation.migration.tfs2010witadapter.tfsmigrationworkitemstore.submitchangeswithupdatedoc(changegroup changegroup, conversionresult changeresult, guid sourcesidesourceid) [02/06/2011 18:15:08] migrationconsole.exe information: 0 : workitemtracking: unresolved conflict: [02/06/2011 18:15:08] session: 1c1faa2a-0d43-4381-b877-2df1d232694c [02/06/2011 18:15:08] source: 90acdef5-e512-4df5-a680-cb2f386b08fd [02/06/2011 18:15:08] message: cannot find applicable resolution rule. [02/06/2011 18:15:08] conflict type: tfs wit invalid submission conflict type [02/06/2011 18:15:08] conflict type reference name: c9d80b52-bb8a-4f7b-a40c-f8f63d6fd374 [02/06/2011 18:15:08] conflict details: <?xml version="1.0"?> [02/06/2011 18:15:08] <invalidsubmissionconflictdetails xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> [02/06/2011 18:15:08] <exceptiontype>system.formatexception</exceptiontype> [02/06/2011 18:15:08] <exceptionmessage>string was not recognized as a valid datetime.</exceptionmessage> [02/06/2011 18:15:08] <innerexceptiontype /> [02/06/2011 18:15:08] <innerexceptionmessage /> [02/06/2011 18:15:08] <actiondata /> [02/06/2011 18:15:08] <sourceitemid>3243</sourceitemid> [02/06/2011 18:15:08] <sourceitemrevision>0</sourceitemrevision> [02/06/2011 18:15:08] </invalidsubmissionconflictdetails> [02/06/2011 18:15:08] [02/06/2011 18:15:08] [02/06/2011 18:15:08] migrationconsole.exe information: 0 : workitemtracking: processing linking delta [02/06/2011 18:15:08] migrationconsole.exe information: 0 : workitemtracking: migrating links to the migration source 90acdef5-e512-4df5-a680-cb2f386b08fd [02/06/2011 18:15:08] migrationconsole.exe warning: 0 : workitemtracking: unable to record sync point for migration source bcf2ef19-dbaf-48a3-bbd1-82424ef9d7f2 of session 1c1faa2a-0d43-4381-b877-2df1d232694c because lastmigratedtargetitem.itemid is null or empty [02/06/2011 18:15:08] migrationconsole.exe information: 0 : workitemtracking: [02/06/2011 18:15:08] migrationconsole.exe information: 0 : workitemtracking: workitemtracking: migration is done! [02/06/2011 18:15:08] migrationconsole.exe information: 0 : workitemtracking: session worker thread [workitemtracking] completed
figure: index was out of range. must be non-negative and less than the size of the collection
my last and only hope is that in all the development and debugging the i broke the tfs integration platform install, so i am going to:
- uninstall tfs integration platform
- clean “c:\program files (x86)\microsoft team foundation server integration tools” of all files
- check all locations where files are stored after the craziness that is getting the source for the tfs integration platform to build
figure: reinstalling the tfs integration platform is thankfully quick
so, that did not help and i am now getting two error messages for the data that i am parsing. both of which are coming from tfs and are realy confusing me. the first is a “index was out of range” error, which is just beyond me as i am not even passing any arrays.
[02/06/2011 21:47:22] migrationconsole.exe information: 0 : workitemtracking: processing changegroup #511, change 3270:1 [02/06/2011 21:47:22] migrationconsole.exe information: 0 : workitemtracking: workitem type 'bug' does not contain field 'tfsmigrationtool.reflectedworkitemid'. writing source item id will be skipped. [02/06/2011 21:47:22] migrationconsole.exe error: 0 : workitemtracking: system.web.services.protocols.soapexception: index was out of range. must be non-negative and less than the size of the collection. [02/06/2011 21:47:22] parameter name: index ---> index was out of range. must be non-negative and less than the size of the collection. [02/06/2011 21:47:22] parameter name: index [02/06/2011 21:47:22] at microsoft.teamfoundation.workitemtracking.proxy.retryhandler.handlesoapexception(soapexception se) [02/06/2011 21:47:22] at microsoft.teamfoundation.workitemtracking.proxy.workitemserver.update(string requestid, xmlelement package, xmlelement& result, metadatatablehaveentry[] metadatahave, string& dbstamp, imetadatarowsets& metadata) [02/06/2011 21:47:22] at microsoft.teamfoundation.migration.tfs2010witadapter.tfs2010workitemserver.update(string requestid, xmlelement package, xmlelement& result, metadatatablehaveentry[] metadatahave, string& dbstamp, imetadatarowsets& metadata) [02/06/2011 21:47:22] at microsoft.teamfoundation.migration.tfs2010witadapter.tfsbatchupdatehelper.submit(int32 firstitem, int32 lastitem) [02/06/2011 21:47:23] migrationconsole.exe information: 0 : workitemtracking: unresolved conflict: [02/06/2011 21:47:23] session: 583c945a-b2b8-4de3-8090-4a3126506984 [02/06/2011 21:47:23] source: 3e1cfab9-910a-4a92-8c7a-25ff05ac5f48 [02/06/2011 21:47:23] message: cannot find applicable resolution rule. [02/06/2011 21:47:23] conflict type: tfs wit invalid submission conflict type [02/06/2011 21:47:23] conflict type reference name: c9d80b52-bb8a-4f7b-a40c-f8f63d6fd374 [02/06/2011 21:47:23] conflict details: <?xml version="1.0"?> [02/06/2011 21:47:23] <invalidsubmissionconflictdetails xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> [02/06/2011 21:47:23] <exceptiontype>system.web.services.protocols.soapexception</exceptiontype> [02/06/2011 21:47:23] <exceptionmessage>index was out of range. must be non-negative and less than the size of the collection. [02/06/2011 21:47:23] parameter name: index ---> index was out of range. must be non-negative and less than the size of the collection. [02/06/2011 21:47:23] parameter name: index</exceptionmessage> [02/06/2011 21:47:23] <innerexceptiontype /> [02/06/2011 21:47:23] <innerexceptionmessage /> [02/06/2011 21:47:23] <actiondata /> [02/06/2011 21:47:23] <sourceitemid>3270</sourceitemid> [02/06/2011 21:47:23] <sourceitemrevision>1</sourceitemrevision> [02/06/2011 21:47:23] </invalidsubmissionconflictdetails>
figure: index was out of range. must be non-negative and less than the size of the collection
the second is a date format exception that i would have thought should be taken care of by the integration platform and not wait until it gets to tfs.
[02/06/2011 21:47:23] migrationconsole.exe information: 0 : workitemtracking: processing changegroup #512, change 3173:1 [02/06/2011 21:47:23] migrationconsole.exe error: 0 : workitemtracking: system.formatexception: string was not recognized as a valid datetime. [02/06/2011 21:47:23] at system.datetimeparse.parse(string s, datetimeformatinfo dtfi, datetimestyles styles) [02/06/2011 21:47:23] at system.datetime.parse(string s, iformatprovider provider) [02/06/2011 21:47:23] at system.convert.todatetime(string value) [02/06/2011 21:47:23] at microsoft.teamfoundation.migration.tfs2010witadapter.tfsupdatedocument.addcolumn(xmlelement cs, string workitemtype, string fieldname, string fieldreferencename, string stringval) [02/06/2011 21:47:23] at microsoft.teamfoundation.migration.tfs2010witadapter.tfsupdatedocument.addfields(imigrationaction action, string workitemtype, string author, string changedtime, boolean insertworkitem) [02/06/2011 21:47:23] at microsoft.teamfoundation.migration.tfs2010witadapter.tfsmigrationworkitemstore.createnewworkitemoperation(imigrationaction action, conflictmanager conflictmgrservice) [02/06/2011 21:47:23] at microsoft.teamfoundation.migration.tfs2010witadapter.tfsmigrationworkitemstore.createupdateoperationdoc(imigrationaction action) [02/06/2011 21:47:23] at microsoft.teamfoundation.migration.tfs2010witadapter.tfsmigrationworkitemstore.submitchangeswithupdatedoc(changegroup changegroup, conversionresult changeresult, guid sourcesidesourceid) [02/06/2011 21:47:23] migrationconsole.exe information: 0 : workitemtracking: unresolved conflict: [02/06/2011 21:47:23] session: 583c945a-b2b8-4de3-8090-4a3126506984 [02/06/2011 21:47:23] source: 3e1cfab9-910a-4a92-8c7a-25ff05ac5f48 [02/06/2011 21:47:23] message: cannot find applicable resolution rule. [02/06/2011 21:47:23] conflict type: tfs wit invalid submission conflict type [02/06/2011 21:47:23] conflict type reference name: c9d80b52-bb8a-4f7b-a40c-f8f63d6fd374 [02/06/2011 21:47:23] conflict details: <?xml version="1.0"?> [02/06/2011 21:47:23] <invalidsubmissionconflictdetails xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> [02/06/2011 21:47:23] <exceptiontype>system.formatexception</exceptiontype> [02/06/2011 21:47:23] <exceptionmessage>string was not recognized as a valid datetime.</exceptionmessage> [02/06/2011 21:47:23] <innerexceptiontype /> [02/06/2011 21:47:23] <innerexceptionmessage /> [02/06/2011 21:47:23] <actiondata /> [02/06/2011 21:47:23] <sourceitemid>3173</sourceitemid> [02/06/2011 21:47:23] <sourceitemrevision>1</sourceitemrevision> [02/06/2011 21:47:23] </invalidsubmissionconflictdetails>
figure: string was not recognized as a valid datetime
i have even checked the output that is sent to the tfs web service and i can’t see anything that jumps out as a problem…
<?xml version="1.0" encoding="utf-8"?> <insertworkitem objecttype="workitem" bypassrules="1"> <columns> <column column="system.title"> <value>there is a typing mistake in product diagnostic logging status messge</value> </column> <column column="microsoft.vsts.common.priority" type="number"> <value>3</value> </column> <column column="system.state"> <value>proposed</value> </column> <column column="microsoft.vsts.common.howfoundcategory"> <value>manual testing</value> </column> <column column="microsoft.vsts.common.severity"> <value>4</value> </column> <column column="system.changeddate" type="datetime"> <value>2011-02-06t20:34:00</value> </column> <column column="microsoft.vsts.common.createddate" type="datetime"> <value>2011-02-06t20:34:00</value> </column> <column column="system.assignedto"> <value>hinshelwood, martin; borg, steven</value> </column> <column column="system.areaid" type="number"> <value>108</value> </column> <column column="system.iterationid" type="number"> <value>212</value> </column> <column column="system.workitemtype"> <value>bug</value> </column> <column column="system.createddate" type="serverdatetime"> <value></value> </column> <column column="system.createdby"> <value>hinshelwood, martin</value> </column> <column column="system.changedby"> <value>hinshelwood, martin</value> </column> <column column="system.reason"> <value>unknown</value> </column> </columns> <inserttext fieldname="system.description" fielddisplayname="description">lorem ipsum dolor sit amet, consectetur adipiscing elit. aliquam at massa sem. sed elementum, nisl sed bibendum consequat, justo libero sodales elit, a vehicula orci lorem et dui. lorem ipsum dolor sit amet, consectetur adipiscing elit. vestibulum sit amet metus orci. aenean vulputate condimentum lectus, vel vulputate sem aliquam quis.</inserttext> <inserttext fieldname="microsoft.vsts.tcm.reprosteps" fielddisplayname="repro steps">nullam in risus sed diam tincidunt fermentum sit amet non enim. vestibulum tempus nibh eget nulla viverra iaculis. in a dolor ligula. sed eget sem tellus, in tempor nisi. maecenas venenatis cursus eros id rutrum. nulla tristique, lectus a imperdiet vehicula, metus sapien mattis urna, a bibendum ligula nunc et nibh. curabitur adipiscing hendrerit odio vel ornare.</inserttext> <inserttext fieldname="system.history" fielddisplayname="history"> <p>this is a dump of the original ttp data</p> <p>imported by http://nwcadence.com</p> <p>(tfs integration from 'testtrackpro source' id: 3280 (rev 1);)</p> </inserttext> </insertworkitem>
in order to find out what is happening with the data (changegroups) you can run the following query against your tfs_integrationplatform database:
select grp.name ,grp.status ,[changeactionid] ,[actionid] ,[sourceitem] ,[frompath] ,[version] ,[actiondata] ,[backlogged] from [tfs_integrationplatform].[dbo].[runtime_change_action] as act join [tfs_integrationplatform].[dbo].[runtime_change_groups] as grp on act.changegroupid = grp.id where grp.id = '3251' or grp.id = '3255'
this will show you the actual data that is stored in the middle tier and allow you to maybe debug it. the result?
<workitemchanges revision="1" workitemtype="bug" author="hinshelwood, martin" changedate="02/06/2011 13:03:00" workitemid="3268"> <columns> <column displayname="summary" referencename="system.title" type="string"> <value>some long text</value> </column> <column displayname="priority" referencename="microsoft.vsts.common.priority" type="string"> <value>1</value> </column> <column displayname="status" referencename="system.state" type="string"> <value>proposed</value> </column> <column displayname="found by" referencename="microsoft.vsts.common.howfoundcategory" type="string"> <value>manual testing</value> </column> <column displayname="severity" referencename="microsoft.vsts.common.severity" type="string"> <value>1</value> </column> <column displayname="date modified" referencename="system.changeddate" type="string"> <value>6/2/2011 1:03 pm</value> </column> <column displayname="date created" referencename="microsoft.vsts.common.createddate" type="string"> <value>6/1/2011 11:38 am</value> </column> <column displayname="description" referencename="system.description" type="string"> <value>some long text</value> </column> <column displayname="steps to reproduce" referencename="microsoft.vsts.tcm.reprosteps" type="string"> <value>some long text</value> </column> <column displayname="assigned to user" referencename="system.assignedto" type="string"> <value>dann, ron</value> </column> <column displayname="history" referencename="system.history" type="string"> <value>long histry that has been trunkated... </value> </column> <column referencename="system.areapath" type="" displayname=""> <value>testtrackproimport\globalization\reporting</value> </column> <column referencename="system.iterationpath" type="" displayname=""> <value>testtrackproimport\product 2.5</value> </column> </columns> </workitemchanges>
this data is what is actually produced as a change to be saved to tfs. i am a little concerned that the dates are in a variety of formats, but it was one of the ones that resulted in the “index” error:
[02/06/2011 21:47:22] migrationconsole.exe error: 0 : workitemtracking: system.web.services.protocols.soapexception: index was out of range. must be non-negative and less than the size of the collection. [02/06/2011 21:47:22] parameter name: index ---> index was out of range. must be non-negative and less than the size of the collection. [02/06/2011 21:47:22] parameter name: index [02/06/2011 21:47:22] at microsoft.teamfoundation.workitemtracking.proxy.retryhandler.handlesoapexception(soapexception se) [02/06/2011 21:47:22] at microsoft.teamfoundation.workitemtracking.proxy.workitemserver.update(string requestid, xmlelement package, xmlelement& result, metadatatablehaveentry[] metadatahave, string& dbstamp, imetadatarowsets& metadata) [02/06/2011 21:47:22] at microsoft.teamfoundation.migration.tfs2010witadapter.tfs2010workitemserver.update(string requestid, xmlelement package, xmlelement& result, metadatatablehaveentry[] metadatahave, string& dbstamp, imetadatarowsets& metadata) [02/06/2011 21:47:22] at microsoft.teamfoundation.migration.tfs2010witadapter.tfsbatchupdatehelper.submit(int32 firstitem, int32 lastitem) [02/06/2011 21:47:22] migrationconsole.exe information: 0 : workitemtracking: unresolved conflict: [02/06/2011 21:47:22] session: 583c945a-b2b8-4de3-8090-4a3126506984 [02/06/2011 21:47:22] source: 3e1cfab9-910a-4a92-8c7a-25ff05ac5f48 [02/06/2011 21:47:22] message: cannot find applicable resolution rule. [02/06/2011 21:47:22] conflict type: tfs wit invalid submission conflict type [02/06/2011 21:47:22] conflict type reference name: c9d80b52-bb8a-4f7b-a40c-f8f63d6fd374 [02/06/2011 21:47:22] conflict details: <?xml version="1.0"?> [02/06/2011 21:47:22] <invalidsubmissionconflictdetails xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> [02/06/2011 21:47:22] <exceptiontype>system.web.services.protocols.soapexception</exceptiontype> [02/06/2011 21:47:22] <exceptionmessage>index was out of range. must be non-negative and less than the size of the collection. [02/06/2011 21:47:22] parameter name: index ---> index was out of range. must be non-negative and less than the size of the collection. [02/06/2011 21:47:22] parameter name: index</exceptionmessage> [02/06/2011 21:47:22] <innerexceptiontype /> [02/06/2011 21:47:22] <innerexceptionmessage /> [02/06/2011 21:47:22] <actiondata /> [02/06/2011 21:47:22] <sourceitemid>3268</sourceitemid> [02/06/2011 21:47:22] <sourceitemrevision>1</sourceitemrevision> [02/06/2011 21:47:22] </invalidsubmissionconflictdetails>
hopefully someone on the team will be able to help me out, but so far i have not been able to get this running…
Published at DZone with permission of Martin Hinshelwood, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Trending
-
Explainable AI: Making the Black Box Transparent
-
Reducing Network Latency and Improving Read Performance With CockroachDB and PolyScale.ai
-
4 Expert Tips for High Availability and Disaster Recovery of Your Cloud Deployment
-
What ChatGPT Needs Is Context
Comments