Workaround for duplicate models for pit_crew #492
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Although the invariant for the fuel database where a (model_name-author-name) pair is meant to be unique, a duplicate model still slipped through. This causes pit_crew to halt early, causing an incomplete model cache from being built, at worst missing all models on fuel dated earlier than the duplication when building the model cache from scratch.
This causes any fresh builds of RMF demos (and any other building yamls for that matter) using those missing models to fail to find and download them.
The Fix
This uses a triplet of (model_name-author_name-upload_time) to distinguish models, instead of (model_name-author_name).
GIANT NOTE
This is not tested against someone running pit_crew's download against a pre-existing model cache. I also haven't refined this yet. I'm just uploading this to present the idea.
This is also a little messy, since we also used the
ModelNames
named-tuple to fetch and classify models from the local cache AND the local gazebo model directory. This is problematic because those don't have upload times, so there's a data mismatch.