Skip to content
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

Map Tags & Use Maps Server (triplea_maps.yml now unused) #9491

Merged
merged 1 commit into from
Aug 12, 2021

Conversation

DanVanAtta
Copy link
Member

@DanVanAtta DanVanAtta commented Aug 11, 2021

Always use Maps Server
Stop reading 'triplea_maps.yml'
Specifically instead of downloading the 'triplea_maps.yml'
file and parsing it, the front end will instead contact
the server and receive a JSON payload that contains the
map download list.

Introduce and use map tags
Map tags are a generic
way to add additional meta data to maps dynamically.
For example, instead of having a 'category' value
specifically enumerated, we instead now have a
tag whose key is 'category'. This allows us to have
an arbitrary set of meta information without
needing to update the front end.

Update server to send 'preview image url' to the frontend
The server computes the preview image URL to make it easier
and more explicit for the frontend. Having the server
instead of the client compute the preview image URL also
allows for it to be updated in database.

Testing

Tested with a local server

  • started database ./spitfire-server/database/start-docker-db
  • started spitfire (lobby) service via IDE
  • started a headed client
  • updated 'settings' to use a 'local' lobby server
  • clicked 'download maps'

Screens Shots

The local server is using dummy data, otherwise note that a tag with 'rating' was configured
and is now displayed as a column on the download maps page:
Screenshot from 2021-08-10 22-00-24

Additional Notes / Warnings

This is going to break the front end for prereleases, specifically download maps might not work.
The deployment of the server needs to happen and even then there is likely more to work out.

Future & Following Work

  • Fix up deployment to server so we get latest code deployed to the prerelease environment. This will fix up 'download maps' not getting data
  • Fix up any download or data quality issues, notably make sure server is doing a good job indexing maps
  • Wire in 'map size' to the download payload
  • Build an admin toolbox UI to update tag values

Release Note

UPDATE|Maps information is now stored in database and no longer stored in the file: 'triplea_maps.yaml'. Game clients now download map information from the server. The game client no longer downloads 'triplea_maps.yaml'. 'Map tag' meta data capability added to database, map admins can add tags to maps and those tags are now displayed by the game client in the download maps screen.

__Always use Maps Server__
  Stop reading 'triplea_maps.yml'
  Specifically instead of downloading the 'triplea_maps.yml'
  file and parsing it, the front end will instead contact
  the server and receive a JSON payload that contains the
  map download list.

__Introduce and use map tags__
   Map tags are a generic
  way to add additional meta data to maps dynamically.
  For example, instead of having a 'category' value
  specifically enumerated, we instead now have a
  tag whose key is 'category'. This allows us to have
  an arbitrary set of meta information without
  needing to update the front end.

__Update server to send 'preview image url' to the frontend__
  The server computes the preview image URL to make it easier
  and more explicit for the frontend. Having the server
  instead of the client compute the preview image URL also
  allows for it to be updated in database.
@codecov
Copy link

codecov bot commented Aug 11, 2021

Codecov Report

Merging #9491 (bc7c66a) into master (f243a00) will decrease coverage by 0.00%.
The diff coverage is 49.36%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #9491      +/-   ##
============================================
- Coverage     28.20%   28.19%   -0.01%     
- Complexity     8320     8339      +19     
============================================
  Files          1315     1317       +2     
  Lines         80996    81019      +23     
  Branches      11038    11039       +1     
============================================
+ Hits          22845    22846       +1     
- Misses        55986    56006      +20     
- Partials       2165     2167       +2     
Impacted Files Coverage Δ
.../framework/map/download/MapDownloadSwingTable.java 0.00% <0.00%> (ø)
...ngine/framework/map/listing/MapListingFetcher.java 0.00% <0.00%> (-40.00%) ⬇️
...games/strategy/triplea/settings/ClientSetting.java 89.80% <ø> (-0.07%) ⬇️
.../triplea/settings/ClientSettingSwingUiBinding.java 0.00% <ø> (ø)
...g/triplea/http/client/maps/listing/MapTagType.java 0.00% <0.00%> (ø)
...a/http/client/maps/listing/MapDownloadListing.java 50.00% <30.00%> (+50.00%) ⬆️
...a/org/triplea/http/client/maps/listing/MapTag.java 71.42% <71.42%> (ø)
...in/java/org/triplea/maps/listing/MapTagRecord.java 87.50% <87.50%> (ø)
...in/java/org/triplea/maps/MapsModuleRowMappers.java 75.00% <100.00%> (+25.00%) ⬆️
...a/org/triplea/maps/indexing/MapIndexingResult.java 77.77% <100.00%> (+2.77%) ⬆️
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f243a00...bc7c66a. Read the comment docs.

@beelee1
Copy link
Contributor

beelee1 commented Aug 11, 2021

Is this for the prerelease or effective now ?

@DanVanAtta
Copy link
Member Author

@beelee1
prerelease clients will become broken for map downloads until we have updated the prerelease server to also have the latest code (that is typically automatically deployed after PR merges, but is currently broken so prerelease server will be incompatible). Once that is done, there will be another step for any additional fixes to automatic map indexing and anything else. But otherwise the server will automatically find any map repository in 'triplea-maps' and store in database without needing a 'triplea_maps.yaml' file at all.

@beelee1
Copy link
Contributor

beelee1 commented Aug 11, 2021

Right on. So does this effect the stable then ?

@DanVanAtta
Copy link
Member Author

nope

@DanVanAtta DanVanAtta merged commit 6246701 into master Aug 12, 2021
@DanVanAtta DanVanAtta deleted the use-map-tags-on-client branch August 12, 2021 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants