Linking tuleap artifact with git commit

414 Views Asked by At

In Tuleap, the tasks have an artifact ID. I want to link git commits to an artifact ID so I can see the commits linked in the "Cross Reference" frame of the task view. How to achieve this?

2

There are 2 best solutions below

0
On BEST ANSWER

If you just enter the artifact reference into your commit message, the commit will automatically become linked to that Tuleap artifact.

2
On

You can use text like,

git #repo_name/commit-id-hex

These can also be entered in the 'Cross Reference' after the fact. This is useful for the case where code was committed before other tracker artifacts are created. Ie, the commit message can not be re-written with the short-id #artifact_id in the commit message.

For example, a tracker with a short name 'bugs' and id 222. You would enter the text 'bugs #222' somewhere in the git commit message. This is a preferred mode of working and is the easiest. I prefer to put this in the title line, but it can go anywhere in a message.

However, if you create an artifact after the fact. Given a repo named program with commit hash 24f2f74bbc8c1f77d05ca6c484e8525de76ddd77. You can enter git #program/24f2f74bbc8c1f77d05ca6c484e8525de76ddd77 in the artifact comments to link the commit with the artifact (artifact is a bug, a requirement, a user story, etc). program is the git name. You can use git remote -v or use the web UI to find the repo name. Usually, it is the same as the top git directory name, but it does not have to be depending on your workflow (how you clone/create the repo).