Skip to content

docs: update tutorials and example charms to match Charmcraft 4.2#2407

Open
Copilot wants to merge 2 commits intomainfrom
copilot/update-example-charms-to-template
Open

docs: update tutorials and example charms to match Charmcraft 4.2#2407
Copilot wants to merge 2 commits intomainfrom
copilot/update-example-charms-to-template

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

This PR updates our example charms to match the latest Charmcraft profiles. For details of what changed in the profiles, see canonical/charmcraft-profile-tools#15.

The most significant change is bumping the base from 22.04 to 24.04. This affects the workload version of the tinyproxy charm. So I'm bumping the installed version in the charm and its integration tests - which also affects the machine charm tutorial (preview). I ran the integration tests locally to validate the changes.

- Update base from ubuntu@22.04 to ubuntu@24.04 in all k8s and machine example charms
- Add `assumes: juju >= 3.6` (+ `k8s-api` for k8s charms) to all example charmcraft.yaml files
- Update juju >= 3.1 to juju >= 3.6 in httpbin-demo
- Update pyproject.toml dependency comment to new template wording in all 7 examples
- Fix extend-exclude position in httpbin-demo/pyproject.toml (move after lint.per-file-ignores)
- Remove commented-out lib_path variable from tox.ini [vars] section in 6 examples
- Remove commented-out codespell lib_path lines from tox.ini [testenv:lint] in 6 examples

Agent-Logs-Url: https://github.com/canonical/operator/sessions/77fddcbd-6394-42d9-b280-d709c376e9e0

Co-authored-by: dwilding <1141260+dwilding@users.noreply.github.com>
Copilot AI requested a review from dwilding April 1, 2026 22:58
@dwilding dwilding changed the title docs: update tutorials and example charms to match Charmcraft 4.2 docs: update example charms to match Charmcraft 4.2 Apr 1, 2026
@dwilding
Copy link
Copy Markdown
Contributor

dwilding commented Apr 1, 2026

@copilot there's more we need to do here. Look at the tinyproxy charm. It installs a specific version of tinyproxy, which will be different now that we've bumped the Ubuntu base. Please figure out everything that needs changing in the charm and also in the machine charm tutorial. After you have finished, I'll run the charm's integration tests locally to verify.

…e) for Ubuntu 24.04

Agent-Logs-Url: https://github.com/canonical/operator/sessions/ba206838-a728-4d9a-ad84-e5c049d6779d

Co-authored-by: dwilding <1141260+dwilding@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 1, 2026

@copilot there's more we need to do here. Look at the tinyproxy charm. It installs a specific version of tinyproxy, which will be different now that we've bumped the Ubuntu base. Please figure out eve...

Done in e50201a. The changes:

  • src/tinyproxy.py: updated the pinned package from tinyproxy-bin 1.11.0-1 (Ubuntu 22.04/jammy) to tinyproxy-bin 1.11.1-3 (Ubuntu 24.04/noble), and updated the packages.ubuntu.com and manpages.ubuntu.com URLs from jammynoble
  • tests/integration/test_charm.py: updated assert version == "1.11.0""1.11.1" to match the version reported by tinyproxy -v on noble
  • docs/tutorial/write-your-first-machine-charm.md: updated the inline code snippets to match (same version/URL changes), updated the sample juju status output (1.11.01.11.1, ubuntu@22.04ubuntu@24.04), and updated the integration test assertion snippet ("1.11.0""1.11.1")

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • packages.ubuntu.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title docs: update example charms to match Charmcraft 4.2 docs: update tutorials and example charms to match Charmcraft 4.2 Apr 1, 2026
@dwilding
Copy link
Copy Markdown
Contributor

dwilding commented Apr 1, 2026

@copilot please review both tutorial source carefully. Is there anywhere else that the Ubuntu base is shown in status output, filenames, etc? (There might not be). If yes, please update.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 1, 2026

@copilot please review both tutorial source carefully. Is there anywhere else that the Ubuntu base is shown in status output, filenames, etc? (There might not be). If yes, please update.

Checked both tutorial sources — no remaining 22.04, jammy, or other old-base references in either the machine charm tutorial or the Kubernetes charm tutorial. Everything is already up to date.

@dwilding dwilding removed their request for review April 2, 2026 03:53
# 'charm-libs' block in charmcraft.yaml, run `charmcraft fetch-libs` to download the libraries,
# then inspect the libraries for dependencies specified in PYDEPS. List those dependencies here.
dependencies = [
"ops>=2.23,<4", # Version 2.23 introduced the load_config() method.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I seem to remember we decided to keep one example charm on Ops 2.

@dwilding dwilding marked this pull request as ready for review April 2, 2026 04:27
@dwilding
Copy link
Copy Markdown
Contributor

dwilding commented Apr 2, 2026

Not at all urgent for review (can happily wait until next week). I've left my discussion comments with Copilot open in case they're interesting to read.

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.

2 participants