Skip to content

Conversation

@dwilding
Copy link
Contributor

@dwilding dwilding commented Dec 31, 2025

This is an intermediate PR for switching the Kubernetes charm tutorial to use uv and the latest Charmcraft profiles. Target branch is k8s-tutorial-uv


This PR switches "Create a minimal Kubernetes charm" to use a charm project generated by the latest version of Charmcraft. That lets us remove several of the manual steps.

Preview doc

Not ready for review. Rebase after merging #2258.

@dwilding dwilding changed the base branch from main to k8s-tutorial-uv December 31, 2025 10:12
@dwilding dwilding requested a review from Copilot December 31, 2025 10:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the Chapter 1 Kubernetes charm example to use the current Charmcraft initialization template and tooling. The changes transition from a manual charm setup to one generated by charmcraft init --profile kubernetes, incorporating modern Python project management with uv and updated testing infrastructure.

Key changes:

  • Replaces manual charm creation steps with charmcraft init workflow
  • Updates project structure to use pyproject.toml with dependency groups instead of requirements.txt
  • Modernizes testing infrastructure with uv-based dependency management
  • Updates copyright year from 2025 to 2026

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
examples/k8s-1-minimal/tox.ini Updated to use uv-venv-lock-runner, dependency groups, reorganized test environments, and added format/lint configurations
examples/k8s-1-minimal/tests/unit/test_charm.py Changed string quotes to double quotes, added testing documentation link
examples/k8s-1-minimal/tests/integration/test_charm.py Updated string quotes, simplified docstrings, changed charm path handling to use resolve()
examples/k8s-1-minimal/tests/integration/conftest.py Enhanced with better logging, CHARM_PATH environment variable support, and improved error handling
examples/k8s-1-minimal/src/charm.py Changed all string literals to double quotes, simplified docstrings
examples/k8s-1-minimal/requirements.txt Removed file (dependencies moved to pyproject.toml)
examples/k8s-1-minimal/pyproject.toml Added comprehensive project configuration with dependency groups for lint, unit, and integration tests
examples/k8s-1-minimal/charmcraft.yaml Modernized to use current Charmcraft format with base/platforms instead of bases, added uv plugin configuration
docs/tutorial/write-your-first-machine-charm.md Updated tool installation instructions to mention uv separately from tox
docs/tutorial/from-zero-to-hero-write-your-first-kubernetes-charm/set-up-your-development-environment.md Complete rewrite with detailed VM setup, Concierge installation, and project directory mounting instructions
docs/tutorial/from-zero-to-hero-write-your-first-kubernetes-charm/observe-your-charm-with-cos-lite.md Updated VM name references from charm-dev to juju-sandbox-k8s, charm name from demo-api-charm to fastapi-demo, model name from welcome-k8s to testing
docs/tutorial/from-zero-to-hero-write-your-first-kubernetes-charm/make-your-charm-configurable.md Updated charm and model name references to match new naming conventions
docs/tutorial/from-zero-to-hero-write-your-first-kubernetes-charm/integrate-your-charm-with-postgresql.md Updated VM, charm, and model name references throughout
docs/tutorial/from-zero-to-hero-write-your-first-kubernetes-charm/expose-operational-tasks-via-actions.md Updated charm and model name references in example commands
docs/tutorial/from-zero-to-hero-write-your-first-kubernetes-charm/create-a-minimal-kubernetes-charm.md Major restructure to use charmcraft init workflow instead of manual file creation, updated all references to new naming conventions
.github/workflows/example-charm-integration-tests.yaml Moved k8s-1-minimal from one test matrix to another

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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