Add automatic decoding for hashed files#284
Conversation
|
@celskeggs Good points, I pushed some changes that I think should fix all of those issues. Thanks! |
celskeggs
left a comment
There was a problem hiding this comment.
Thanks for the changes! I do think this is better, but I'm not sure it's totally robust yet. We may want the F Prime core team to weigh in on how we should handle some of these things.
There was a problem hiding this comment.
This is super helpful, thanks a lot! A few comments for your consideration. As @celskeggs is hinting at, I think we'll need a way for users to provide a hash file themselves and not necessarily rely on the build-artifacts detection. From there, we can re-organize a few things to make this pretty self-contained.
@celskeggs as the requestor of that feature, do you agree here? Since both |
|
@thomas-bc In my context, I can definitely provide a full build-artifacts directory, or at least one that contains hashes.txt and the dictionary in the right places. No complaints about the idea of |
|
It's typical (and sometimes required) to deliver the flight dictionaries without the source/build tree, so there shouldn't be a dependency to decode the hashes. |
|
Thanks everyone for the suggestions and feedback. @thomas-bc I implemented the --hash-file flag and integrated all of your other suggestions. The code still tries to detect the hash file automatically if not provided and will simply output the original hash code if it fails. Let me know if you find any other issues with the implementation or if there's anything else I should add. Thanks! |
thomas-bc
left a comment
There was a problem hiding this comment.
Last round of nits and recommendations - I'm expecting to be ready to merge once we've addressed them. And thanks again!
|
@youio if you don't have time to get through this, I am happy to help |
This reverts commit 4084514.
|
@thomas-bc Hi apologies I just incorporated your requests. I ended up removing the absolute path logic like you said. I thought it might be convenient but its much trickier to implement robustly than I thought and I think the relative paths are sufficient. For the |
thomas-bc
left a comment
There was a problem hiding this comment.
Looks good to me! Thanks a lot!
Change Description
This PR adds a check for hashed files during
EventDatainitialization and automatically decodes and replaces any that are found for display to the user. It also adds a new variableBUILD_DIRto the environment of the flask app to allow the new code to find the hashed files no matter wherefprime-gdsis called.Rationale
As outlined in issue 4666 on the fprime repository, this change allows users to benefit from using hashed file names without needing to manually call
hash-to-filewhenever an assert is triggered.