Skip to content

General versus Per-Model flags #271

@chadell

Description

@chadell

Environment

  • DiffSync version: 2.0.0

Proposed Functionality

The way flags are managed in

if self.flags & DiffSyncFlags.SKIP_UNMATCHED_SRC and not dst_obj:
log.debug("Skipping due to SKIP_UNMATCHED_SRC flag on source adapter")
self.incr_models_processed()
return None
if self.flags & DiffSyncFlags.SKIP_UNMATCHED_DST and not src_obj:
log.debug("Skipping due to SKIP_UNMATCHED_DST flag on source adapter")
self.incr_models_processed()
return None
if src_obj and not dst_obj and src_obj.model_flags & DiffSyncModelFlags.SKIP_UNMATCHED_SRC:
log.debug("Skipping due to SKIP_UNMATCHED_SRC flag on model")
self.incr_models_processed()
return None
if dst_obj and not src_obj and dst_obj.model_flags & DiffSyncModelFlags.SKIP_UNMATCHED_DST:
log.debug("Skipping due to SKIP_UNMATCHED_DST flag on model")
self.incr_models_processed()
return None
if src_obj and src_obj.model_flags & DiffSyncModelFlags.IGNORE:
log.debug("Skipping due to IGNORE flag on source object")
self.incr_models_processed()
return None
if dst_obj and dst_obj.model_flags & DiffSyncModelFlags.IGNORE:
log.debug("Skipping due to IGNORE flag on dest object")
self.incr_models_processed()
return None
, means that the GLOBAL flags always take precedence over the MODEL ones.

I would propose changing the order (more specific first) and adding some flags that could negate the global behavior. For example:

  • global: SKIP_UNMATCHED_DST
  • model: NO_SKIP_UNMATCHED_DST (new one)

This should allow not skipping for only a specific model.

Use Case

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: gathering feedbackFurther discussion is needed to determine this issue's scope and/or implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions