Main Content

Exclude Files from Change Tracking in Process Advisor

When you use CI/CD Automation for Simulink Check, the support package creates a digital thread for your project to capture and analyze certain project artifacts and their relationships. Process Advisor and its build system monitor the digital thread to detect changes and identify outdated task results. By default, any change to an artifact or its dependencies makes related task results outdated.

However, you can exclude specific artifacts from change tracking if you know that certain artifacts change regularly and do not impact task validity. This can help you reduce unnecessary task re-runs while maintaining the task status and result information that you need for your project. You can modify the change tracking behavior for the:

Make sure to review the files that you exclude from change tracking. For more information, see Handling Untracked Dependencies.

Process Model

If you do not want changes to the process model to make task results outdated, you can open the Settings in Process Advisor 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 to help make sure that tasks in the updated process model match the tasks that generated the previous task results.

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

Task Inputs

Turn Tracking Off for Query Artifacts

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

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

Tracking Behavior for Artifacts Outside Project

You can use artifacts outside your project as inputs to your tasks, but changes to those files are untracked by default. For example, if you have a shared Model Advisor configuration file, SHARED_MA_CONFIG.json, that is outside your project, you can add the file as an input to the Check Modeling Standards task.

maTask = pm.addTask(padv.builtin.task.RunModelStandards());
maTask.addInputQueries(padv.builtin.query.FindFileWithAddress( ...
    Type='ma_config_file', Path=which('SHARED_MA_CONFIG.json')));

In the Process Advisor I/O column, the file appears as Untracked because you cannot track changes to files outside the project. If you make a change to an untracked file, Process Advisor does not mark the task as outdated.

Tooltip for untracked input file in I/O column

Task Outputs

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, specify the task property TrackOutputs as false.

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

In the Process Advisor I/O column, the outputs appear as Untracked. If you make a change to an untracked file, the Process Advisor does not mark the task as outdated.

Tooltip for untracked output file

Turn Tracking Off for Specific Task Outputs

You can turn off change tracking for a specific artifact by specifying the Track property of the artifact address as false. The artifact address is stored in the ArtifactAddress property of a padv.Artifact object. 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 specifying the Track property inside a custom task. For example, the following 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

Handling Untracked Dependencies

By default, the Process Advisor generates a warning when you have untracked I/O files that impact your tasks. In the I/O column, Process Advisor shows a warning icon for tasks that have untracked inputs or outputs. You can change this behavior by opening the Settings in Process Advisor and specifying the project setting Untracked dependency behavior to either allow, generate a warning, or generate an error if a task has untracked I/O files. For more information, see Specify Settings for Process Advisor and Build System and padv.ProjectSettings.

If you make a change to an untracked input or output file, Process Advisor does not mark the task as outdated. Make sure that task inputs or outputs that appear as Untracked do not need to be tracked to maintain the task status and result information that you need for your project.

See Also

| | | | |

Related Topics