Issue in Harvest and Hrefresh - extra files are being deployed
search cancel

Issue in Harvest and Hrefresh - extra files are being deployed

book

Article ID: 191068

calendar_today

Updated On:

Products

CA Harvest Software Change Manager CA Harvest Software Change Manager - OpenMake Meister

Issue/Introduction

We’re using hrefresh to deploy files to a remote server.

In the hrefresh.cfg file for the problematic project and state we have 2 lines:


We select a file from our package and invoke hrefresh:
 

We get the file we selected in the “DOCS” folder:

But we also get all the files in the other viewpath:

We did not want any file that we did not select to be deployed.

Environment

Release : 12.x,13.x,14.x

Component : CA Harvest Software Change Manager

Cause

Something to know about hrefresh is that when you invoke the command, it will analyze each line in the hrefresh.cfg file, and for each line it finds matching the same project and state, a separate hrefresh job is initiated.  So, in the above example, we would wind up with two separate hrefresh jobs, one for each line.

Another thing to know is that you can specify the "type" of reference directory (viewpath from the SCM Repository) in the hrefresh.cfg file, and this controls how hrefresh decides which files to deploy.  Here are some terminology definitions from the documentation:
  • active item: An active item is a CA Harvest SCM item that has a version in a package located in a state that shares the working view with the specified state.
  • active reference directory: An active reference directory contains the latest version of active items in a particular CA Harvest SCM view.
  • active view approach: An active view approach manages the synchronization of the source versions based on package promotion and demotion. Your inventory is active items only.
  • full reference directory: A full reference directory contains the latest version of all items in a particular CA Harvest SCM view.
  • full view approach: A full view approach manages the synchronization of the source versions based on the latest versions of all items in a particular working view, or all versions in a snapshot view.

Hrefresh will always deploy the latest version of each file in the state.  The main difference between "Full view approach" and "Active view approach" is that files deployed with the "Full view approach" will include baseline versions when no later version of the file exists.  Files deployed with the "Active view approach" will exclude baseline versions when no later version of the file exists.

One more detail about HRefresh is that the scope of files considered for deployment will depend on what was selected when you invoke HRefresh.
  • State: If you right click on the name of the state and invoke hrefresh, all files in the data view for the state will be considered for deployment.
  • Package: If you right click on the name of a package and invoke hrefresh, all files in that package will be considered for deployment.
  • Item: If you right click on the name of a file (or files), only those files will be considered for deployment.
Selecting the "Full" view approach has the following result
If a state is selected to be deployed, the latest versions of all files in the state's data view that are within the reference directory, including baseline versions if they are the latest version, will be deployed.

If a package is selected to be deployed the latest versions of all files in that package that are within the reference directory will be deployed.  If none of the files in the selected package are within the reference directory, no files will be deployed.

If individual files are selected for deployment and they are within the reference directory, only the latest versions of those files will be deployed.  If none of the selected files is within the reference directory, ***the latest versions of all files in the data view within the reference directory will be deployed*** (bug?).

Selecting the "Active" view approach has the following result:
If a state is selected to be deployed, the latest versions of all files in the state's data view that are within the reference directory, excluding baseline versions if they are the latest version, will be deployed.

If a package is selected to be deployed the latest versions of all files in that package that are within the reference directory will be deployed.  If none of the files in the selected package are within the reference directory, no files will be deployed.

If individual files are selected for deployment and they are in the reference directory, excluding baseline versions if they are the latest version, only the latest versions of those files will be deployed.  If none of the selected files is within the reference directory, ***the latest versions of all files in the data view within the reference directory, excluding baseline versions will be deployed*** (bug?).

...

Referring back to the example, the type of reference directory in the above example is "Full"


And the individual file "\SampleRepository\DOCS\README.TXT" was selected.  So, for the first hrefresh job, this file is in the reference directory ("\SampleRepository\DOCS") so it was deployed.  For the second hrefresh job, the file is not within the reference directory ("\SampleRepository\SRC"), so all files in the dataview within that reference directory were deployed.

Resolution

The solution is to change the reference directory type to "Active" instead of "Full".
An additional step that can be taken as a workaround is to select the package for deployment rather than an individual file within a package.