Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General versus Per-Model flags #271

Open
chadell opened this issue Mar 12, 2024 · 0 comments
Open

General versus Per-Model flags #271

chadell opened this issue Mar 12, 2024 · 0 comments
Labels
status: gathering feedback Further discussion is needed to determine this issue's scope and/or implementation

Comments

@chadell
Copy link
Collaborator

chadell commented Mar 12, 2024

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

@chadell chadell added the status: gathering feedback Further discussion is needed to determine this issue's scope and/or implementation label Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: gathering feedback Further discussion is needed to determine this issue's scope and/or implementation
Projects
None yet
Development

No branches or pull requests

1 participant