Skip to content

Conversation

@dwilding
Copy link
Contributor

@dwilding dwilding commented Dec 26, 2025

In Integrate your charm with PostgreSQL, the part from "Add relation event observers" to the end of "Share the authentication information with your application" needs improving:

  • I find the sequence of file edits confusing. I don't know what the goal is until I get to the end and work backwards.
  • A couple of the method explanations and docstrings are much wordier than they need to be.
  • A couple of places still talk about setting status without collect-status: The diagram at the end and the part mentioned in #2095.

I've reorganised the flow and improved the explanations of what's happening. That includes replacing the diagram by more focused text.

Previews of updated sections:

@dwilding dwilding linked an issue Dec 26, 2025 that may be closed by this pull request
@dwilding dwilding marked this pull request as ready for review December 26, 2025 08:18
Copilot AI review requested due to automatic review settings December 26, 2025 08:18
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 improves the PostgreSQL integration tutorial by reorganizing the documentation flow and simplifying docstrings. The changes make it easier to understand how to handle database relation data by presenting steps in a more logical sequence and reducing verbose explanations.

Key changes:

  • Reorganized tutorial sections to present database authentication handling before Pebble layer updates
  • Simplified overly verbose docstrings in get_app_environment() and fetch_postgres_relation_data() methods
  • Replaced a diagram with clearer textual explanation of service behavior with/without database relations

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

File Description
docs/tutorial/from-zero-to-hero-write-your-first-kubernetes-charm/integrate-your-charm-with-postgresql.md Reorganized tutorial flow to introduce database authentication methods before Pebble layer updates; replaced diagram with text explanation
examples/k8s-3-postgresql/src/charm.py Simplified docstrings for get_app_environment() and fetch_postgres_relation_data() methods
examples/k8s-4-action/src/charm.py Simplified docstrings for get_app_environment() and fetch_postgres_relation_data() methods
examples/k8s-5-observe/src/charm.py Simplified docstrings for get_app_environment() and fetch_postgres_relation_data() methods

💡 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.

K8s tutorial: Clarify how status is set if no relation data

1 participant