It's all about the answers!

Ask a question

cannot add artifacts to root after loading via loadrule.


Maxmelbin Neson (1536) | asked May 06 '14, 4:54 a.m.
edited May 06 '14, 5:01 a.m.
i have a component with the name com.org.abc.something

its contents

It has three folders int he root - doc, src, lib.

The requirement is that
1. the component is loaded in the sandbox in the directory structure ../com/org/abc/something
2. contents of lib is loaded directly under ../com/org/abc/something

For this i wrote the following loadrule

<parentLoadRule>
    <component name="com.org.abc.something" />
    <parentFolder repositoryPath="/"/>
    <exclude>
            <filter name="lib"/>
    </exclude>
    <sandboxRelativePath pathPrefix="/com/org/abc/something"/>   
</parentLoadRule>

<parentLoadRule>
    <component name="com.org.abc.something" />
    <parentFolder repositoryPath="/lib"/>
    <sandboxRelativePath pathPrefix="/com/org/abc/something"/>   
</parentLoadRule>

The loading works fine, but there is a problem.
If any new folder/file is added in com/org/abc/something/ , RTC doesn't track it. Which means i am now unable to add any artifacts to the root of the component.
Do you have any suggestions?

3 answers



permanent link
Ralph Schoon (63.1k33645) | answered May 07 '14, 3:17 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Maxmelbin,

as far as I can tell the way you load, ../com/org/abc/something is a folder where you load the content. This folder is, as far as I can tell not under source control itself, which is why you can not version anything in there.

As far as I can tell, If it where under SCM, you would have not been able to load that way, because the nested folders, also being under SCM would overlap. This is however the experience I have made with experimenting with this for customers. I have no solution at hand at this point in time, unfortunately.

Comments
diogo cruz commented May 16 '14, 10:22 a.m. | edited May 18 '14, 5:04 p.m.

Hi Ralph, consider a slight change in the presented loadrule:
<itemLoadrule>
    <component name="com.org.abc.something"/>
    <item repositoryPath="/lib/aFile.txt"/>
    <sandboxrelativepath pathPrefix="/com/org/abc/something"/>   
</ItemLoadrule>


In this case the behavior described by @Maxmelbin also occurs. Nevertheless I see no reason why.
IMHO RTC should be smart enough to track everything except aFile.txt in folder /com/org/abc/something to com.org.abc.something component.





Ralph Schoon commented May 16 '14, 10:32 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

As far as my experience goes, If you load something like

sandboxrelativepath pathPrefix="/com/org/abc/something"

this means /com/org/abc/something is not under SCM, because you would otherwise get a conflict with another hierarchy in SCM. Hence you can not add something in there and get it versioned.

You would have to create the folder under SCM and then load it there and then you could version its content in SCM.

Your scenario is not different with respect to that fact, as far as I know. Changes are only detected in the folders that are actually under SCM.


diogo cruz commented May 16 '14, 10:42 a.m.

Consider:
<parentloadrule>
    <component name="com.org.abc.something"/>
    <parentfolder repositoryPath="/"/>
    <sandboxrelativepath pathPrefix="/com/org/abc/something"/>   
</parentloadrule>

I read this as: Load Component com.org.abc.something as folder com/org/abc/something under the sandbox. In that sense abc level should be associated to RTC component. In addition to that, in this simpler example whatever is added under that folder is tracked, meaning RTC is tracking abc to a component.

Only when a second rule (itemLoadRule) is there this problem exists.


Ralph Schoon commented May 16 '14, 10:50 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I have investigated loading with load rules recently...... I did load as described above and the path prefix was not in SCM. All I can really say. Your situation might be different. In any case, you might want to create a work item explaining what you expect.


diogo cruz commented May 16 '14, 11:01 a.m. | edited May 16 '14, 11:01 a.m.

You are right. The example I provided before does not work. But this one works:

    <itemLoadRule alternateName="something">
        <component name="com.org.abc.something"/>
        <item repositoryPath="/"/>
        <sandboxRelativePath pathPrefix="/com/org/abc"/>
    </itemLoadRule>

Anyway, I will create a WI.

Thank you.


permanent link
Geoffrey Clemm (30.1k33035) | answered May 18 '14, 5:55 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
A few key points:
- A new file/folder in a sandbox appears in the Unresolved folder of the Pending Changes view only if that new file/folder has been added to a folder in the sandbox that is under version control.
- An itemLoadRule places the file/folder in the sandbox specified by that itemLoadRule under version control.
- A parentLoadRule does *not* place the folder in the sandbox specified by that parentLoadRule under version control, but rather places the specified children of that folder in the sandbox under version control.
- You cannot specify a load rule for a child of a folder in a sandbox that is under version control (the loading of that child is completely determined by the version controlled folder).  

So if you want new children of a specified folder in the sandbox to appear in the Unresolved folder of the Pending Changes view, you must either specify that folder in an itemLoadRule, or you need to specify the *parent folder* of that folder in a parentLoadRule, and then specify that folder in the matching rules for that parentLoadRule.

It sounds like what you want is for a parentLoadRule to also cause a new file/folder in the specified folder in the sandbox to appear in the Pending Changes view.   This is not an unreasonable enhancement request (perhaps the one that you filed?   it would be good post the ID of that work item into this thread), but note that it would introduce a possibility of a conflict, where an "incoming change" could overwrite a file in the Unresolved folder.   But the system could just detect this and create a warning saying "do you want to checkin your change before doing the accept, to avoid overwriting the unresolved change".

permanent link
diogo cruz (21812) | answered May 19 '14, 10:55 a.m.
Yep, you got my point. I will create an RFE soon.

The solution could be also to allow exclusion nodes to ItemLoadRule. But the solution field I leave it to you.

Thanks.

Your answer


Register or to post your answer.