Modify

Opened 20 months ago

Last modified 14 months ago

#10905 new defect

Hudson 3.0.0 no longer supports /api/python interface

Reported by: c.jones@… Owned by: roadrunner
Priority: normal Component: HudsonTracPlugin
Severity: major Keywords:
Cc: Trac Release: 0.11

Description (last modified by rjollos)

The HudsonTracPlugin requires that hudson makes available the API for python on the URL /api/python at the moment, however now that Eclipse have taken on hudson, and version 3.0.0 has been released, the python API is no longer supported. Once hudson is upgraded to version 3.0.0 you get this error in the TRAC timeline:

Trac Error

Hudson Builds event provider (HudsonTracPlugin) failed:
IOError: Error getting build info from 
'http://myserver:8080/job/jobname/api/python?
tree=builds[building,timestamp,duration,result,description,url,
fullDisplayName,changeSet[items[revision,id,user,author[fullName]]],
culprits[fullName],actions[causes[userName]]]': 
HTTPError: HTTP Error 404: Not Found. 
This most likely means you configured a wrong job_url, username, or password.

See discussion here, that explains the python interface is no longer supported:
http://www.eclipse.org/forums/index.php/t/457665/

Apparently though, the api is almost identical to the JSON interface anyway, so perhaps HudsonTracPlugin can be fairly easily modified to point to /api/json instead?

Attachments (0)

Change History (4)

comment:1 Changed 20 months ago by rjollos

  • Description modified (diff)

comment:2 follow-up: Changed 14 months ago by tcfenstermaker

Without this fix, this plug-in is completely broken (and in fact it breaks the timeline feature in Trac as noted in the bug and thus is actually disruptive). So, made a fix for this myself, replacing the python API with the one for JSON, and also replacing the code used to handle the HTTP calls with the requests library (from python-requests.org). It works fine for my Hudson installation but it probably needs more testing against other configurations of Hudson and Jenkins. Also, since this is my first time writing python, I could use a little coaching in how to make sure I bundle it correctly so it knows the requests library is now a dependency.

Can someone help me with those two items? Then I could give this code to whoever runs this project and have them update it as the next release.

Last edited 14 months ago by tcfenstermaker (previous) (diff)

comment:3 in reply to: ↑ 2 Changed 14 months ago by rjollos

Replying to tcfenstermaker:

[...] Also, since this is my first time writing python, I could use a little coaching in how to make sure I bundle it correctly so it knows the requests library is now a dependency.

You'll just need to add an entry in install_requires. Here is an example, and the relevant documentation for setuptools.

Can someone help me with those two items? Then I could give this code to whoever runs this project and have them update it as the next release.

It will probably be easiest if you just attach the code to this ticket, or give us a link to a fork of the code in GitHub, BitBucket, etc...

comment:4 Changed 14 months ago by tcfenstermaker

Thanks for the help rjollos; I'll try to get to this this week. I'll probably just attach the code to the ticket, as it's only one module. I just need to clean it up a bit.

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.