patch applied (hackage-server): "Add 'resetState' to StateComponent" and 2 others

devnull at community.haskell.org devnull at community.haskell.org
Tue Nov 27 17:43:57 CET 2012


Tue Nov 27 10:11:58 GMT 2012  Edsko de Vries <edsko at well-typed.com>
  * Add 'resetState' to StateComponent
  Ignore-this: a4dcd475cc01e6593f8fe735cfed171
  
  resetState has type
  
    StateComponent -> BlobStorage -> FilePath -> IO (StateComponent st)
  
  and basically creates a new state component with the initial state. This is now
  used consistently throughout the initFooFeature functions to initialize the
  state, so that many initFeature methods now simply look like
  
  initFooFeature <some params> = do
    st <- fooStateComponent ..
    return (fooFeature <params> st)
  
  fooStateComponent = do
    st <- openLocalStateFrom ...
    return StateComponent {
        ...
      , resetState = fooStateComponent
      }
  
  This is a nicer separation of concerns, but more importantly, this is a
  stepping stone towards fixing 'testRoundtrip'.
  

    M ./Distribution/Server/Features/BuildReports.hs -19 +15
    M ./Distribution/Server/Features/Check.hs -18 +14
    M ./Distribution/Server/Features/Core.hs -18 +17
    M ./Distribution/Server/Features/Distro.hs -18 +14
    M ./Distribution/Server/Features/Documentation.hs -24 +19
    M ./Distribution/Server/Features/DownloadCount.hs -19 +16
    M ./Distribution/Server/Features/HaskellPlatform.hs -18 +15
    M ./Distribution/Server/Features/Mirror.hs -13 +14
    M ./Distribution/Server/Features/PreferredVersions.hs -21 +16
    M ./Distribution/Server/Features/Tags.hs -19 +16
    M ./Distribution/Server/Features/Upload.hs -41 +43
    M ./Distribution/Server/Features/Users.hs -26 +28
    M ./Distribution/Server/Framework/Feature.hs -1 +24

Tue Nov 27 15:32:33 GMT 2012  Edsko de Vries <edsko at well-typed.com>
  * Remove testRoundtrip
  Ignore-this: 64252fffcbd74c025d4eedb862003847
  
  StateComponent now provides enough informaiton to define testRoundtrip
  generically for all features (just equality on states). This is possible
  because the check for *blobs* will not be necessary anymore, as we will take
  care of this generically, too (we don't yet, though).
  
  This now throws an error in test-backup in the import/export for Core;
  presumably this error was always there, we just didn't notice it becauset
  testRoundtrip was set up incorrectly. (I think the error is not so important,
  rounding error for dates.)

    M ./Distribution/Server.hs -48 +11
    M ./Distribution/Server/Features.hs -2 +2
    M ./Distribution/Server/Features/BuildReports.hs -2 +1
    M ./Distribution/Server/Features/BuildReports/Backup.hs -7 +1
    M ./Distribution/Server/Features/Check.hs -2 +1
    M ./Distribution/Server/Features/Check/State.hs -1 +1
    M ./Distribution/Server/Features/Check/Types.hs -1 +1
    M ./Distribution/Server/Features/Core.hs -12 +1
    M ./Distribution/Server/Features/Distro.hs -3 +1
    M ./Distribution/Server/Features/Documentation.hs -10 +2
    M ./Distribution/Server/Features/DownloadCount.hs -2 +1
    M ./Distribution/Server/Features/HaskellPlatform.hs -2 +1
    M ./Distribution/Server/Features/HaskellPlatform/State.hs -1 +1
    M ./Distribution/Server/Features/Mirror.hs -3 +1
    M ./Distribution/Server/Features/Packages.hs -1
    M ./Distribution/Server/Features/PreferredVersions.hs -2 +1
    M ./Distribution/Server/Features/ServerApiDoc.hs -1 +1
    M ./Distribution/Server/Features/Tags.hs -2 +1
    M ./Distribution/Server/Features/Tags/Backup.hs -1
    M ./Distribution/Server/Features/Upload.hs -6 +3
    M ./Distribution/Server/Features/Upload/State.hs -2 +2
    M ./Distribution/Server/Features/Users.hs -4 +2
    M ./Distribution/Server/Framework/BackupDump.hs -38 +2
    M ./Distribution/Server/Framework/BackupRestore.hs -8
    M ./Distribution/Server/Framework/Feature.hs -16 +84
    M ./Distribution/Server/Users/State.hs -2 +2
    M ./Main.hs -19 +32

Tue Nov 27 15:49:02 GMT 2012  Edsko de Vries <edsko at well-typed.com>
  * Include fractions of seconds during export
  Ignore-this: cce3a160b0605067d9319256a9f7df5f
  
  This fixes the roundtrip test for Core

    M ./Distribution/Server/Framework/BackupRestore.hs -1 +1




More information about the cabal-devel mailing list