•  
     
    story #9027 Preserve links at import
Summary
Empty
Preserve links at import
I don't lose links between my elements

Documentation: https://tuleap-documentation.readthedocs.io/en/latest/administration-guide/project-export-import.html#references

Important: This proposal only covers the ability to keep references like "artf1234", "wiki547", "cmmt888" clickable with a link to the corresponding imported resource inside Tuleap. It means that given a wiki page "FooBar" that contains in a text "artf1234", when I look at this artifact, I don't have any link from the artifact back to the wiki page.

There are 3 steps:

  • Enhance the import XML format to allow definition of mapping
  • Store the conversion elements at Tuleap side
  • Use the mapping table to generate the links

XML import format

For each imported item (artifacts, wiki pages, git, svn, frs package) there is a <reference> section that allows to define what is the original reference and to which item it corresponds in the target system.

Artifacts:

    <tracker>
        <artifact id="1234">
        ...
        <references>
            <reference source="artf1234" target="1234">

-> source is the original reference, target is the id of the artifact.

Plan

    <tracker>
        <artifact id="6963">
        ...
        <references>
            <reference source="plan6963" target="6963">

-> source is the original reference, target is the id of the artifact.

Subversion:

    <svn>
        <repository ...>
            ...
            <references>
                <reference source="cmmt64324" target="1">
                <reference source="cmmt64455" target="2">
            </references>

-> source is the original reference, target is the subversion revision number in the repo

Git:

    <git>
        <repository ...>
            ...
            <references>
                <reference source="cmmt64325" target="aa1ea8443b96bc8cbd0cfde28258280f1c3e166a">
                <reference source="cmmt78905" target="6710d1e62860cdad9f90636c97dd48c9da1bb8a9">
            </references>

-> source is the original reference, target is the git sha1 of the commit

FRS:

    <frs>
        <package id="1">
            ...
            <references>
                <reference source="pkg1289" target="1">

-> source is the original reference, target is the package id (needs to be added)

Mediawiki:

    <mediawiki>
        <references>
            <reference source="wiki76532" target="HomePage">

-> source is the original reference, target is the wiki page name

Covered:

  • artfXXX (point to an artifact)
  • pkgXXX (point to an FRS package)
  • cmmtXXX (point to a commit svn or git)
  • wikiXXX (point to a wiki page)

 

 

Empty
Empty
Status
Empty
Done
Development
  • [ ] Does it involves User Interface? 
  • [ ] Are there any mockups?
  • [ ] Are permissions checked?
  • [ ] Does it need Javascript development?
  • [ ] Does it need a forge upgrade bucket?
  • [ ] Does it need to execute things in system events?
  • [ ] Does it impact project creation (templates)?
  • [ ] Is it exploratory?

Store the conversion elements at Tuleap side

In Tuleap, there is a new plugin "TeamForge Compatibility" that will parse those references and store them in dedicated tables.

There is a sub-plugin for each supported plugin. For example:

  • teamforge-compat: pkgXXX (general structure + links to feature handled by the core)
  • teamforge-compat-tracker: artfXXX, trackerXXX
  • teamforge-compat-svn: cmmtXXX
  • teamforge-compat-git: cmmtXXX

Those plugin will know about keywords (artfXXX, pkgXXX, cmmtXXX, wikiXXX, ...) and what to store (e.g. for svn: project, repo, revision).

Concern: the size of the mapping table might be very big, even if we intend to split by services. For instance, for subversion we need to store 1 entry per repository revision.

Use the mapping table to generate the links

When a page is rendered (wiki, svn, git, etc) the existing "tuleap references" mecanism is extended by "TeamForge Compatibilty" plugin to:

  • detect the TF patterns (wikiXXXX)
  • replace the text by link to the corresponding element.
Details
#9027
Nicolas Terray (nterray)
2016-05-12 17:25
2016-04-04 11:14
4637

References
Referencing story #9027

Git commit

tuleap/tuleap/stable

Merge 'gerrit #5373' into stable/master e0b74b06cf
story #9027 Create plugin teamforge_compat ec90db3dda
Rename plugin teamforge_compat_Plugin into teamforge_compat_corePlugin 8415e80e08
Merge commit 'refs/changes/83/5383/14' of ssh://gerrit.tuleap.net:29418/tuleap into HEAD 896dcf8420
story #9027 detect and link teamforge references a9a035dcd8
Merge 'gerrit #5446' into stable/master 57d65efd06
story #9027 Create plugin teamforge_compat_tracker 4ab54f02f2
Init TeamForge Mediawiki compatibility plugin 147018ba93
Import cmmtXXXX references and treat them as links 828daf5e33
Import cmmtXXXX git references 795d565ae3
Import wikiXXXX references and treat them as links d3bc5cf8a1
Merge commit 'refs/changes/50/5650/3' of ssh://gerrit.tuleap.net:29418/tuleap into HEAD 7151344cff
story #9027 Preserve links at import 26dd27e4a5
Correct previous comment of gerrit #5650 24c435b2ae
Add planXXX reference alias a03620a9ea

Follow-ups

User avatar

Delivered in 8.14.99.39


  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Category set to
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Technical informations
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Status changed from On going to Done
  • Technical informations
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Permissions cleared
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
Yes, what is actually required is to transform pkg1232 into an hyperlink. Using the regular expression is fine for this transformation. However we still need the database to know that pkg1232 links to package #XXX.

Does it answer the question?
User avatar
Shanti (mildred)2016-04-07 11:45
I need some clarifications:

Currently, we got to a state where a string like "pkg #1232" is highlighted and redirects to the corresponding FRS release as defined in the XML import.

However, I suppose that what is actually required is to highlight the string "pkg1232". Can you confirm this?

I think the best option is to define in the compat packages a regular expression like "pkg([0-9]+)" to match these instead of trying to match every line of the database table.
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes