Main Content

Exclude Files from Change Tracking in Process Advisor

You use Process Advisor and the CI/CD Automation for Simulink Check support package to monitor the digital thread, detect changes, and identify outdated tasks in your project. By default, any change to an artifact or its dependencies makes related tasks outdated. However, you can exclude specific artifacts from change tracking if you know that they change regularly and do not impact task validity. Excluding artifacts can help you avoid unnecessarily re-running tasks while maintaining the task status and result information. You can modify the change tracking behavior for the process model, task inputs, and task outputs.

By default, Process Advisor shows a warning icon in the I/O column for tasks that have untracked inputs or outputs. You can change this behavior by clicking Settings and setting Untracked dependency behavior to allow untracked I/O files. Make sure that the untracked task inputs or outputs do not need to be tracked to maintain the task status and results that you need for your project.

Excluding the Process Model

If you do not want changes to the process model to make task results outdated, you can exclude the process model from change tracking. In Process Advisor, click Settings and clear Add process model as dependency in the user settings. For more information, see Specify Settings for Process Advisor and Build System and padv.UserSettings.

By default, if you make a change to the process model file, Process Advisor marks task results as outdated because the tasks in the updated process model might not match the tasks that generated the task results from the previous version of the process model. This behavior occurs because Process Advisor automatically adds the process model as a dependency for each task.

I/O showing processmodel.m as one of the Dependencies for a task

Excluding Task Inputs

If you find your task inputs by using the built-in query padv.builtin.query.FindFileWithAddress, you can disable change tracking for the artifacts that the query returns by specifying the query property TrackArtifacts as false. If you make a change to the file that the query returns, Process Advisor does not mark the task as outdated.

padv.builtin.query.FindFileWithAddress(...
Type='ma_config_file', Path=which('sampleChecks.json'),...
TrackArtifacts = false)

If you use artifacts outside your project as inputs to your tasks, these changes are not tracked by default. You can confirm that a file is untracked in Process Advisor, in the I/O column, by pointing to the file icon . For example, this image shows an external input file, SHARED_MA_CONFIG.json. The untracked icon indicates the file is not tracked.

Tooltip for untracked input file in I/O column

Excluding Task Outputs

You can disable output artifact tracking either for an entire task or for specific output artifacts.

Turn Tracking Off for All Task Outputs

If you do not want Process Advisor to mark a task as outdated when you make changes to task outputs, you can turn off change tracking for those task outputs. In your process model, set the task property TrackOutputs to false.

maTask = pm.addTask(padv.builtin.task.RunModelStandards());
maTask.TrackOutputs = false;

You can confirm that the file is not tracked in the Process Advisor I/O column. Point to the file icon to see the associated files. The untracked icon indicates the file is not tracked.

Tooltip for untracked output file

Turn Tracking Off for Specific Task Outputs

You can turn off change tracking for a specific artifact by setting the Track property of the artifact address to false. The ArtifactAddress property of a padv.Artifact object stores the artifact address. The built-in queries typically return artifacts as padv.Artifact objects, but you can also manually define an artifact address for an artifact by using the utility function padv.util.ArtifactAddress.

You can ignore changes to specific task outputs by setting the Track property inside a custom task. For example, this custom task inherits from the built-in task DetectDesignErrors, but overrides the run method to turn off change tracking for the output report. The custom task identifies the report by iterating over each task output, checking if the artifact has the same report format as the task, and then specifying the Track property for the artifact address.

classdef MyDetectDesignErrors < padv.builtin.task.DetectDesignErrors
    % Detect design errors, but ignore changes to generated report files
    methods

        function obj = MyDetectDesignErrors(options)
            arguments
                options.Name = "MyDetectDesignErrors";
                options.Title = "My Detect Design Errors";
            end
            obj@padv.builtin.task.DetectDesignErrors(Name = options.Name);
            obj.Title = options.Title;
        end

        function taskResult = run(obj,input)

            % use DetectDesignErrors to run Design Verifier
            taskResult = run@padv.builtin.task.DetectDesignErrors(obj,input);

            % for each task output, check if it's a report
            for i = 1:length(taskResult.OutputArtifacts)
                artifact = taskResult.OutputArtifacts(i);
                artifactAddress = artifact.ArtifactAddress;
                fileAddress = artifactAddress.getFileAddress;
                if contains(fileAddress, obj.ReportFormat, IgnoreCase=true)
                    % if the task output is a report, turn off change tracking for the report
                    artifactAddress.Track = false;
                end
            end

        end
    end
end

See Also

| | | | |

Related Topics