Description
We have three sources of code external to ohm-website that interact/make their way into the code base for full OHM functionality:
- Map style JSON
- Timeslider javascript
- Inspector panel
How things have been and are now
As we developed these tools, we have used mishmash of methods to bring the code together:
- Map styles historically were manually spliced in periodically and done as a PR on
ohm-website. This was good for local testing and clarity of what's in the website codebase, but bad for efficiency and ease of deployment.- We implemented a deploy script to automate the inclusion of styles at a specific commithash, but that raised the issue of local testing, as noted here Improved deployment of map style #597
- Timeslider we used to pull in from a live JS link from the timeslider repo served via Github Pages, but this was limited in that there was essentially no staging environment.
- We implemented a simple deploy-side script to pull in timeslider at a specific commithash. This solved out Timeslider staging issue but created another instance of the problem with map-styles, where local testing of
ohm-websitedoesn't have the final JS in it and so is not a full representation of the code deployed to staging.
- We implemented a simple deploy-side script to pull in timeslider at a specific commithash. This solved out Timeslider staging issue but created another instance of the problem with map-styles, where local testing of
- Inspector hasn't been touched in a long time and still uses Github Pages links, https://openhistoricalmap.github.io/ohm-inspector/api/api.js and https://openhistoricalmap.github.io/ohm-inspector/api/api.css, that are easy but lack staging affordances.
How we want things to be
- Latest working code from all three sources (Map styles, Timeslider, Inspector) is easily and automatically pulled into
ohm-websiteso that local testing is a full representation of what's running on the site. - Each of the source repos has a clear development vs main/production branches, and
ohm-websitepulls from production and that code is assumed working
this could be achieved quickly via git submodule or a little less quickly via publishing all three as NPM modules.
We have existing tickets related to this need:
- Package time slider UI as a MapLibre plugin #914 -- making the Timeslider a Maplibre Plugin
- Improved deployment of map style #597 -- lack of local testing for map styles
Map styles considerations
One thing this would require is a full cleanup and hardening of the workflows in map-styles so that we are consistently using branches and PRs between staging and master or renamed to main or some other branch that we pull from for the production styles. Currently, it's not always the case that a style JSON at the tip of staging in that repo is working.
I think a wrinkle with the styles especially is where the step of testing the style in ohm-website occurs, and what that implies about whether the code in a specific map-styles is "known working" in the context of the Rails app.
An ideal outcome there would be that local testing pulls styles from staging, then if that's all working, we have to merge staging>master in map-styles or make changes if needed, then ultimately merge and deploy from map-styles branch master. But then there's still jumping back and forth between repos, which is a drag.
If we assume that somehow the JSON in map-styles was already tested in Rails, then we just shift the problem of hand syncing between two repos off of the dev working on ohm-website onto the cartography team, which is not an ideal use of skills.
cc @erictheise
Sub-issues
Collapse Sub-issuesSub-issues
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn Production
Activity
[-]Shift to Git submodule or NPM package approach for map-stytle and timeslider deployment[/-][+]Shift to Git submodule or NPM package approach for map-style and timeslider deployment[/+]danrademacher commentedon Jan 7, 2025
As soon as #945 is done, then the
mainbranch ofmap-styleswill always be known-working map style code, and we could implement the git-submodule approach to pulling in those styles.@erictheise if at all possible, I would like to keep the default branch in
map-stylesto bestagingas a convenience to cartographers, since that is where 99% of their work will be done and tested.When you pull the styles into the website repo, can you check out the
mainbranch in that process?1ec5 commentedon Jan 7, 2025
If you’re considering Git submodules specifically, please be sure to document that rigorously. Submodules have a way of confusing everyone because they don’t get initialized, fetched, or pulled automatically. I guess the same is true if you end up using a script or package manager instead.
Re: OpenHistoricalMap/issues#929, adds a prepare script, a package.js…
Re: OpenHistoricalMap/issues#929, changes to ohm-website to allow it …
Re: OpenHistoricalMap/issues#929, use the proper @openhistoricalmap/m…
erictheise commentedon Feb 6, 2025
I tried the submodule approach but ended up going with the npm approach. It (map-styles, not timeslider) is working for me locally. Two related draft PRs at OpenHistoricalMap/ohm-website#269 and OpenHistoricalMap/map-styles#32.
Re: OpenHistoricalMap/issues#929, adds correct license and bug/issue …
Re: OpenHistoricalMap/issues#929, copy updated style from staging and…
Re: OpenHistoricalMap/issues#929, replace openhistoricalmap.github.io…
Re: OpenHistoricalMap/issues#929, more name change backfill
3 remaining items
Merge pull request #487 from OpenHistoricalMap/929-shift-to-npm-appro…
Merge pull request #269 from OpenHistoricalMap/929-shift-to-npm-appro…
Re: OpenHistoricalMap/issues#929, version bump of map-styles to corre…
Merge pull request #285 from OpenHistoricalMap/map-styles-0.9.6
Re: OpenHistoricalMap/issues#929, for testing in staging environment
Re: OpenHistoricalMap/issues#929, fix weird artifact in package.json
[-]Shift to Git submodule or NPM package approach for map-style and timeslider deployment[/-][+]Shift to Git submodule or NPM package approach for map-style[/+]danrademacher commentedon May 16, 2025
Let's narrow this ticket down to just the map style, which is done. We can make a new tickets for the timeslider and inspector.