Goal

  • Today's goal is to finish the work of having a unified way to access local and remote repositories.

Plan

  • Change the ClientRepository type to be an enum instead of struct. This will make it possible for obnam/src/bin/cmd/mod::open_repository to return values for local or remote repositories. The current approach of using a trait means only one concrete type can be returned.

  • Change anything else that's needed to reach the goal.

Notes

  • Made that change. Not entirely happy that ClientRepository has put_chunk (and similar for other operations), which mirrors entirely the BackupRepository trait method. ClientRepository now exists both to hide the local/remote distinction and to add specific methods for specific kinds of chunk.

    I guess I could move the specific methods into BackupRepository as provided methods, but I'll let this simmer for a while first, to see if its worth it, later.

  • Next I'll manually test that the client can use a local repository or a remote one, just by changing the configuration file.

  • That worked reasonably well. There's one caveat: the client does not yet have a repository-independent subcommand to find chunks in the repository. But as I don't need that yet, I'll worry about it later.

  • Then I need to update the subplot to do the verification I just did manually. This requires juggling daemons with Subplot and that's something I've never made comfortable. If nothing else, the test suite currently does not capture or show server log output, which makes debugging a pain. I really need to fix that soon.

  • Actually, that's easier than I thought. daemonize lets me direct stderr to a file. But more work if I want to it in a way that fits subplot test logging otherwise. I'll leave it for later.

  • Next, I need to tidy up use of the client configuration file so that the repository field is used, not server_url and server_token. Done. I like dropping old junk, but sometimes the junk is necessary to make progress.

  • All right, this should work, at least in tests.

Summary

  • The Obnam client can now handle both local and remote repositories merely by specifying the right one in the configuration file. This is an important step towards usefulness.

Support?

If you'd like to fund Obnam development, see my funding page. My high level goal is described on the architecture page. What is most important about backup software to you?