-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix file name parse error (#132) #133
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.
Thanks for the quick turn-around on this!
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.
🏃🏽♀️⚡ THAT WAS FAST WORK! Splitting out the concerns of the valid structure and the extension, giving an informative response is 💯
Thanks for the reviews @nickreich and @zkamvar . I'm going to merge but am wondering if we can put to bed the following issue as well #81 Offically this PR allows for round IDs that are not strictly ISO dates, so long as they match the pattern Should I go ahead and open issues to:
|
I think closing that issue should require specific tests for this. At the moment, all tests assume ISO dates as round IDs? |
There is a test for hubValidations/tests/testthat/test-parse_file_name.R Lines 41 to 50 in 5c83952
|
Oh good point! Sorry about that. I'll close #81 as completed here. |
Regarding the suggestion to
I have forgotten where we are currently on this, but don't round IDs have to be |
Totally agreed that regex are complex and confusing. Hence I'm suggesting a clarification in hubDocs that makes the expectation clear in plain language that doesn't require interpretating regex. Having said that we have always accepted round IDs that are not ISO dates which is exactly why I'm wanting to formalise this so there aren't further misconceptions and having to answer this question over and over again. |
Maybe we should migrate further discussion to a specific issue? I think basically I'm on board, and I like the idea of being more specific about round_id formatting. I guess as long as we provide several examples of commonly used formats for regex that hub admins could include in their config file it would be ok. |
Can do but we've had multiple issues and discussions about this already:
and we've established that the pattern above is what is accepted (and in truth has always been accepted. It just hasn't been documented well enough hence the lingering confusion about this). What I'm proposing is to open specific issues that codify what has effectively always been the case in the appropriate locations rather than open another discussion issue.
The hub admins would not need to provide a regex,. In the config it's the actual values that are encoded and the schema will perform the validation of the config, ensuring round id values match the expected pattern. Hence hub admins only need to ensure their proposed round IDs match the proposed pattern. Otherwise We do already provide valid examples of what round IDs should look like in the schema here:
|
Just to be crystal clear, hub admins just need to know that round IDs must be either:
We can verbally explain this in |
This PR resolves #132 by bolstering the parsing of file names in
parse_file_name()
to ensure they match the specific pattern required rather than just checking patterns of interest are extracted successfully.I also added more fine-grained check with more informative error messages and fixed a bug in which the compression extensions were not being successfully recorded and returned.