Closed hbruch closed 2 months ago
Reason for this issue seems that with 1ab4111 GBFSLoader.getRawFeed had the following special case removed:
if (feedName.equals(GBFSFeedName.GBFS)) {
return rawDiscoveryFileData;
}
I'm unsure, why this was necessary and would suggest to re-add e.g. to BaseGbfsLoader
public Optional<byte[]> getRawFeed(S feedName) {
if (feedName == getDiscoveryFeedName()) {
return discoveryFileUpdater.getRawData();
}
GBFSFeedUpdater<?> updater = feedUpdaters.get(feedName);
if (updater == null) {
return Optional.empty();
}
return updater.getRawData();
}
protected abstract S getDiscoveryFeedName();
Good catch! I think this happened because I originally had the intention of adding the discovery file updater to the list of updaters, so it would be refreshed along with the others. In the end, I decided to save that for later, but forgot to fix this case. Your suggestion looks correct!
Ah, I see. Then an alternative fix could be to move forward and have the discovery feed added to getFeeds()
and get it updated regularly, no?
One of the reasons I decided to save this for later is that it would require some design thinking about how potential changes in the discovery file should affect the other updaters. I think your fix is good for now.
Let's create a separate issue for updating the discovery file itself. I suppose it has to add updaters for new files, and remove updaters for files that are removed. Doesn't sound too complicated, but still I think it should be handled separately from this issue which is actually a bug in the current code.
I guess it also has to take into account possible changes in URLs of files ...
Reopened - will close when lib has been upgraded in lamassu.
Expected behavior
For valid feeds, like e.g. this donkey feed, lamassu should not report app_lamassu_gbfs_validation_missingrequiredfile.
Observed behavior
With current Lamassu commit 0ddee08, starting from 02a755a (merge of consume-v3), we receive
Version of lamassu used (exact commit hash or JAR name)
0ddee08
Data sets in use (links to GBFS feeds)
https://stables.donkey.bike/api/public/gbfs/2/donkey_ge/gbfs.json
Configuration used