play-haskell icon indicating copy to clipboard operation
play-haskell copied to clipboard

Save GHC version in stored pastes

Open tomsmeding opened this issue 2 years ago • 3 comments

Currently when loading a stored paste, the playground just selects the default GHC version, rather than the version selected when the paste was created. This is annoying when wanting to demonstrate behaviour with one particular GHC version.

tomsmeding avatar Feb 09 '23 15:02 tomsmeding

Hi @tomsmeding I'd like to start on this. Any tips or anything I should be aware of?

trevorsibanda avatar Mar 01 '23 13:03 trevorsibanda

Thanks! I expect that you'll need to do the following things:

  • Change the database schema in play-haskell-server/src/DB.hs (don't forget to up the version number)
  • Write a DB migration script like the existing migrate_db_N_M.sh
  • Modify the Save endpoint in Play.hs to take a JSON value instead of plain bytes (look at other endpoints how that might work) -- also looks like that endpoint could use a exitExitEarlyT
  • Modify the client in play.mustache to do the right thing

Let me know if you get stuck!

tomsmeding avatar Mar 01 '23 13:03 tomsmeding

Opened a draft PR.

Comments welcome before I move forward tomorrow.

trevorsibanda avatar Mar 01 '23 18:03 trevorsibanda

I've implemented this in https://github.com/haskell/play-haskell/compare/7eace73a6f7c4f2454a91b0afaf863e302167b8d...3df191ff71a3c2f7775e7ed81b572e2edd47e8a6.

tomsmeding avatar Jan 30 '25 18:01 tomsmeding