Repository navigation
refactor!: drop build log fields and keep typed package errors - #229
Conversation
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 3
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Deploying soar-docs with
|
| Latest commit: |
23a3fc4
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bcf887f7.soar-docs.pages.dev |
| Branch Preview URL: | https://refactor-api-cleanup.soar-docs.pages.dev |
70c64ee to
23a3fc4
Compare
What it does
Breaking changes to the public crate API, removing what was only kept for compatibility.
Build log and build script removed. No repository publishes them anymore. They are gone from
RemotePackage(soar-registry), the metadataPackageandNewPackagemodels and schema (soar-db), andPackage(soar-core). A metadata migration drops the two columns. Metadata JSON that still carries the keys is accepted, and the keys are ignored.RegistryError::MissingEtagremoved. Nothing returns it: a response without an ETag is accepted and refetched on the next sync.PackageErrorkeeps the underlying error. Config and filesystem errors were flattened to strings, which dropped the cause and the diagnostic help. They are now wrapped transparently:PackageError::ConfigError(String)becomesPackageError::Config(ConfigError).FileSystemErrorbecomesPackageError::FileSystem(FileSystemError)instead ofPackageError::Custom(String).Before and after, for a filesystem error:
What it does not do
install_patternsstays deprecated rather than removed. It is a config file key, so removing it would affect users' config files, not only the crate API.Downgrades
Once the migration has run, an older soar fails to search that repository with
no such column: packages.build_script.soar syncdoes not fix it while the repository reports no change. It recovers when the repository publishes new metadata, or when the metadata database is deleted and synced again.Verification
End to end against four live repositories, covering a new repository and the legacy pkgforge ones:
.sdb.zstd..sdb.zstd, built by older tooling with the build columns.info,run, removeupdate, install and a full refetch succeed.no such column: packages.build_script, as described above.info, sync and remove succeed.Applying
up.sqland thendown.sqlto a copy of the legacy pkgcache database removes and restores the columns.New tests:
upgrading_metadata_drops_build_fields_and_keeps_packages: upgrades a database at the old schema holding a build log. It fails with the migration removed.a_filesystem_error_keeps_its_cause_and_helpanda_config_error_keeps_its_own_diagnostic: check the cause, help and code of wrapped errors.Gate:
cargo +nightly fmt --check, clippy with-D warningson stable and nightly,cargo +1.93.1 check,cargo deny check, and 648 tests passing.Summary by CodeRabbit