Skip to content

feat(distribution): PyPI/container packaging readiness (#953) - #1141

Merged
Sinity merged 1 commit into
masterfrom
feature/feat/distribution-packaging
May 17, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/feat/distribution-packaging

Conversation

@Sinity

@Sinity Sinity commented May 17, 2026

Copy link
Copy Markdown
Owner

Summary

Wires Polylogue's existing wheel/sdist verification into CI on every push, adds a tag-driven release workflow that publishes to PyPI via OIDC Trusted Publishing and pushes a multi-stage OCI image to GHCR, and documents the new post-tag operator checklist. Covers Phase 1 (Python/PyPI) and Phase 3 (OCI container) of #953.

Problem

Today the only supported install path is nix develop inside the repo. pyproject.toml already declares wheel metadata, devtools verify-distribution-surface already builds + smokes the wheel/sdist locally, and flake.nix exposes packages.default — but none of it is published, none of it runs in CI, and docs/release.md still notes "Verify wheel and sdist build (once #416 lands the install path)." Each missing channel is a barrier to external adoption (see #953 acceptance criteria).

Solution

Distribution-channel changes are kept to packaging surfaces only; no polylogue/ source is touched.

  • .github/workflows/ci.yml: new distribution job runs devtools verify-distribution-surface, uploads the built wheel/sdist as a CI artifact. Closes the distribution.wheel-ci / distribution.sdist-ci gaps that docs/plans/distribution-coverage.yaml had tracked under fix(distribution): gate installed artifacts and build metadata #593.
  • .github/workflows/release.yml: new workflow triggered by vX.Y.Z tag push (and a workflow_dispatch dry-run path).
    • build job re-runs the distribution gate and extracts the project version from pyproject.toml.
    • publish-pypi job uses pypa/gh-action-pypi-publish with id-token: write (OIDC Trusted Publishing — no API token, no committed secret). Requires a one-time Trusted Publisher registration on PyPI; documented in docs/release.md.
    • publish-container job builds Containerfile with docker/build-push-action and pushes to ghcr.io/<owner>/polylogue with docker/metadata-action-derived semver tags.
  • Containerfile: multi-stage. Builder uses ghcr.io/astral-sh/uv to uv build --wheel from the checkout. Runtime uses python:3.13-slim-bookworm, installs the wheel under a non-root user (polylogue UID 1000), runs as PID 1 under tini, declares VOLUME ["/data", "/config"] with XDG-aligned env defaults. Default CMD is polylogue --help; operators override to invoke polylogued run --enable-api etc.
  • docs/plans/distribution-coverage.yaml: flip wheel/sdist ci_build/ci_test to true (now verifiable by verify_manifests.check_distribution_ci_claims), declare an oci_container artifact, retire the four #593 CI gaps, and file two new #953-tracked gaps (distribution.container-ci-build for missing pre-tag image build; distribution.browser-extension-store for the unsubmitted extension covering feat(distribution): broad-distribution packaging (PyPI, Nix, container, cask, brew) #953 phase 4).
  • docs/release.md: drop the #416 caveat, document the Trusted Publisher prerequisite, and add post-tag smoke steps for PyPI install and GHCR pull.
  • CHANGELOG.md: Unreleased > Added entry.

Phases 2 (Nix flake — nix run already works), 4 (browser extension store submission), and 5 (Homebrew/AUR) are deliberately out of scope for this PR; they remain tracked on #953.

Verification

$ devtools verify-manifests
  ✓ manifest consistency checks passed
$ devtools verify-ci-workflows
verify-ci-workflows: 9 workflow files checked, no errors
$ pytest tests/unit/devtools/test_verify_manifests.py tests/unit/devtools/test_verify_ci_workflows.py -q --no-header
38 passed in 8.99s
$ python -c "import yaml; yaml.safe_load(open('.github/workflows/release.yml')); yaml.safe_load(open('.github/workflows/ci.yml')); yaml.safe_load(open('docs/plans/distribution-coverage.yaml'))"
(ok)
$ devtools verify --quick
(static gates green except for pre-existing render-all drift on master:
 docs/cli-reference.md, docs/test-quality-workflows.md,
 docs/verification-catalog.md, .cache/site — confirmed identical with my
 branch stashed; tracked elsewhere, not introduced by this PR.)

devtools verify-distribution-surface itself runs in the new CI job — locally it requires network egress to PyPI and was not re-run in this iteration since the gate is unchanged.

Follow-ups

Ref #953

Wire wheel/sdist verification into CI on every push, add tag-driven
release automation that publishes to PyPI via OIDC Trusted Publishing
and pushes a multi-stage OCI image to GHCR, and document the new
post-tag operator checklist.

- ci.yml: new `distribution` job runs verify-distribution-surface
- release.yml: new workflow triggered by vX.Y.Z tag push
  (build-and-smoke → publish-pypi → publish-container)
- Containerfile: multi-stage uv-built wheel installed into
  python:3.13-slim-bookworm under a non-root user with tini PID 1
- distribution-coverage.yaml: flip wheel/sdist ci_build/ci_test to
  true, declare oci_container artifact, close #593-tracked CI gaps,
  open #953-tracked container-CI and browser-extension-store gaps
- docs/release.md: drop the "(once #416 lands)" caveat, document the
  Trusted Publisher / GHCR post-tag verification steps
- CHANGELOG.md: Unreleased Added entry

Ref #953

Co-Authored-By: Claude <[email protected]>
@coderabbitai

coderabbitai Bot commented May 17, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Sinity has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 54 minutes and 2 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 77058add-e859-492e-8f20-67442abef414

📥 Commits

Reviewing files that changed from the base of the PR and between 632ffe7 and f7910f5.

📒 Files selected for processing (6)
  • .github/workflows/ci.yml
  • .github/workflows/release.yml
  • CHANGELOG.md
  • Containerfile
  • docs/plans/distribution-coverage.yaml
  • docs/release.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/feat/distribution-packaging

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Sinity
Sinity merged commit e7bf42f into master May 17, 2026
3 checks passed
@Sinity
Sinity deleted the feature/feat/distribution-packaging branch May 17, 2026 00:39

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f7910f577f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/plans/distribution-coverage.yaml Resolved
@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

Only the rows listed above are dispositioned. Held findings remain open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant