-
Notifications
You must be signed in to change notification settings - Fork 95
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
Add support for environment and dataset rules with same names #438
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally approved, but two notes:
- I know there's probably going to be a docs-related PR for this as well, but I think it also deserves a note in the README.
- It took me a while to understand the description of this PR. Can you please add a bit of a note as to why there's a problem that needs this fix?
if prefix := s.Config.GetDatasetPrefix(); prefix != "" { | ||
samplerKey = fmt.Sprintf("%s.%s", prefix, samplerKey) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could mandate that the intervening period be part of the specified prefix. If I set the DatasetPrefix
field to "x," the prefix really becomes "x."—even though I didn't mention the period when specifying my preferred prefix. I might prefer a prefix like "dataset-" (with a separating hyphen instead of a period).
Had you considered including this separator as part of the prefix? Were you attempting to avoid false aliasing if there was no obvious separator character included in the prefix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree additional docs on the prefix format where the .
separator is added for you would be useful 👍🏻
The separator is not necessary but I think helps create a mental divide. The intent of this change is to support users migrate from legacy datasets to newer environment and services rule sets and should not be a permanent solution. I think a simple solution of always using a single .
that's well documented should be good enough.
Co-authored-by: Steven E. Harris <seh@panix.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the docs improvement. I added suggestions for a couple of typos.
Co-authored-by: Kent Quirk <kentquirk@gmail.com>
…ombio#438) Co-authored-by: Steven E. Harris <seh@panix.com> Co-authored-by: Kent Quirk <kentquirk@gmail.com>
Which problem is this PR solving?
Adds support for config files to contain both a dataset and environment with the same name in the same rules config. This is achieved by adding a DatasetPrefix to the config and then using that prefix when setting up rule definitions.
config.toml
rules.toml
Short description of the changes