Other Import Considerations
Consider the import behavior when it processes the following:
• | Complete vs Partial Paths in the Import Path-Matching Process |
• | Identical Inventory |
• | Unreviewed Files |
• | Custom Fields for Inventory and Projects |
Complete vs Partial Paths in the Import Path-Matching Process
When the import process considers whether to add a file to inventory or mark it as reviewed, the file-matching criteria can mandate that the path of the file match between the import data file and the target project. For example, if the file-matching criteria requires that the complete paths of files match, the file /ePortal-1.3/src/gettext.c—the only file belonging to “InventoryItem 1.0 (License1)” in the import data file—is considered to be a different file from /ePortal-2.0/src/gettext.c in the target project. As a result, ePortal-2.0/src/gettext.c cannot be associated with “InventoryItem 1.0 (License1)”; and, if the createEmptyInventory value is false, “InventoryItem 1.0 (License1)” is not created in the target project since it has no associated file. Additionally, ePortal-2.0/src/gettext.c will not be marked as reviewed in the target project.
In order for a file in the target project to be treated as identical to a file in the data file, the paths for the two files must match in both locations. To accomplish this, you can use “partial path” and its directory depth as the file-matching criteria. In the case above, you would ensure that the file paths match by selecting “partial path” and setting its directory depth to 1 (one directory above the file name). In this way, the import is matching only the partial path /src/gettect.c for both files. Alternatively, you can manually manipulate paths in the import data file to match those in the target project, but you are strongly recommended to apply the “partial path” and directory depth criteria instead.
An inventory item in the source project is considered identical to an inventory item in the target project if both items are associated with the same unique combination of component-version-license (CVL). By default, identical inventory is reconciled during the import by overriding all fields in the target inventory item with information from the import data file. In cases where the source inventory item has empty fields, the data in the target inventory item will be left as is (that is, will not be removed).
However, Code Insight does provide the option to append the contents of notes fields in the import data file to target inventory. See Options for Handling Inventory Notes and Custom Fields for details.
A codebase file that was flagged as “unreviewed” in the source Code Insight project (that is, the project from which the import data file was created) does not retain its unreviewed status in the target project if the target codebase scan has marked the corresponding target file as reviewed. This occurs because the import data file stores information for only those codebase files that have been marked as reviewed in the source project. Hence, no information about the unreviewed file exists in the import data to overwrite information for this same file in the target project.
If, during a standard import, you want the target project codebase to retain the reviewed and unreviewed status of codebase files in the source project, manually flag all of the codebase files in the target project as “unreviewed” before importing the data file. In this way, any unreviewed files in the source project remain unreviewed in the target project; files marked as reviewed in the source project are included in the import data file and will be marked as reviewed in the target project if they meet the import file-matching criteria.
Custom Fields for Inventory and Projects
Custom field values are imported for the project or inventory items as long as the following conditions are met:
• | The name and field type of a custom field for the project in the import data file must match the name and field type of a custom field defined in the target project. Additionally, if the field type is “dropdown”, the value of the field in the import file must match one of the “dropdown” values defined for the field in the target project. |
The value imported for a custom project field overwrites the value of the corresponding field in the target project. If the imported field has no value, the target field value is null.
• | The name of a custom field for an inventory item in the import data file must match the name of a field defined for the identical inventory item in the target project. Additionally, depending on how you configure the import process, the value in the import data file can overwrite or be appended to the value of the field for the target inventory item. See “Inventory Notes Handling” Options in the Web UI. |