package and version inference, build driver persistence#17
Open
package and version inference, build driver persistence#17
Conversation
- noop for the bare driver - will reuse the docker container instead of creating a new one -> enables reusing all kinds of caches, installed build deps etc while still having a fresh worktree and build
90d9022 to
ad295ac
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors the debmagic CLI/build implementation to infer package name/version from debian/changelog, introduces driver persistence (esp. for Docker/incremental workflows), and updates tooling/CI accordingly.
Changes:
- Add package description inference from
debian/changelogand use a structuredPackageVersion. - Introduce persistent build driver configuration and new Docker driver implementation under
pack/. - Update CLI (
build→pack), integration tests, CI, and add Python tests for debmagic-pkg parsing/utilities.
Reviewed changes
Copilot reviewed 19 out of 26 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/integration/test_packages.py | Updates integration test to run cargo run … pack and adjusts Docker base image flag / pip install args. |
| packages/debmagic/tests/assets/config1.toml | Adjusts test config fixture to new [driver] persistent config. |
| packages/debmagic/src/package.rs | Adds changelog-based package name/version inference. |
| packages/debmagic/src/pack/driver_docker.rs | New Docker build driver with optional persistence + metadata handling. |
| packages/debmagic/src/pack/driver_bare.rs | Refactors bare driver to use new shared driver config + updated trait signature. |
| packages/debmagic/src/pack/config.rs | Introduces shared DriverConfig with persistent + per-driver subconfigs. |
| packages/debmagic/src/pack/common.rs | Removes old PackageDescription, updates BuildConfig, changes interactive_shell signature. |
| packages/debmagic/src/pack.rs | Main packaging flow; improves error context and replaces tree copy with ignore walker. |
| packages/debmagic/src/main.rs | Switches CLI subcommand to pack, changes config discovery path, wires CLI overrides. |
| packages/debmagic/src/config.rs | Updates config model (replaces dry_run with incremental) and adjusts tests. |
| packages/debmagic/src/cli.rs | Restructures CLI args, adds docker base-image flag and persistence/incremental flags. |
| packages/debmagic/src/build/driver_docker.rs | Removes old build-module Docker driver implementation. |
| packages/debmagic/src/build/config.rs | Removes old build-module driver config. |
| packages/debmagic/Cargo.toml | Adds dependencies for changelog parsing + ignore-based walking + common crate. |
| packages/debmagic-pkg/tests/test_versioning.py | Adds Python tests for version parsing parity. |
| packages/debmagic-pkg/tests/test_package.py | Adds Python tests for source package parsing. |
| packages/debmagic-pkg/tests/test_exec.py | Adds Python tests for subprocess helper behavior. |
| packages/debmagic-pkg/tests/test_changelog.py | Adds Python tests for changelog parsing (including timestamp parsing). |
| packages/debmagic-pkg/tests/assets/pkg1/debian/control | Adds fixture Debian control file for Python tests. |
| packages/debmagic-pkg/tests/assets/pkg1/debian/changelog | Adds fixture changelog file for Python tests. |
| packages/debmagic-common/src/debian/version.rs | Refactors PackageVersion to Option fields + adds Display. |
| debian/control | Adds new Rust build-deps and removes ${python3:Depends} from debmagic package. |
| Cargo.toml | Adds workspace deps for debmagic-common, debian-changelog, and ignore. |
| Cargo.lock | Locks newly added Rust dependencies. |
| .pre-commit-config.yaml | Adds a clippy pre-commit hook. |
| .github/workflows/ci.yml | Updates CI self-build step to use debmagic pack. |
Comments suppressed due to low confidence (2)
packages/debmagic/src/pack/driver_bare.rs:82
interactive_shellfor the bare driver no longer opens an interactive shell; it only prints the build source directory. This breaks the “drop into shell on failure” workflow inpack.rsfor bare builds. Consider restoring the previous behavior (spawn$SHELL/bash) and use the providedcwdso the shell opens in the build directory.
packages/debmagic/src/pack.rs:276copy_dir_allcopies files todst.join(relative_path)but doesn’t ensure the destination parent directory exists for file entries.ignore::Walkordering isn’t guaranteed to yield directories before files, so this can fail withNo such file or directoryfor nested files. Createdst.join(relative_path).parent()(if any) before callingfs::copy.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
includes other small changes - proper error handling during version parsing - avoid lossy conversions in subcommand arg passing
Allows to place a base image override per distro version in the debmagic config.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 28 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.