New features in GForge 5.7

GForge 5.7 was released on April 20th and it sports several fixes and new features. Some of the most interesting are:

  • Item tagging is present throughout the system, and you can now search for items by tags.
  • Tabs administration: you can specify which tabs will be shown in trackers, documents and forums.
  • A project’s source code can be indexed using doxygen, and you can search for keywords in the source code. This is integrated within the regular search interface.
  • Captchas to prevent automatic account creation and forum posts (optional).
  • New serial type field in tracker.
  • Quick jump menu implemented in AJAX to increase performance.
  • New translation for Brazilian portuguese and updated translations for French, German and Italian.
  • Support for nss-pgsql. This allows for automatic updating of user permissions instead of relying on a cronjob.
  • Full git plugin installed by default.

You can download GForge 5.7 from the download page.

GForge AS provides support for Visual Studio 2010

Microsoft has just released Visual Studio 2010, which includes .NET Framework 4.0.  GForge concurrently launched  its plugin for the new Visual Studio edition.   The plugin seamlessly integrates to the VS IDE, allowing the developer quick and convenient access to trackers and documents on the GForge AS server.

How do you install the plugin?

The plugin installs like any regular windows application, it provides an installer included in the executable file.   Once the plugin is installed, you can access it on the “View” menu item in Visual Studio 2010.

Clicking on “GForge Trackers” brings the dialog box.  The first time you launch it, you must enter the serial number for the plugin to validate, and set the server domain name.   The username and password are your regular credentials you use to access the GForge AS Web frontend.   For improved security, you can set it to use SSL (this requires SSL to be configured on the server).


After logging  in successfully, the main panel opens.  You can set it to be a floating panel or hook it to a Visual Studio IDE container.   It displays a tree view  of the projects you have access to, with their corresponding trackers and document folders.


The Tracker panel:

This is where most of the developer’s activity takes place.   Selecting for Instance the “Support” tracker, opens the panel displayed below.  By default it will show all the tracker items:

However, for convenience you may need to filter the tracker items shown by certain criteria.  For instance, if you want only the open items assigned to you:

In case you need more complex filters, GForge provides the “saved queries” feature, which is also present in the Visual Studio plugin.  You can use any saved query from the GForge server for the current tracker. Just select the query from the drop panel and the items list will refresh automatically:

The same screen in GForge AS web interface:

You can create (or edit) your own query directly from your desktop using the plugin’s built-in saved query editor.  To add or edit queries, press the “Manage” button, a new panel will be opened:

(this is a partial view of the query edit form)

You can set any of the available fields in any combination to act as filters.   To save the query, just press the save button on the top menu of the panel and the saved query will be ready to be used on the corresponding tracker panel.


The tracker item panel:

You can both edit / add tracker items to the project’s  trackers.  The following screen shows a tracker item edit window.  It provides the same functionality found on GForge’s AS web interface.  All the default and user created fields for each tracker are present.  The “Edit” tab contains the basic tracker item fields, such as summary, description, assignees, dates, priorities and any custom or user created field.

The rest of the tabs provide additional functions, such as:

  • Messages: allows to post follow-ups to the tracker item
  • Attachments:  upload file attachments to the tracker item
  • Change Log: shows the list of changes on the tracker item (displays date of change, field changed and old/new values)
  • Commits: shows the commits made against this tracker item
  • Dependencies: shows what tracker items the current tracker item is dependent on.  Allows to add dependencies.
  • Duplicates: shows duplicates of the current tracker items.  Allows to add new duplicates.
  • Associations: shows associated elements to this tracker item.  Elements that can be associated are: tracker items, documents, package releases and wiki pages.  Allows to add new associations.
  • Time Tracking: shows time entries made on this tracker item, allows to set new time entries.
  • Tags: shows the current tags assigned to the tracker item, allows to set new tags.


The tags tab:

We will briefly discuss the tags tab in the tracker item panel.  This is a new feature in GForge AS 5.7.  It lets you assign tags to items (tracker items, documents, form messages, etc).  Each tag is a single word (no spaces), and they can be searched by GForge’s search engine.  This feature lets you easily retrieve related items with more precision.
Let’s see a simple example: suppose we have a tracker item in the “Bugs” tracker.  The item describes a potential bug informed by a user, that imposes a vulnerability due to a bad validation on the user interface .  We could assign the following tags to it: “gui”,”validation”, “vulnerability”.  If you wanted to, for instance,  know which of the bugs refer to vulnerabilities related to the user interface, you could do a tags search on GForge with “gui” + “vulnerability”, or “validation” +”gui”, etc.  Of course, for this to be useful there must be some consensus among the developers about how to name tags.
The following screenshots shows the tags form, we are about to insert the tags of the example. Tags must be separated by a space:

After press pressing “Add Tags”:


Document Manager:

The document manager features of GForge’s VS 2010 plugin let you access the project’s document repository on the GForge server.  It provides the full power of GForge’s document management capabilities, such as:

  • Document versioning: you can create new document versions, download specific versions, remove versions.
  • Associate a document with tracker items, other documents, FRS releases, wiki pages.
  • Block / unblock access to a document


Adding / deleting folders:

You can create a new folder anywhere on the folder tree structure:
Right click on the parent folder:

Then enter the folder name and the folder tree will by synchronized with the  server:


Adding a new document:

Double click on the folder name where you want to add the new document, a new panel opens, showing the folder contents:

The toolbar shows four icons:

refresh the panel.  It synchronizes the panel contents with the server.


new document. Opens the new document panel.

delete a document. Select a document and click this icon for deletion.

download document. Select a document and click this icon, it downloads the latest document version.

Editing an existing document:

From the folder panel  shown in the previous screenshot, we select the document to edit double clicking on the corresponding row. The document panels open:

We then go to the “Versions” tab:

The “Versions” tab shows the all the stored document versions, with their date, changes log, etc.  To create a new version, we first download the latest version (or the version we want to be our starting point for editing), by selecting the version and then clicking “Download Version”.

After we have edited the file, we upload it back:

Uploading a new version is as simple as selecting the file from the filesystem, entering the changes description and clicking “Add Version”.

Associating the document with a Tracker Item:
As we mentioned before, you can associate a document with other items within the project.  In this example we will associate our document with a tracker item from the “Bugs” tracker.

Let’s suppose we want to associate the “Sample Bug Item 1″ tracker item to our document, so we go to the “Associations” tab in the document panel  and enter the “Ref ID” field, which is the tracker item’s ID (shown on the tracker items panel), then we select “Tracker Item” as section and we can enter a comment, to describe the purpose of the association.  Finally, we click “Add New” to save it.

Important: the procedure we did for adding the association, only saves it locally on the plugin. To commit the changes to the GForge server we must press the “save” icon on the top-left side of the panel.

Project settings:

This is another new feature present in GForge 5.7 that was added to the new releases of the Visual Studio plugin (2005, 2008 and 2010 versions).   The project administrator can enable / disable tabs for:

  • Enable/disable association tab both on individual tracker an in document manager
  • Enable/disable tags tab both on individual tracker an in document manager
  • Enable/disable dependencies tab on individual tracker
  • Enable/disable duplicates tab on individual tracker
  • Enable/disable time tracking  tab on individual tracker

You can only change those settings from the GForge web interface, and only if you are a project or site administrator.   When you log in to the plugin, the settings are retrieved from the server and applied.


git support in GForge

GForge provides full support for the git SCM (Source Code Management) tool, in addition to SVN and CVS.

Unlike SVN and CVS, git is a distributed tool where each user has a copy of the full repository in his or her machine. The basic workflow of git involves committing changes against the local repository and sharing the changes via pull and push operations.

Since commits in the local repositories cannot be “seen” by the GForge server, GForge sets up a global, centralized (“bare”) repository where the changes can be pushed to.

Setting up your project for git

To enable git support for your project, you need to be logged in as a project administrator. Get into the “Admin” section of the project, and select “GIT” as the SCM tool. Click the “Submit button”.

This will create a bare git repository in the GForge server. This may take up to 15 minutes, you can check if the repository was created by clicking on the “Git” section in the project. If you get the message “The SCM repository for this project hasn’t been created yet”, you need to wait a couple of minutes.

Once the repository is created, you will see the empty repository in the Git section:

Adding the initial data

At this point, the git repository is empty and is not very useful, so some data must be imported first. You will have to push an existing local git repository into the GForge repository.

For example, let’s assume you have an existing repository with source code in HOME/myrepo:

$ ls -a ~/myrepo
. .. bin conf cronjobs .git languages lib README.txt wwwlib

This is a working directory with the source code and the git repository is stored under the .git subdirectory.

Now, if you want to import this repository into the GForge project, you need to use the git push command, but first, you need to find out what’s the repository location (i.e. what’s the full URI for the repository in the GForge server). In the project, click on the Git section and then click on the Access info page. This wil give you the URI for the repository:

Note that the URI that’s used to clone the repository is the same you’ll use to push the changes.

So, with this information in hand, you can now push your repository to the GForge server:

~/myrepo$ git push ssh://<username>@<gforge_server>/gitroot/gitproject1 master
<username>@<gforge5.vm>'s password: <your GForge password here>
Counting objects: 113, done.
Compressing objects: 100% (104/104), done.
Writing objects: 100% (113/113), 86.39 KiB, done.
Total 113 (delta 51), reused 0 (delta 0)
To ssh://<username>@<gforge_server>/gitroot/gitproject1
* [new branch] master -> master

Note that this will only push the master branch to the repository.

The changes you’ve pushed will now be visible when you browse the repository:

Working with the git repository

Once the repository has some code, users can start working with it. For this, they must clone the repository from the GForge server. This is done with the git clone command as seen on the “Access info” page:


$ git clone ssh://<username>@<gforge_server>/gitroot/gitproject1
Initialized empty Git repository in /home/marcelo/gitproject1/.git/
<username>@<gforge_server>'s password: <your GForge password here>
remote: Counting objects: 113, done.
remote: Compressing objects: 100% (53/53), done.
remote: Total 113 (delta 51), reused 113 (delta 51)
Receiving objects: 100% (113/113), 85.51 KiB, done.
Resolving deltas: 100% (51/51), done.

This will create a directory with the project’s name (in this case gitproject1) with a local copy of the full repository.

The basic workflow with git involves 4 steps:

  1. Pulling changes from the GForge repository and updating the code
  2. Changing the source code
  3. Committing changes against the local repository
  4. Pushing changes to the GForge repository

For example, suppose someone has changed a files in their local repository and pushed them to the GForge server. The following describes a typical git session:


~/gitproject1$ git pull
remote: Counting objects: 7, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 3), reused 0 (delta 0)
Unpacking objects: 100% (4/4), done.
From ssh://<username>@<gforge_server>/gitroot/gitproject1
70aa173..9450e42 master -> origin/master
Updating 70aa173..9450e42
Fast forward
wwwlib/index.php | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
~/gitproject1$ vi lib/ScmgitPlugin.php
(... edit, edit, edit...)
~/gitproject1$ git commit -a -m "Fixed bug [#16]"
Created commit d1a4acb: Fixed bug [#16]
1 files changed, 1 insertions(+), 0 deletions(-)
~/gitproject1$ vi cronjobs/create_git.php
(... edit, edit, edit...)
~/gitproject1$ git commit -a -m "Fixed another bug [#17]"
Created commit b8b281d: Fixed another bug [#17]
1 files changed, 4 insertions(+), 2 deletions(-)
~/gitproject1$ git push origin master
Counting objects: 13, done.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (8/8), 777 bytes, done.
Total 8 (delta 5), reused 0 (delta 0)
To ssh://<username>@<gforge_server>/gitroot/gitproject1
9450e42..b8b281d master -> master

Note that when pushing, you usually don’t have to specify the full URI of the repository since it assigns the alias “origin” to the repository you cloned from (in this case, the GForge repository). If this was not the case, you can add an alias for the GForge repository URI with the “git remote” command:

~/gitproject1$ git remote add -m master gforge ssh://<username>@<gforge_server>/gitroot/gitproject1
~/gitproject1$ git remote -v
origin ssh://<username>@<gforge_server>/gitroot/gitproject1

In this case, “gforge” will be an alias for the remote GForge repository, and you’ll just have to specify “gforge” as the URI when pushing the changes:

~/gitproject1$ git push gforge master

Now, when you browse the git repository in the GForge project, you will be able to see the commits you’ve just pushed to the server.

Integration with GForge trackers

You may have noticed in the previous example that when we committed, the commit log included the special marker “[#16]”. GForge parses the commit logs and, whenever it finds such a string, it associates the commit with the specified item number, in this case 16.

If you take a look at the tracker item #16 (you can use the quick jump feature in GForge’s top navigation bar), you’ll see the commit information in the “Commits” tab inside the item:

You can click on the “Diff To” link and it will show you a page with the changes made to the file in that commit:

Setting up Access Control Lists

The Access Control Lists (ACLs) provide fine-grained permissions control in the source code repository, allowing you to specify read and write access for the different users in your project to different directories in the repository.

To set up an ACL for a directory, go to the Project’s git admin section by clicking on the “Git” section and then “Admin”. This will enable a new menu item “Edit repository ACLs”. Clicking on this item will take you to the ACL administration page.

To set up a new ACL, click on the “Add new ACL” button and specify the path for the ACL (it must be an absolute path in your source code tree). Once you define the path, you can edit the permissions for the path by clicking on the “Edit permissions” link for the ACL path. This will take you to a page where you can define the individual read/write permissions for each user in the project:

Whenever a user tries to push changes in a directory with read-only access, he will get an error message:

gitproject1$ git commit -a -m "Fixing stuff"
Created commit 1d32486: Fixing stuff
3 files changed, 3 insertions(+), 0 deletions(-)
gitproject1$ git push
<username>@<gforge_server>'s password: <your GForge password>
Counting objects: 13, done.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 690 bytes, done.
Total 7 (delta 4), reused 0 (delta 0)
User <username> doesn't have write access to /lib in the repository
error: hooks/pre-receive exited with error code 127
To ssh://<username>@<gforge_server>/gitroot/gitproject1
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'ssh://<username>@<gforge_server>/gitroot/gitproject1'

In this example, the user has write access to the repository but the access to the /lib directory is read-only, as shown on the previous screenshot.

Setting up commit filters

The commit filters are custom scripts that run when a push is done against the repository in order to do code checks and any other action you want.

To define a commit filter, you need to be a site-wide administrator. On the Admin section of GForge, click on the SCM commit filters link under the Plugins tab. This will take you to a page where you can define the filters.

To add a new filter, click on the Add new SCM commit filter button. This will ask you for three things:

  1. Filter for: Whether this filter will be available for CVS, SVN or git repositories
  2. Description: A short description on what this filter does (e.g. “Check for Windows-style line breaks”)
  3. Command: The command to execute when a push is done against the server. This needs to include the full path to the script in the server and any additional parameters.
    There are three special parameters that are defined by GForge which you can add in the command line:

    1. $PROJECT: The UNIX name of the project (e.g. gitproject)
    2. $PATH: The full path to the repository, usually /gitroot/<project_name>.
    3. $FILE: (Not used in git)

Once the script is set up, you need to enable it in your project. Go to the project’s git admin page and click on the Edit commit filters link. In there, you can use the checkboxes to select which filters will be applied in your repository.

Follow

Get every new post delivered to your Inbox.

Join 885 other followers