Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding initial module for JLAP support; still a WIP * making a few updates to the JLAP module * updating doc string * initial commit to add a blake2b has to the state file * removing accidentally committed jlap stuff * removing unnecessary dependency * updating imports * fixing formatting issues * updating this branch to instead switch the blake2 hash implementation to blake2b * fixing formatting issues * attempting to fix an issue with the windows test runner * saving progress so far * range request works better now * adding the variant checks for JLAP * adding a new JLAPManager object to hold a lot of the data and logic need for fetching, updating and patching; still incomplete * making a few updates to JLAPManager struct; adding blake2_hash field * caching and updating the jlap file is more-or-less working * I think this actually works! Stil need to write tests though 🙄; coming soon... * adding the start of some testing * finished add first test ✅ * Added more tests and example The tests work when just running the jlap module but fail when running the entire test suite. * Fixing test related stuff Because I used the `tokio:fs` crate in my JLAP code I was seeing unpredictable behavior when mixing in the `std::fs` crate with my tests. Switching the tests to use `tokio::fs` instead appears to have resolved this issue. * Adding hash verification; test refactor Here, I'm adding a hash verification as the last step in a successful jlap patch operation. The `patch_repo_data` function now returns this updated hash. I'm guessing it will be useful for updating the `*.state.json` file. This commit also refactors the tests a little bit to make it easier to reason about (trying to hide some of the setup code in their own functions). * couple of small changes * Updates to return the hash object instead of string This commit also makes changes to the rattler_digest code. I think it's better to store the hash type there rather than in the rattler_repodata::fetch::cache module that is private. I also updated the way that the hashes are generated to take advantage of the rattler_digest library too. * Re-working the way JLAP works This commit is a large refactor based on a conversation I had with a colleague. Instead of caching the JLAP file itself, we now just store information about the request in the .state.json file. This helps simplify the code quite a bit. * clippy issues; updating docs * more updates based on review comments * Refactoring to make code easier read plus more! This commit does some refactor to hopefully increase code readability. It introduces a new `JLAP` struct which holds information related to the JLAP response. * Adds working checksum validation 🙌 This commit finishes the validate_checksum method. It also updates the error messages to be a little less redundant (removing the `Error` suffix). * changes based on comments from review * Updates the serializers for hash values This commit updates the serializers used for hash values it relies on the `serde_as` macro now. I had to change some values in the `Cargo.toml` file to get this to work. * more tweaks and fixes * addressing more comments from review * more suggestions from review * updating comment * moving hex decoding to serde * we always need to return the latest iv value we get by running validate_checksum * use Blake2b in `validate_cached_state` * updating fetch_repo_data so it returns earlier when it successfully fetches JLAP data * Getting closer to a working JLAP What still should be done: - We should save the headers of the JLAP request to respect the cache timeouts - This doesn't play well with the progress bar yet * updating docs and adding a new error for when the parsing of the checksum fails * Lots of refactor from manual testing This commit inclues a lot of refactoring I did based on manual testing with real repodata (still needs to be included as unit tests 😬). The case I was not handling well were empty JLAP responses. This happens when there is no data to update. I was also saving the wrong values for the new initialization vector and had to address this too. * fixing documentation error * adding another test case to handle jlap responses with no new patches * adding another test case to make sure that the range not satisfiable error handling logic works as expected * refactoring tests to make them easier to read * Refactor test cases and adds ordering of repo data This commit contains two things: 1. I added a way for the serializer to order the repo data. This is necessary to make the blake2 hashes line up correctly. It does incur a performance penalty. 2. I refactored the tests to make use of `rstest` and test cases. I did this because there was a lot of redundant code in the test module --------- Co-authored-by: Wolf Vollprecht <w.vollprecht@gmail.com>
- Loading branch information