Add local metadata - #178
Conversation
|
|
Thank you! I would then suggest implementing the following things:
For
We could leave the package local metadata for now, and first try to solve the multiple package versions from different repositories in the current structure. |
Max13245
left a comment
There was a problem hiding this comment.
nice :)
Will you also update the docs with local metadata explanations?
Please don't forget to add rust docs and the clippy changes.
| exit(1); | ||
| }; | ||
|
|
||
| // Create the repository provider to fetch Packit metadata from |
There was a problem hiding this comment.
| // Create the repository provider to fetch Packit metadata from | |
| // Create the repository provider to fetch Packit metadata |
| pub use handler::LocalMetadata; | ||
| pub use handler::LocalPrebuildMetadata; |
There was a problem hiding this comment.
These don't seem to be used?
|
|
||
| /// Only refresh the local metadata | ||
| #[arg(long)] | ||
| refresh_only: bool, |
There was a problem hiding this comment.
Maybe also add a skip_refresh flag.
| disable_prebuilds: false, | ||
| }; | ||
|
|
||
| // TODO: prebuild list and prebuild provider are needed here |
There was a problem hiding this comment.
There is still a TODO here.
| package_name: &PackageName, | ||
| package_conflicts: &[PackageName], | ||
| ) -> Result<Vec<PackageName>> { | ||
| let mut conflicting_packages = Vec::new(); |
| &self, | ||
| register: &PackageRegister, | ||
| package_name: &PackageName, | ||
| package_conflicts: &[PackageName], |
There was a problem hiding this comment.
This could also be a hashset (with some extra changes).
| } | ||
|
|
||
| // Remove files that are not needed anymore | ||
| let removed_files: Vec<_> = before_files.iter().filter(|x| !after_files.contains(x)).collect(); |
There was a problem hiding this comment.
I think you can remove the collect here.
This PR implements a local metadata storage to prevent needing network access to load in some information about packages.
Things to still decide on:
<package>/.packit? An alternative could be a global directory in the Packit prefix, also preparing for future package specific local metadata.conflicts_withfield in the local metadata, or keep it on the package in the register? Moving it would facilitate a future expansion to conflicts between specific versions, but does require some refactors.homepageanddescriptionfields of apackage.tomlfile? Should we keep them in the register, or do we also want to include them into the local metadata?