salsadigitalauorg / merlin-framework

Merlin - migration framework
GNU General Public License v3.0
16 stars 3 forks source link

Exclude patterns for type: path groups in Crawler #98

Open nickgeorgiou opened 4 years ago

nickgeorgiou commented 4 years ago

Description I want to be able to provide a list of patterns to exclude from a particular group to cater for special cases of paths. For example I might want the pattern to include all /submissions/* but exclude /submissions/online-submissions as a special case. If a path matches the supplied pattern, but it also matches the exclude pattern, it should not be included in that group.

Proposed solution Allow an exclude option for group_by Path type, like so:

group_by:
  -
      id: submission-categories
      type: path
      options:
        pattern:
          - '/submissions/*'
        exclude:
          - /submissions/online-submissions
Match Pattern          Match Exclude               Include in Group
----------------------------------------------------------------------
YES                    NO                          YES 
NO                     NO                          NO
YES                    YES                         NO
NO                     YES                         NO

Additional context Other types of groups (e.g. element) might have cases that would suit an exclude option.