Page MenuHomePhabricator

Update maps diagrams to reflect our revid changes
Closed, ResolvedPublic5 Estimated Story Points

Description

Once we're sure that our changes should remain, we can update the existing documentation to include revid details.

https://phabricator.wikimedia.org/diffusion/MSKA/browse/master/docs/diagrams/output/

Seems to be written in PlantUML, which includes an online editor.

One approach would be to create a new sequence or process diagram, zooming in on the "get GeoJSON data" step. The important new logic to mention is,

  • Kartographer will generate a versioned static map link when the $wgKartographerVersionedStaticMaps flag is enabled.
  • Kartotherian switches depending on the versioned_maps configuration, and either passes the revid through to mapdata or ignores it.
  • The mapdata client sends either a page title or a revid to the mapdata API.
  • The mapdata API switches depending on $wgKartographerVersionedMapdata. If true and a revid is requested, then historical mapdata is returned. This can be represented as several flows which fall through to "current mapdata", and one special flow with several fail-open branchpoints, that results in historical mapdata.

Review:

Draft for an sequence diagram that extends the get GeoJSON step from staticMapRequestDataFlow (edit in plantUML). I went with the term "User" instead of "Frontend" or "Webbrowser", because the existing diagrams also use that term.

┌────┐                                    ┌────────────┐          ┌────────────┐
│User│                                    │Kartotherian│          │Kartographer│
└─┬──┘                                    └─────┬──────┘          └─────┬──────┘
  │ Request (domain, title, revId, groups, etc.)│                       │       
  │ ────────────────────────────────────────────>                       │       
  │                                             │                       │       
  │                                             │ title, revId, groupid │       
  │                                             │ ──────────────────────>       
  │                                             │                       │       
  │                                             │        GeoJSON        │       
  │                                             │ <──────────────────────       
  │                                             │                       │       
  │                     png                     │                       │       
  │ <────────────────────────────────────────────                       │       
┌─┴──┐                                    ┌─────┴──────┐          ┌─────┴──────┐
│User│                                    │Kartotherian│          │Kartographer│
└────┘                                    └────────────┘          └────────────┘

Event Timeline

I played around with the diagram. What do you think?

┌────┐          ┌─────────┐             ┌────────────┐                  ┌────────────┐           
│User│          │MediaWiki│             │Kartographer│                  │Kartotherian│           
└─┬──┘          └────┬────┘             └─────┬──────┘                  └─────┬──────┘           
  │   action=view    │                        │                               │                  
  │ ────────────────>│                        │                               │                  
  │                  │                        │                               │                  
  │                  │wikitext with <mapframe>│                               │                  
  │                  │────────────────────────>                               │                  
  │                  │                        │                               │                  
  │                  │     ┌────────────────────────────────────────┐         │                  
  │                  │     │can decide to not add revid             │         │                  
  │                  │     │//$wgKartographerVersionedStaticMaps//  │         │                  
  │                  │     └────────────────────────────────────────┘         │                  
  │                  │<img> with revid in URL │                               │                  
  │                  │<────────────────────────                               │                  
  │                  │                        │                               │                  
  │       HTML       │                        │                               │                  
  │ <────────────────│                        │                               │                  
  │                  │                        │                               │                  
  │                  │         image URL with revid                           │                  
  │ ──────────────────────────────────────────────────────────────────────────>                  
  │                  │                        │                               │                  
  │                  │                        │               ┌─────────────────────────────────┐
  │                  │                        │               │can decide to not forward revid  │
  │                  │                        │               │//versioned_maps//               │
  │                  │                        │               └─────────────────────────────────┘
  │                  │                        │ geodata API request with revid│                  
  │                  │                        │ <──────────────────────────────                  
  │                  │                        │                               │                  
  │                  │      ┌─────────────────────────────────────┐           │                  
  │                  │      │can decide to ignore revid           │           │                  
  │                  │      │//$wgKartographerVersionedMapdata//  │           │                  
  │                  │      └─────────────────────────────────────┘           │                  
  │                  │                        │            GeoJSON            │                  
  │                  │                        │ ──────────────────────────────>                  
  │                  │                        │                               │                  
  │                  │                 .png   │                               │                  
  │ <──────────────────────────────────────────────────────────────────────────                  
┌─┴──┐          ┌────┴────┐             ┌─────┴──────┐                  ┌─────┴──────┐           
│User│          │MediaWiki│             │Kartographer│                  │Kartotherian│           
└────┘          └─────────┘             └────────────┘                  └────────────┘
@startuml
actor User
User -> MediaWiki: action=view
MediaWiki -> Kartographer: wikitext with <mapframe>
hnote over Kartographer: can decide to not add revid\n//$wgKartographerVersionedStaticMaps//
Kartographer -> MediaWiki: <img> with revid in URL
MediaWiki -> User: HTML
User -> Kartotherian: image URL with revid
hnote over Kartotherian: can decide to not forward revid\n//versioned_maps//
Kartotherian -> Kartographer: geodata API request with revid
hnote over Kartographer: can decide to ignore revid\n//$wgKartographerVersionedMapdata//
Kartographer -> Kartotherian: GeoJSON
Kartotherian -> User : .png
@enduml

The proposed changes satisfy all requirements, so I'll put in the backlog to be made into a patch. I have some small suggestions which we can get into in code review, such as "geodata API request with revid" should be "geodata API request with revid or title", and "can decide to ignore revid" results in using the latest revision.

Oh, please feel free, @awight. These are really relevant additions.

Oh, please feel free, @awight. These are really relevant additions.

I will! But first we need this to be a patch so it can be commented upon and edited...

Change 793030 had a related patch set uploaded (by Svantje Lilienthal; author: Svantje Lilienthal):

[mediawiki/services/kartotherian@master] Added new diagram for versioned mapdata

https://gerrit.wikimedia.org/r/793030

Change 793030 merged by jenkins-bot:

[mediawiki/services/kartotherian@master] Added new diagram for versioned mapdata

https://gerrit.wikimedia.org/r/793030