Skip to content

feat: Cross-track upgrades#174

Draft
MichaelThamm wants to merge 31 commits intomainfrom
feat/charmhub-module
Draft

feat: Cross-track upgrades#174
MichaelThamm wants to merge 31 commits intomainfrom
feat/charmhub-module

Conversation

@MichaelThamm
Copy link
Copy Markdown
Contributor

@MichaelThamm MichaelThamm commented Jan 15, 2026

  • Should every charm have a juju_charm datasource i.e., no upgrades.tf file, or only one if there is a breaking change i.e., a upgrades.tf file.
  • Remove the manual refreshing from our upgrade itests
    • Should we add any other kind of tests?
  • Add this feature for COS, once COS Lite is robust

Blocked by:

This PR will need coordination with:

Relates to:

Issue

We want a smooth UX between the TF provider and the Juju client for upgrading the product's channels.

Solution

  1. Use the juju_charm datasource to provide the latest revisions for a charm in a specific track.
  2. Use lifecycle {replace_triggered_by = [terraform_data.grafana_ingress_interface]} to replace the juju_integration in the event that the interface changes.

Checklist

  • Convert the doc to a How-to
  • I have added or updated relevant documentation.
    • Add an upgrade guide
    • Update the charmhub source to a GH source
  • Add the charmhub module to COS
  • How to get past the "relation will break" Juju client errors so upgrades are more seamless. Lifecycle resources?
  • PR title makes an appropriate release note and follows conventional commits syntax.
  • Merge target is the correct branch, and relevant tandem backport PRs opened.

Context

In the future charms will have unique tracks which the products needs to map to:

Testing Instructions

COS Lite manual

  1. Deploy COS Lite 2/stable

Apply complete! Resources: 33 added, 0 changed, 0 destroyed.

  1. Refresh to dev/edge

Apply complete! Resources: 1 added, 6 changed, 1 destroyed.

  1. Revert to 2/stable

Apply complete! Resources: 1 added, 6 changed, 1 destroyed.

Documentation

See the CI job for the documentation changes

--overlay ./storage-small-overlay.yaml
```

(deploy-cos-ref)=
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.

Iirc we haven't started using these our docs yet.
Remind me - it's an anchor or cross-sphinx ref?
I think juju had this and it turned out to be brittle and difficult to maintain, but maybe I'm missing something.

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.

It's an anchor, but it can also be used as a cross-sphinx/project ref for projects that have that enabled.

You haven't started using them in the COS docs yet, but it is the standard approach to cross-linking for sphinx docs projects, so at some point, you should change your links to use these refs. Juju uses them in their docs, but I don't know what conversations happened around it

Using ref targets/anchors is nicer because otherwise anytime you change the filename/path, it'll break any of those links in your docs.

IMO, it could go either way in this PR (add it or don't add it), but the future goal should be that all docs have a ref target, and you use those for linking instead of file path. (Copilot should be able to handle it well when you do make this initiative)

Comment on lines +33 to +38
```diff
+ http = {
+ source = "hashicorp/http"
+ version = "~> 3.0"
+ }
```
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.

Do we need to sepcify http here? Can it be a derived dependency from the charmhub module?

@MichaelThamm
Copy link
Copy Markdown
Contributor Author

Hi @YanisaHS, could you please review this PR with me? I would appreciate some opinions on the clarity and structure of the document.

@YanisaHS
Copy link
Copy Markdown
Contributor

@MichaelThamm Yea, I'd be happy to! 😊 I likely won't have time to review it until Tuesday though (I'm off Monday)

@MichaelThamm
Copy link
Copy Markdown
Contributor Author

@MichaelThamm Yea, I'd be happy to! 😊 I likely won't have time to review it until Tuesday though (I'm off Monday)

@YanisaHS This PR is still a work in progress. It may be best to wait until I make some more progress before reviewing this PR. The docs still need updating before first review.

@YanisaHS
Copy link
Copy Markdown
Contributor

@MichaelThamm Ok, sounds good! Just tag me when you're ready again

@MichaelThamm
Copy link
Copy Markdown
Contributor Author

MichaelThamm commented Jan 21, 2026

@YanisaHS

I think it is ready for review now: docs link

Some input I would like from you is:

  • This feature (updating channel updates charms to latest revision) is not guaranteed to work across tracks. In the tutorial, it shows 2/stable to 2/edge which is within the same track so it should be guaranteed to work.
  • Would you convert this into a How-to instead of a tutorial?

I need to add a comment to the doc about not guaranteed to work across tracks.

@YanisaHS
Copy link
Copy Markdown
Contributor

@MichaelThamm Ok! I'll review it soon (was off the end of last week)

@YanisaHS
Copy link
Copy Markdown
Contributor

@MichaelThamm I'll go through and actually provide feedback in the doc, but first addressing your two issues:

This feature (updating channel updates charms to latest revision) is not guaranteed to work across tracks. In the tutorial, it shows 2/stable to 2/edge which is within the same track so it should be guaranteed to work.

For a tutorial, this is fine. I'd still recommend you add a note (as you suggested) describing this condition, mostly for any driveby users / people who find this without realizing they're in a Diataxis ✨ tutorial ✨. Tutorials are more of a "sandboxed" experience, so it's okay to feed the user the configurations they need.

But...

Would you convert this into a How-to instead of a tutorial?

Yes. The Tutorials section in the Observability docs gives the docs in order a new user should follow, so now it reads like (1) Deploy, (2) Refresh, (3) Sync .. etc. The experience feels odd for a new user - if it's important they're on this track, then that should be given to them in the previous Deploy steps, rather than deploying and refreshing right after.

Actually this is something we'll discuss as a team this cycle: From a user's perspective, one of the most immediate concerns I have with the docs is that they don't clearly state how to deploy COS in the How-to guides (examples: Charmed Kafka, Charmed Postgres, Charmed K8s). When this is the first thing a user needs to do to access the product (and rest of the documentation).

I'll provide feedback with this in mind as I go through your PR - assuming you'll refactor it into a how-to guide.

Copy link
Copy Markdown
Contributor

@YanisaHS YanisaHS left a comment

Choose a reason for hiding this comment

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

I was mostly just looking at the Refresh product module doc, although I quick scanned the README and didn't have any comments. If you want me to provide feedback on something else in the PR then LMK

--overlay ./storage-small-overlay.yaml
```

(deploy-cos-ref)=
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.

It's an anchor, but it can also be used as a cross-sphinx/project ref for projects that have that enabled.

You haven't started using them in the COS docs yet, but it is the standard approach to cross-linking for sphinx docs projects, so at some point, you should change your links to use these refs. Juju uses them in their docs, but I don't know what conversations happened around it

Using ref targets/anchors is nicer because otherwise anytime you change the filename/path, it'll break any of those links in your docs.

IMO, it could go either way in this PR (add it or don't add it), but the future goal should be that all docs have a ref target, and you use those for linking instead of file path. (Copilot should be able to handle it well when you do make this initiative)

@@ -0,0 +1,111 @@
# Refresh COS to a new channel

In this example, you will learn how to deploy COS Lite and refresh from channel `2/stable` to `2/edge`. To do this, we can deploy COS Lite via Terraform in the same way as [in the tutorial](https://documentation.ubuntu.com/observability/track-2/tutorial/installation/cos-lite-microk8s-sandbox).
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.

Assuming this gets refactored into a tutorial, the language/framing should change so it's not like "In this example, you'll learn...". How-to guides aren't really "learning" experiences, it's more just like "here's the steps you need to do XYZ".

Example: Charmed Kafka: How to upgrade


- Know how to deploy {ref}`COS Lite with Terraform <deploy-cos-ref>`

## Introduction
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.

Similar to a comment I made above, this section can be less narrative if being refactored into a how-to guide

(btw I'm happy to meet and discuss my comments with you if you want!)

terraform apply
```

At this point, you will have successfully upgraded COS Lite from `2/stable` to `2/edge`!
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.

The steps overall seem fine and pretty straightforward. I can provide some better feedback once it gets refactored into a how-to

@MichaelThamm
Copy link
Copy Markdown
Contributor Author

Blocked by this issue:

MichaelThamm and others added 8 commits March 22, 2026 19:29
* Separates the storage directives for different worker roles

Signed-off-by: Bartlomiej Gmerek <bartlomiej.gmerek@canonical.com>

* chore: TODOs for tests

* Separates storage directives for Tempo workers

Signed-off-by: Bartlomiej Gmerek <bartlomiej.gmerek@canonical.com>

* Separates storage directives for Tempo workers

Signed-off-by: Bartlomiej Gmerek <bartlomiej.gmerek@canonical.com>

* Cleans up after testing

Signed-off-by: Bartlomiej Gmerek <bartlomiej.gmerek@canonical.com>

---------

Signed-off-by: Bartlomiej Gmerek <bartlomiej.gmerek@canonical.com>
Co-authored-by: Michael Thamm <mike.thamm@canonical.com>
This PR fixes #188

Signed-off-by: Jose C. Massón <939888+Abuelodelanada@users.noreply.github.com>
@MichaelThamm MichaelThamm changed the title feat: Charmhub module for upgrades without revision pins feat: Cross-track upgrades Mar 23, 2026
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.

7 participants