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

Config file contents - determining ID system for duplicate detection #138

Open
nathanjmcdougall opened this issue Nov 21, 2024 · 0 comments
Assignees
Labels
philosophy Determining the best design approach

Comments

@nathanjmcdougall
Copy link
Owner

Motivation
When we write to a config file, we try and respect the original contents. One thing is to try not to duplicate config. But how do we determine what is duplicated? We could use the name as an ID, but what if the name is changed and the content is identical? We could use the content as an ID but what if the name is the same, and the content is tweaked (much more likely).
We could do a fuzzy approach based on string similarity but that seems way too complex for the user to get predictable behaviour. On the other hand, it might make for better DX, and the behaviour could be controlled with a flag.

This is related to the use of placeholders - placeholders get automatically removed once we have real content, but there's a chance that the user tweaks the placeholder - in such a case we don't necessarily just want to remove it.

The approach we take has some architectural effects because if we're using name as an ID in dicts that's one thing - once we start using content as an ID that's another.

For now, we're just using name as an ID.

Note that generally multiple shared names is invalid (well suited as an ID) but usually multiple named items can share identical contents (so not necessarily well suited as an ID).

Summary of desired enhancement
Get a clear design approach and document it.

@nathanjmcdougall nathanjmcdougall added the philosophy Determining the best design approach label Nov 21, 2024
@nathanjmcdougall nathanjmcdougall self-assigned this Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
philosophy Determining the best design approach
Projects
None yet
Development

No branches or pull requests

1 participant