Skip to content

Commit 8f25088

Browse files
docs: use noun relation and verb integrate (#1574)
Update documentation, mostly the content that used to be on Discourse, to use the noun form relation and the verb integrate. --------- Co-authored-by: Tony Meyer <[email protected]>
1 parent 0b23b6f commit 8f25088

22 files changed

+51
-51
lines changed

docs/explanation/charm-relation-interfaces.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
> See also: {ref}`manage-interfaces`
55
6-
[`charm-relation-interfaces`](https://github.com/canonical/charm-relation-interfaces) is a repository containing specifications, databag schemas and interface tests for Juju relation interfaces. In other words, it is the source of truth for data and behavior of providers and requirers of integrations.
6+
[`charm-relation-interfaces`](https://github.com/canonical/charm-relation-interfaces) is a repository containing specifications, databag schemas and interface tests for Juju relation interfaces. In other words, it is the source of truth for data and behavior of providers and requirers of relations.
77

8-
The purpose of this project is to provide uniformity in the landscape of all possible integrations and promote charm interoperability.
8+
The purpose of this project is to provide uniformity in the landscape of all possible relations and promote charm interoperability.
99

10-
Juju interfaces are untyped, which means that for juju to think two charms can be integrated all it looks at is whether the interface names of the two endpoints you're trying to connect are the same string. But it might be that the two charms have different, incompatible implementations of two different integrations that happen to have the same name.
10+
Juju interfaces are untyped, which means that for juju to think two charms can be integrated all it looks at is whether the interface names of the two endpoints you're trying to connect are the same string. But it might be that the two charms have different, incompatible implementations of two different relations that happen to have the same name.
1111

12-
In order to prevent two separate charms from rolling their own integration with the same name, and prevent a sprawl of many subtly different interfaces with similar semantics and similar purposes, we introduced `charm-relation-interfaces`.
12+
In order to prevent two separate charms from rolling their own relation with the same name, and prevent a sprawl of many subtly different interfaces with similar semantics and similar purposes, we introduced `charm-relation-interfaces`.
1313

1414
## Using `charm-relation-interfaces`
1515

@@ -37,7 +37,6 @@ For each interface, the charm-relation-interfaces repository hosts:
3737

3838

3939
## Charm relation interfaces in Charmhub
40-
In the future, Charmhub will have a searchable collection of integration interfaces.
4140
Charmhub will, for all charms using the interface, verify that they implement it correctly (regardless of whether they use the 'official' implementation or they roll their own) in order to give the charm a happy checkmark on `charmhub.io`. In order to do that it will need to fetch the specification (from `charm-relation-interfaces`) *and* the charm repo, because we can't know what implementation they are using: we need the source code.
4241

4342

docs/explanation/interface-tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Interface tests are tests that verify the compliance of a charm with an interface specification.
66
Interface specifications, stored in {ref}`charm-relation-interfaces <charm-relation-interfaces>`, are contract definitions that mandate how a charm should behave when integrated with another charm over a registered interface.
77

8-
Interface tests will allow `charmhub` to validate the integrations of a charm and verify that your charm indeeed supports "the" `ingress` interface and not just an interface called "ingress", which happens to be the same name as "the official `ingress` interface v2" as registered in charm-relation-interfaces (see [here](https://github.com/canonical/charm-relation-interfaces/tree/main/interfaces/ingress/v2)).
8+
Interface tests will allow `charmhub` to validate the relations of a charm and verify that your charm indeeed supports "the" `ingress` interface and not just an interface called "ingress", which happens to be the same name as "the official `ingress` interface v2" as registered in charm-relation-interfaces (see [here](https://github.com/canonical/charm-relation-interfaces/tree/main/interfaces/ingress/v2)).
99

1010
Also, they allow alternative implementations of an interface to validate themselves against the contractual specification stored in charm-relation-interfaces, and they help verify compliance with multiple versions of an interface.
1111

docs/explanation/storedstate-uses-limitations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def some_event_handler(event):
103103
return
104104
```
105105

106-
In the other cases where state is needed, authors ideally want to relate a charm to a database, attach storage (see Juju storage), or simply be opinionated, and hard code the single "correct" state into the charm. (Perhaps `ExampleBlog` should always be run in `production` mode when deployed as a charm?)
106+
In the other cases where state is needed, authors ideally want to integrate a charm with a database, attach storage (see Juju storage), or simply be opinionated, and hard code the single "correct" state into the charm. (Perhaps `ExampleBlog` should always be run in `production` mode when deployed as a charm?)
107107

108108
> See more: {external+juju:ref}`Juju Storage <manage-storage>`
109109

docs/explanation/testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Integration tests typically take significantly longer to run than unit tests.
5858
**Coverage.**
5959

6060
* Charm actions
61-
* Charm integrations
61+
* Charm relations
6262
* Charm configurations
6363
* That the workload is up and running, and responsive
6464
* Upgrade sequence

docs/howto/get-started-with-charm-testing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ The "inputs" of a charm run are therefore:
6464
- integration (relation) data
6565
- stored state
6666

67-
Only the event context is guaranteed to be present. The other input sources are optional, but typically a charm will have at least some config and a few integrations adding to its inputs.
67+
Only the event context is guaranteed to be present. The other input sources are optional, but typically a charm will have at least some config and a few relations adding to its inputs.
6868

6969
The charm code executes and typically produces side-effects aimed at its workload (for example: it writes files to a disk, runs commands on a system, or reconfigures a process) or at other charms it integrates with (for example: it writes relation data). We call this 'operating' a workload, and that is what a charm is meant to do. The ways in which a charm operates can be roughly categorised as:
7070

@@ -115,7 +115,7 @@ When you instantiate `Context` and `State` objects, the charm instance does not
115115
The `Context` provides methods for all the Juju events. For example:
116116

117117
- the cloud admin changes the charm config: `ctx.on.config_changed()`
118-
- the cloud admin relates this charm to some other: `ctx.on.relation_created(relation)`
118+
- the cloud admin integrates this charm with some other: `ctx.on.relation_created(relation)`
119119
- a remote unit joins in a relation (for example, because the cloud admin has scaled up a remote charm): `ctx.on.relation_joined(relation)`
120120
- a remote unit touches its relation data: `ctx.on.relation_changed(relation)`
121121
- a cloud admin removes a relation: `ctx.on.relation_departed(relation)`
@@ -177,7 +177,7 @@ Things you typically want to test with integration tests:
177177
- The charm can be deployed (i.e. `juju deploy ./packed_charm.charm` deploys an application that reaches `active` or `waiting` within a reasonable time frame)
178178

179179
These are 'smoke tests' that should always be present, and are provided for you when using `charmcraft init`. The following are non-smokey, proper integration tests.
180-
- The charm can be related to other applications without erroring
180+
- The charm can be integrated with other applications without erroring
181181
- and the relation has the expected effect on the charm's operation logic
182182
- The charm can be configured
183183
- and the config has the expected effect on the charm's operation logic
@@ -208,7 +208,7 @@ async def test_operation(ops_test: OpsTest):
208208
app: Application = ops_test.model.applications.get("tester")
209209
await app.set_config({"my-key": "my-value"})
210210

211-
# Add another charm and relate them:
211+
# Add another charm and integrate them:
212212
await ops_test.model.deploy('other-app')
213213
await ops_test.model.relate('tester:endpoint1', 'other-charm:endpoint2')
214214

docs/howto/manage-libraries.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def test_my_object_data(context, endpoint, n_relations):
220220

221221
Fetch the library.
222222

223-
In your `src/charm.py`, observe the custom events it puts at your disposal. For example, a database library may have provided a `database_relation_ready` event -- a high-level wrapper around the relevant `juju` relation events -- so you use it to manage the database integration in your charm as below:
223+
In your `src/charm.py`, observe the custom events it puts at your disposal. For example, a database library may have provided a `database_relation_ready` event -- a high-level wrapper around the relevant `juju` relation events -- so you use it to manage the database relation in your charm as below:
224224

225225
```python
226226

docs/howto/manage-relations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# How to manage relations
33
> See first: {external+juju:ref}`Juju | Relation <relation>`, {external+juju:ref}`Juju | Manage relations <manage-relations>`, {external+charmcraft:ref}`Charmcraft | Manage relations <manage-relations>`
44
5-
To add integration capabilities to a charm, you’ll have to define the relation in your charm’s charmcraft.yaml file and then add relation event handlers in your charm’s `src/charm.py` file.
5+
To add relation capabilities to a charm, you’ll have to define the relation in your charm’s charmcraft.yaml file and then add relation event handlers in your charm’s `src/charm.py` file.
66

77
## Implement the feature
88

@@ -65,7 +65,7 @@ Other than this, implement a subordinate relation in the same way as any other r
6565

6666
#### Using a charm library
6767

68-
For most integrations, you will now want to progress with using the charm library recommended by the charm that you are integrating with. Read the documentation for the other charm on Charmhub and follow the instructions, which will typically involve adding a requirer object in your charm’s `__init__` and then observing custom events.
68+
For most relations, you will now want to progress with using the charm library recommended by the charm that you are integrating with. Read the documentation for the other charm on Charmhub and follow the instructions, which will typically involve adding a requirer object in your charm’s `__init__` and then observing custom events.
6969

7070
In most cases, the charm library will handle observing the Juju relation events, and your charm will only need to interact with the library’s custom API. Come back to this guide when you are ready to add tests.
7171

docs/howto/write-integration-tests-for-a-charm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ For `oci-images` you can reference an image registry.
132132

133133
### Test a relation
134134

135-
To test an integration between two applications, you can just integrate them through
135+
To test a relation between two applications, integrate them through
136136
the model. Both applications have to be deployed beforehand.
137137

138138
```

docs/howto/write-unit-tests-for-a-charm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ harness.charm.unit.status = BlockedStatus("Testing")
9999
Any of your charm’s properties and methods (including event callbacks) can be accessed using
100100
`harness.charm`. You can check out the [harness API
101101
docs](ops_testing_harness) for more ways to use the
102-
harness to trigger other events and to test your charm (e.g. triggering leadership-related events,
102+
harness to trigger other events and to test your charm (e.g. triggering events regarding leadership,
103103
testing pebble events and sidecar container interactions, etc.).
104104

105105

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The library provides:
2424
- {ref}`ops_testing`, the recommended API for unit testing charms
2525
- {ref}`ops_testing_harness`, the deprecated API for unit testing charms
2626

27-
You can structure your charm however you like, but with the `ops` library, you get a framework that promotes consistency and readability by following best practices. It also helps you organise your code better by separating different aspects of the charm, such as managing the application's state, handling integrations with other services, and making the charm easier to test.
27+
You can structure your charm however you like, but with the `ops` library, you get a framework that promotes consistency and readability by following best practices. It also helps you organise your code better by separating different aspects of the charm, such as managing the application's state, handling integrating with other services, and making the charm easier to test.
2828

2929

3030
---------

docs/reference/ops-testing.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Juju state all at once, define the Juju context against which to test the charm,
1111
and fire a single event on the charm to execute its logic. The tests can then
1212
assert that the Juju state has changed as expected.
1313

14-
A very simple test, where the charm has no config, no integrations, the unit
14+
A very simple test, where the charm has no config, no relations, the unit
1515
is the leader, and has a `start` handler that sets the status to active might
1616
look like this:
1717

@@ -38,8 +38,8 @@ Writing these tests should nudge you into thinking of a charm as a black-box
3838
'input to output' function. The inputs are:
3939

4040
- Event: why am I, the charm, being executed
41-
- State: am I the leader? what is my integration data? what is my config?
42-
- Context: what integrations can I have? what containers can I have?
41+
- State: am I the leader? what is my relation data? what is my config?
42+
- Context: what relations can I have? what containers can I have?
4343

4444
The output is another `State`: the state after
4545
the charm has interacted with the mocked Juju model.

docs/tutorial/from-zero-to-hero-write-your-first-kubernetes-charm/create-a-minimal-kubernetes-charm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ title: |
5959
demo-fastapi-k8s
6060
description: |
6161
This is a demo charm built on top of a small Python FastAPI server.
62-
This charm could be related to PostgreSQL charm and COS Lite bundle (Canonical Observability Stack).
62+
This charm could be integrated with the PostgreSQL charm and COS Lite bundle (Canonical Observability Stack).
6363
summary: |
6464
FastAPI Demo charm for Kubernetes
6565
```

docs/tutorial/from-zero-to-hero-write-your-first-kubernetes-charm/integrate-your-charm-with-postgresql.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Well done, you've got everything you need to set up a database relation!
4747
## Define the charm relation interface
4848

4949
<!--
50-
Charm integration interfaces are described in the `charmcraft.yaml` file. To connect to the PostgreSQL charm, we will need to find out the name of the interface that PostgreSQL exposes so other charms can connect to it and then update our `charmcraft.yaml` file.
50+
Charm relation interfaces are described in the `charmcraft.yaml` file. To connect to the PostgreSQL charm, we will need to find out the name of the interface that PostgreSQL exposes so other charms can connect to it and then update our `charmcraft.yaml` file.
5151
-->
5252

5353
Now, time to define the charm relation interface.
@@ -243,12 +243,12 @@ def _on_database_created(self, event: DatabaseCreatedEvent) -> None:
243243
self._update_layer_and_restart()
244244
```
245245

246-
The diagram below illustrates the workflow for the case where the database integration exists and for the case where it does not:
246+
The diagram below illustrates the workflow for the case where the database relation exists and for the case where it does not:
247247

248248
![Integrate your charm with PostgreSQL](../../resources/integrate_your_charm_with_postgresql.png)
249249

250250

251-
## Update the unit status to reflect the integration state
251+
## Update the unit status to reflect the relation state
252252

253253
Now that the charm is getting more complex, there are many more cases where the unit status needs to be set. It's often convenient to do this in a more declarative fashion, which is where the collect-status event can be used.
254254

@@ -322,7 +322,7 @@ Now, integrate our charm with the newly deployed `postgresql-k8s` charm:
322322
juju integrate postgresql-k8s demo-api-charm
323323
```
324324

325-
> Read more: [Integration](https://juju.is/docs/olm/integration), [`juju integrate`](https://juju.is/docs/olm/juju-integrate)
325+
> Read more: {external+juju:ref}`Juju | Relation (integration) <relation>`, [`juju integrate`](inv:juju:std:label#command-juju-integrate)
326326

327327

328328
Finally, run:
@@ -379,7 +379,7 @@ This should produce something similar to the output below (of course, with the n
379379
{"names":{"1":"maksim","2":"simon"}}
380380
```
381381

382-
Congratulations, your integration with PostgreSQL is functional!
382+
Congratulations, your relation with PostgreSQL is functional!
383383

384384
## Review the final code
385385

docs/tutorial/from-zero-to-hero-write-your-first-kubernetes-charm/observe-your-charm-with-cos-lite.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Note: When you rebuild your charm with `charmcraft pack`, Charmcraft will copy t
6767

6868
### Define the Prometheus relation interface
6969

70-
In your `charmcraft.yaml` file, before the `peers` block, add a `provides` endpoint with relation name `metrics-endpoint` and interface name `prometheus_scrape`, as below. This declares that your charm can offer services to other charms over the `prometheus-scrape` interface. In short, that your charm is open to integrations with, for example, the official Prometheus charm. (Note: `metrics-endpoint` is the default relation name recommended by the `prometheus_scrape` interface library.)
70+
In your `charmcraft.yaml` file, before the `peers` block, add a `provides` endpoint with relation name `metrics-endpoint` and interface name `prometheus_scrape`, as below. This declares that your charm can offer services to other charms over the `prometheus-scrape` interface. In short, that your charm is open to integrating with, for example, the official Prometheus charm. (Note: `metrics-endpoint` is the default relation name recommended by the `prometheus_scrape` interface library.)
7171

7272
```yaml
7373
provides:
@@ -139,7 +139,7 @@ Note: When you rebuild your charm with `charmcraft pack`, Charmcraft will copy t
139139

140140
### Define the Loki relation interface
141141

142-
In your `charmcraft.yaml` file, beneath your existing `requires` endpoint, add another `requires` endpoint with relation name `log-proxy` and interface name `loki_push_api`. This declares that your charm can optionally make use of services from other charms over the `loki_push_api` interface. In short, that your charm is open to integrations with, for example, the official Loki charm. (Note: `log-proxy` is the default relation name recommended by the `loki_push_api` interface library.)
142+
In your `charmcraft.yaml` file, beneath your existing `requires` endpoint, add another `requires` endpoint with relation name `log-proxy` and interface name `loki_push_api`. This declares that your charm can optionally make use of services from other charms over the `loki_push_api` interface. In short, that your charm is open to integrating with, for example, the official Loki charm. (Note: `log-proxy` is the default relation name recommended by the `loki_push_api` interface library.)
143143

144144

145145
```yaml
@@ -203,7 +203,7 @@ Note: The `grafana_dashboard` library also depends on the [`juju_topology`](htt
203203

204204
### Define the Grafana relation interface
205205

206-
In your `charmcraft.yaml` file, add another `provides` endpoint with relation name `grafana-dashboard` and interface name `grafana_dashboard`, as below. This declares that your charm can offer services to other charms over the `grafana-dashboard` interface. In short, that your charm is open to integrations with, for example, the official Grafana charm. (Note: Here `grafana-dashboard` endpoint is the default relation name recommended by the `grafana_dashboard` library.)
206+
In your `charmcraft.yaml` file, add another `provides` endpoint with relation name `grafana-dashboard` and interface name `grafana_dashboard`, as below. This declares that your charm can offer services to other charms over the `grafana-dashboard` interface. In short, that your charm is open to integrating with, for example, the official Grafana charm. (Note: Here `grafana-dashboard` endpoint is the default relation name recommended by the `grafana_dashboard` library.)
207207

208208
```yaml
209209
provides:
@@ -287,9 +287,9 @@ juju deploy cos-lite --trust
287287
```
288288

289289

290-
### Expose the application integration endpoints
290+
### Expose the application relation endpoints
291291

292-
Once all the COS Lite applications are deployed and settled down (you can monitor this by using `juju status --watch 2s`), expose the integration points you are interested in for your charm -- `loki:logging`, `grafana-dashboard`, and `metrics-endpoint` -- as below.
292+
Once all the COS Lite applications are deployed and settled down (you can monitor this by using `juju status --watch 2s`), expose the relation points you are interested in for your charm -- `loki:logging`, `grafana-dashboard`, and `metrics-endpoint` -- as below.
293293

294294
```text
295295
juju offer prometheus:metrics-endpoint

0 commit comments

Comments
 (0)