Repository navigation
build: ship the security layer as its own distribution, codebud-sec - #25
Conversation
Decided with the maintainer before 0.1.0 (option B): codebud and codebud-sec are two PyPI distributions from this repository, released together at one version. `pip install codebud` is the coding agent; `pip install codebud-sec` adds the security layer (profiles, engagements, scope guard, network fence, evidence log, the codebud-sec command) and depends on exactly the same codebud with the crypto extra, since the evidence log is always encrypted. Splitting after a release would have taken codebud-sec away from existing installs on upgrade. The source stays in src/codebud_sec, beside codebud: the core finds the shipped profiles only there. packaging/codebud-sec/ holds its pyproject.toml template and PyPI README; scripts/stage-codebud-sec copies the package, README and COPYING into a build directory and fills in the version. The core's pyproject packages codebud only, and MANIFEST.in prunes src/codebud_sec from its sdist whatever a stale egg-info lists. The GNU tarball and `make install` still carry both. Verified by building both for real: the codebud wheel holds only codebud; the codebud_sec wheel holds the layer, both profiles, the codebud-sec command and Requires-Dist codebud[crypto]==0.1.0; twine check --strict passes. Installed alone the core lists no security profiles; installed together it finds them and codebud-sec runs. * pyproject.toml (tool.setuptools.packages.find): codebud only. (project.scripts, tool.setuptools.package-data): Drop codebud_sec. * MANIFEST.in: New file. * packaging/codebud-sec/pyproject.toml, packaging/codebud-sec/README.md: New files. * scripts/stage-codebud-sec: New script. * Makefile.am (dist-python): Build both. (EXTRA_DIST): Ship the new files. (clean-local): Remove the staging directory. * .gitignore: Ignore it. * tests/test_packaging.py: New file. * README.md, NEWS: Install codebud-sec separately. * docs/chapters/installation.texi, docs/chapters/security.texi (Security Work): Likewise. * docs/chapters/development.texi (Publishing a release): Two distributions, one pending publisher each; list test_packaging.py. * docs/chapters/architecture.texi: Mention packaging/codebud-sec.
The release workflow stages and builds codebud-sec beside codebud, runs twine check on both, and uploads both to TestPyPI and PyPI; each project needs its own pending publisher with the same workflow and environments. release-check's full run builds and checks both, installs both wheels into its throwaway venv, runs both commands, and checks that the core finds codebud-sec's profiles -- the point of the split. * .github/workflows/release.yml (build): Build codebud-sec too. * scripts/release-check: Build, check and install both; check that the core finds the security profiles.
Review summary: correct, after two fixes made before CIOne sweep over the delegated implementation, done locally before CI: conditions → scenarios → each checked against the code and against real builds → De Morgan. Conditions.
Verified, with real builds (
Findings (both fixed in these commits before pushing):
Erring on the safe side, as designed: Verdict: correct. I'll merge once CI passes on all five jobs. CI is needed here because the build configuration changed. |
|
Merging. The review (two findings, fixed before the push) is above. CI is green on all five jobs at |
Ships the security layer as its own PyPI distribution,
codebud-sec, released together withcodebudat one version (option B, decided before 0.1.0). Splitting after a release would have takencodebud-secaway from existing installs on upgrade.pip install codebudis the coding agent.pip install codebud-secadds the security layer: profiles, engagements, scope guard, network fence, evidence log and thecodebud-seccommand. It depends on exactlycodebud[crypto]==X.Y.Z, because the evidence log is always encrypted.make installstill carry both.How
src/codebud_sec, besidecodebud: the core finds the shipped profiles only there.packaging/codebud-sec/holds itspyproject.tomltemplate and PyPI README.scripts/stage-codebud-seccopies the package, README andCOPYINGinto a build directory and fills in the version.pyproject.tomlpackagescodebudonly, andMANIFEST.inprunessrc/codebud_secfrom its sdist.make dist-python, the release workflow andrelease-checkbuild both.release-checkalso checks that the installed core findscodebud-sec's profiles, which is the point of the split.Commits
d5b34c2build: the split, its tests (tests/test_packaging.py) and the docs (README, NEWS, the installation, security, architecture and development chapters).6ac6e97ci(release): the workflow andrelease-checkbuild, check and publish both.Verification (local, before CI)
python -m buildin a throwaway venv):codebudwheel holds onlycodebud;codebud_secwheel holds the layer (17 files, both profiles), thecodebud-seccommand andRequires-Dist: codebud[crypto]==0.1.0;twine check --strictpasses on all four files.defaultandunattended. Installed withcodebud-sec, it also findssecurity-irandsecurity-pentest;codebud-secruns, andpyragecomes in through the dependency.make check(1810 passed),make distcheck,make infoand HTML builds without warnings, ruff clean.CI
This PR changes the build configuration, so CI is needed and runs once on this final head. The review happened locally first; its two findings are already fixed in these commits (see the review comment).
Needed from the maintainer before the first release
A pending publisher for the project
codebud-secon PyPI (and on TestPyPI, for the rehearsal). The values are the same as forcodebud: ownermkhellat, repositorycodebud, workflowrelease.yml, environmentpypi/testpypi.