programmatical GForge upload and download

94 Views Asked by At

INTRODUCTION

I am part of a project team which uses an old GForge system (community edition v5.6.1) to host our source code and provide some further services. One builtin service is the upload and download feature. Thus users can easily get the generated application version. In order to provide this downloadable version, we as developers have to use a browser (e.g. IE or FF) to navigate into the appropriate GForge page, then tick some buttons, fill some text boxes and finally hit an "upload" button which opens a file dialog to specify any file to be uploaded into the GForge download area. For a download, the procedure is similar. Additionally, from time to time there comes a separate WEB page to request a session login.

Now, as we as developers are in a "hot phase" and need to provide downloadable versions with high frequency, the procedure described above is much too error-prone concerning essential parts of the release, and too slow. Besides that, there is always a real person necessary in front of the screen to click around.

QUESTION

How can we manage to programmatically upload and download generated software versions into and out of GForge's download area while overcoming the password page on the first hand (of course using a valid user account)?

WHAT WE'VE TRIED SO FAR

Using a Python script. Python provides very helpful modules like "urllib", "urllib2" and "requests", with which any HTTP access (even the ones with session password protection) should be managable. After many hours of trying, the GForge system only returns the password request page. Not any of the interesting files. Even far away from uploading anything.

Using an AutoIt script. AutoIt can automate mouse movements and keyboard presses as well as direct access of visible elements on the screen. It provides a "Window Info" application to identify any window element. But e.g. buttons and text fields within WEB pages (HTML) are not recognized. So we don't know how to correctly identify GForge's password text field in order to move the mouse there, and type in the necessary text. And from there go on imitating the person sitting in front of the screen.

Does anybody have some experience regarding the solution of our problem?

1

There are 1 best solutions below

0
On

I'd upgrade your system to v6.4.2 (current GForge version). From there you will have access to the SOAP interface which will make all this possible. When GForgeNEXT is released, https://next.gforge.com, the SOAP interface will be replace by a REST-ful API making this integration even easier.

The upgrade to v6.4.2 from 5.6.x will be a bit painful but our team would be happy to help, just create an account on gforge.com and then open a free support ticket here:

https://gforge.com/gf/project/gforge5/tracker/?action=TrackerItemBrowse&tracker_id=10345

Disclaimer: My company manages GForge so the advice given above I'd give to any paying client. For further clarity, files in GForge are stored in the file system. The SOAP interface allows you to reach into the database for any ticket or document grab the appropriate document and even replace it. Programatically, it is the cleanest answer.