Goal

  • My goal for today is to refactor the UnlockedClient type so that command like backup and restore easy to implememnt.

Plan

  • Run tests.

  • Refactor.

Notes

  • Unfortunately, I have been lax in keeping up the subplot for Obnam and the try.sh script I wrote to compensate doesn't work today.

  • Before I figure out that, I'm going to fix the logging at startup, because it irritates me. To make sure I can manually test log level setting, I made Obnam log its version at every log level. This results in log spam on every invocation. To fix this, I'll add a special subcommand just to test the log level setting, and add a subplot scenario to verify log level setting works.

    Did that and adjusted the test suite accordingly.

  • Debugging the actual failure is difficult without data, so I'll add all the logging I need to help with that.

  • The problem is that when decrypting a backup chunk, it seems to actually be a chunk of uncompressed file data.

  • When I obnam chunk inspect the backup chunk it works, because for some reason the inspection always treats the payload of the backup chunk as uncompressed file data. This smells bad.

  • The root cause seems to be that in encrypted chunks, the encrypted payload treats credentials as one variant, and all others as a lumped "other" variant. I remember doing that to simplify the code. It shouldn't actually matter, and the round trip unit tests work fine. I see no point in the code where a serialized backup chunk would be stored as uncompressed data.

  • In the round trip test for encrypted chunks, decrypting a backup chunk as uncompressed file data fails, as expected. I don't understand why it works in the inspect code. Worse, in the try.sh test, the backup chunk payload actually is uncompressed data.

  • Oh! In the code that makes a backup, the backup chunk is uploaded as uncompressed data! No wonder. Fixed that and voila!

  • I didn't get to actually refactor the unlocked client type, as I spent all my time today on fixing the test.

Summary

  • I need to get the test suite be properly implemented, and drop the messy test script. I'll get back to refactoring after that.

Join?

If you'd like to help guide Obnam developent so it fits your needs better, join the community. Or join the Zulip chat to watch the discussion.