Indexes 4: Adds Indexes for SPK repositories#1339
Indexes 4: Adds Indexes for SPK repositories#1339dcookspi wants to merge 10 commits intoindex-3-flatbuffer-and-solver-package-specfrom
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
00757f2 to
8530adc
Compare
|
I can't replicate the test failures locally at the moment. I'll dig into them further tomororw. |
47ea722 to
af8dcc2
Compare
68bb519 to
1e28bf4
Compare
1e28bf4 to
854446a
Compare
The issue was related to deprecated packages and the migration-to-components feature. I've put in a temporary fix so the tests pass for now. But it should not get merged as is. A direction needs to be decided with regard to deprecated packages, solves, and what to index in order to replace the temp fix with a better solution. See #1339 (comment) comment above. |
af8dcc2 to
53f24d1
Compare
a58142a to
b32582c
Compare
53f24d1 to
cb733cd
Compare
b32582c to
1a43f64
Compare
These have been fixed now. |
96ad9df to
31d99fa
Compare
| let name = repo.name(); | ||
|
|
||
| let filepath = Self::repo_index_location(repo).await?; | ||
| let temp_file = PathBuf::from(format!("{}_being_generated", filepath.display())); |
There was a problem hiding this comment.
Please use a unique filename via uuid/ulid/tempfile but you're on the right track. The temp file should be in the same directory as the final file.
There was a problem hiding this comment.
I've added a ulid to the temp file name.
| temp_file.display().to_string(), | ||
| err, | ||
| )); | ||
| } else { |
There was a problem hiding this comment.
All the error handlers at this point forward should attempt to delete the temp file.
There was a problem hiding this comment.
I've pulled out the index file removal code into a function and used it for the temp files in each of the error handling points.
acf608d to
d47df82
Compare
… flabuffers index and configuration Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
…file name. Also renames IndexPackage after rebasing earlier changes Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
verification, and moving temp file to correct location once all that is complete. Refactors loading index from file to create a read_from_file method that is used when loading an index and verifying one during the save process. Adds log output of the number of tables in a newly generated index that is about to be saved to a file. Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
so it is more general. Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
…ory configs Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
34d1bbd to
e5ee8b6
Compare
Note: for info on benefits of indexing for spk solves see #1340 (5 of 5). Maybe start there and work back down to this PR if you prefer to review PRs top down.
This adds a new
Indexedrepository type,RepositoryIndextraits, aRepoIndexenum, and a flatbuffer index implementation inFlatBufferRepoIndex, along with some configuration. The indexing is designed to help the solvers. An index only contains information useful for solving. It does not contain enough information to do other things, such as build or test the packages.The hierarchy of new types is roughly:
This also updates the solver and repo based tests to include the new Indexed repo. This does not add command line tools or solver interaction for indexes. Those are in the last PR in this chain.
This is the change that adds indexes and index based packages to Spk repositories.
This is 4 of 5 chained PRs for adding indexes to spk solves:
new_unchecked()constructors to spk schema objects #1337spk repo indexsubcommand for index generation and updates #1340version_filterfield in index schema #1344