It's all about the answers!

Ask a question

Load rule was ignored during the build

Samuel Wu (2142) | asked May 03 '16, 9:59 a.m.
edited Jun 21 '16, 10:52 a.m. by David Lafreniere (4.8k7)
I'm running RTC client 5.0.2. During the build, I want to re-fetch a project for latest update. A load rule was created and called by following Ant script.
        <teamFetch repositoryAddress="${repositoryAddress}"
But the whole workspace was extracted from RTC regardless of history.loadrule. I wonder whether I missed something.

Accepted answer

permanent link
David Lafreniere (4.8k7) | answered Jun 21 '16, 1:23 p.m.
 By default, a build will load all components in the build workspace. A load rule in a build can be used to specify 'what' (files or folders) to load and 'how' to load them (path location or alternate name). If you do not want to load certain components, you would need to put them in either the 'componentsToExcludeByUUID' or 'componentsToExcludeByName' Ant property.
Michael Valenta selected this answer as the correct answer

Samuel Wu commented Jun 21 '16, 3:12 p.m.

Thank you, David, for the response. But there are so many components and projects in the workspace. It would be a maintenance nightmare to keep excluding the new components as they are created.
Based on the following doc, loadRulesByPath and loadRulesByUUID should be supported.

David Lafreniere commented Jun 22 '16, 10:20 a.m. | edited Jun 22 '16, 10:21 a.m.
Based on the following doc, loadRulesByPath and loadRulesByUUID should be supported. 
The TeamFetchTask does support those Ant properties (although only one can be provided). They let the build know where to find the load rule file(s) (which was traditionally one per component, to indicate what to load in each component and how). The original design of the build workspace was to load everything in that build workspace and 'build' it. 

<see the continuation comment below>

David Lafreniere commented Jun 22 '16, 10:21 a.m. | edited Jun 22 '16, 10:24 a.m.

If components are never to be built, you could avoid having them in the build workspace all together. You would need to add a scoped flow target so that the components are not re-accepted into the build workspace.

You can do this by following these steps:
-open the workspace editor for the build workspace 
-select the stream in the Flow Targets section 
-click Edit... 
-choose 'Flow only components checked below' and check the components you want to include.

If you need to keep the components in the build workspace (but never want to load them), you would have to use the 'components to exclude' list.

I agree it would be nice if this area was improved. For some more background, please see comment 5 and comment 7 in Load workspace from load rules file behaves differently when performed by a build (371621)

Samuel Wu commented Jun 22 '16, 4:51 p.m. | edited Jun 22 '16, 4:57 p.m.

Well, our build runs quite a while. Once the build starts, it takes a snapshot of the workspace and run the build with it. But something may changed during the build which we want to pick up. So we want to use this loadrule to reload a specific project to get the latest content during the build. Since there are so many components in the workspace and the containing project of the project has many other projects, the "components to exclude" list doesn't work well for us.
If I take it correctly, loadrule is not supported in the teamfetch ant task yet (you may want the doc to be updated).  I wonder whether there is a solution for my scenario.

One other answer

permanent link
Sridevi Sangaiah (59179) | answered Jun 21 '16, 11:14 p.m.

Samuel Wu commented Jun 22 '16, 9:29 a.m.

Thank you, Sridevi, for the information. My scenario is slightly different that I need to fetch the artifacts through teamfetch ant task. There is no GUI access.

Your answer

Register or to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.