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

Add a merge_key configuration option #57

Merged
merged 1 commit into from
May 5, 2024
Merged

Conversation

moorereason
Copy link
Contributor

Add a merge_key configuration option to allow for custom merge matching logic.

Updates #43

Add a merge_key configuration option to allow for custom merge matching
logic.

Updates tierpod#43
@moorereason
Copy link
Contributor Author

To give an example of how I use this: I tend to hack on this project and basically always have input.delete=no so that I can test changes/patches. I don't currently have this process scheduled via cron. I just run it every week or so when I have time to look at the results.

I'm using the following settings with this patch to get per-day, merged reports for each reporting org:

input:
  delete: no

output:
  file: "html/{{ .PolicyPublished.Domain }}/{{.ReportMetadata.DateRange.Begin.UTC.Format \"2006-01-02\" }}/{{ .ReportMetadata.OrgName }}.html"

merge_reports: yes
merge_key: "{{ .ReportMetadata.OrgName }}!{{ .ReportMetadata.Email }}!{{ .PolicyPublished.Domain }}!{{ .ReportMetadata.DateRange.Begin }}"

(My config has more settings than this--I'm showing the relevant parts here.)

Notice that I put the DateRange.Begin in the output path and the merge key. These settings need to work together or you'll overwrite the same file path and miss results.

So, I could see this feature being very useful for people like me but also confusing if you don't watch what you're doing.

@tierpod
Copy link
Owner

tierpod commented May 5, 2024

Agree, this setting can be a little confusing. As long as it doesn't break previous behavior with defaults, we can keep it for advanced usage, like you described. Thanks a lot!

@tierpod tierpod merged commit 70b3173 into tierpod:master May 5, 2024
1 check passed
@moorereason moorereason deleted the iss43 branch May 6, 2024 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants