Closed djjuhasz closed 6 months ago
Attention: Patch coverage is 94.11765%
with 2 lines
in your changes are missing coverage. Please review.
Project coverage is 80.92%. Comparing base (
c6647df
) to head (82579f8
).:exclamation: Current head 82579f8 differs from pull request most recent head 0d1f5de
Please upload reports for the commit 0d1f5de to get more accurate results.
Files | Patch % | Lines |
---|---|---|
bagit/create_bag_activity.go | 90.90% | 1 Missing and 1 partial :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@jraddaoui I've added bagit.Config Validate()
method that uses https://pkg.go.dev/github.com/go-playground/validator/v10 to do the validation. I think using https://pkg.go.dev/github.com/go-playground/validator/v10 is overkill for validating this one field, but I wanted to explore it as a general validation library we could potentially use for general config validation in Enduro.
Before I tried this validation method I went down the road of defining a HashAlgorithm "enum" type and validating against that. Implementing an enum in Go has it's own drawbacks though (see https://github.com/artefactual-sdps/enduro/issues/516), so I decided to try https://pkg.go.dev/github.com/go-playground/validator/v10.
I'm open to using a validator or an enum here, as there are trade-offs for both methods. What do you think?
P.S. obviously I could just implement a simple Validate()
method for "ChecksumAlgorithm" that doesn't use any third-party libraries, but I think this is a general problem that calls for a general solution.
bagit.CreateBagActivity()
for creating BagIt bags