Feature Requests: Browse | Submit New | Admin

[#79] Write utility to convert SF RFEs

Date:
2003-09-08 20:20
Priority:
3
Submitted By:
Tom Copeland (tom)
Assigned To:
Tom Copeland (tom)
Category:
None
State:
Open
Summary:
Write utility to convert SF RFEs

Detailed description
Tracking this here...

tom

Add A Comment: Notepad

Please login


Followup

Message
Date: 2004-08-13 21:12
Sender: Tom Copeland

Logged In: YES 
user_id=102

FYI, I'm going on vacation 8/15 - 8/22... but when I return I
shall work on this with redoubled energy!

Yours,

Tom
Date: 2004-08-12 19:40
Sender: Tom Copeland

Logged In: YES 
user_id=102

Got the XML export... can extract (for example) open RFEs with
REXML and an XPath query.  Onwards:

- dig up my old SOAP client code
- see what we want to add 
-- is adding just the summary and the description OK
-- what about all the messages?  Add them?
-- will this still work with GForge 3.3?

tom
Date: 2004-08-11 13:36
Sender: Tom Copeland

Logged In: YES 
user_id=102

Hm, isn't there a little thingy at the bottom of the page - i.e.
"Check to Upload & Attach File"?

Or you can just email it to me at tom@infoether.com; that'll
work too...

Thanks,

Tom
Date: 2004-08-11 00:26
Sender: Lyle Johnson

Logged In: YES 
user_id=384

I don't see an option to attach file(s), and my SourceForge project
export is a little large (about 450k) to simply paste into this
message. I can mail it to Tom separately if he would like to
attach it to this thread.
Date: 2004-08-10 16:33
Sender: Tom Copeland

Logged In: YES 
user_id=102

Lyle, if you get a chance, pls do the SF export thing and attach
it to this RFE.  Then we'll have some good data to work on...

Thanks,

tom
Date: 2004-08-10 16:27
Sender: Tom Copeland

Logged In: YES 
user_id=102

Hey Lyle -

OK, here's the current SOAP API:

http://rubyforge.org/soap/SoapAPI.php

Note that there are rfeAdd and an rfeAddMessage operations. 
Those are the ones we can use mostly... of course, we'd need
to add new ones for bugs/patches.

I've added some files to the support project CVS repo - these
are the server-side files for the SOAP API:

http://rubyforge.org/cgi-bin/viewcvs/cgi/viewcvs.cgi/support/soap
/?cvsroot=support

Need to hunt down my old Ruby client examples....

Yours,

Tom
Date: 2003-10-03 22:57
Sender: Tom Copeland

Logged In: YES 
user_id=102

Moving to RFEs....
Date: 2003-09-10 16:45
Sender: Tom Copeland

Logged In: YES 
user_id=102

Better yet, to get only the open RFEs:

[tom@hal gft]$ cat clean.rb
#!/usr/local/bin/ruby
require 'rexml/document'
xml=REXML::Document.new File.new "trackertest.xml"
puts "<project_export>"
puts "<artifacts>"
xml.elements.each("//project_export/artifacts/artifact[field
[@name='artifact_type'][text()='Feature
Requests'] and field[@name='status'][text()='Open']]") {
|e| puts e }
puts "</artifacts>"
puts "</project_export>"
[tom@hal gft]$
Date: 2003-09-10 15:27
Sender: Tom Copeland

Logged In: YES 
user_id=102

This way is much faster - 18 seconds vs 48 minutes:

===============
[tom@hal gft]$ cat clean.rb
#!/usr/local/bin/ruby
require 'rexml/document'
xml=REXML::Document.new File.new "trackertest.xml"
puts "<project_export>"
puts "<artifacts>"
xml.elements.each("//project_export/artifacts/artifact/field
[@name='artifact_type']")
{ |element|
        if element.get_text == "Feature Requests"
                puts element.parent
        end
}
puts "</artifacts>"
puts "</project_export>"
[tom@hal gft]$
===============
Date: 2003-09-09 21:01
Sender: Tom Copeland

Logged In: YES 
user_id=102

Yay, it works!  Albeit clunkily.
Date: 2003-09-09 15:45
Sender: Tom Copeland

Logged In: YES 
user_id=102

SOAP ops:

- log in
- new rfe (summary, details)
- loop: add_anonymous_message(body)
- set_status (open/closed/pending/deleted)
Date: 2003-09-09 15:33
Sender: Tom Copeland

Logged In: YES 
user_id=102

48 minutes to extract the feature requests.  Yikes.  Maybe
I'll just stick with grep.
Date: 2003-09-08 20:51
Sender: Tom Copeland

Logged In: YES 
user_id=102

Need to convert:

artifact
-summary
-status
-details

artifact_messages
-field[@name=body]
-field[@name=adddate] - convert to a readable timestep in
body field
-field[@name=user_name] - put in field body field
Date: 2003-09-08 20:45
Sender: Tom Copeland

Logged In: YES 
user_id=102

1 get xml export
2 delete all but artifacts
3 filter out all but RFEs 

Step 3 takes a long time with REXML... a 1.1 MB has run for
13 minutes without finishing up.  Here's the code I'm using:

require 'rexml/document'

xml=REXML::Document.new File.new "trackertest.xml"

docu=REXML::Document.new
exportel = docu.add_element("project_export")
artifactsel = exportel.add_element("artifacts")

xml.elements.each("//project_export/artifacts/artifact/field
[@name='artifact_type']")
{ |element|
        if element.get_text == "Feature Requests"
                puts "Added one!"
                artifactsel << element.parent
        end
}

puts docu



Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
assigned_tonone2004-08-10 16:27tom
assigned_totom2003-10-03 22:57tom