Skip to content

Commit 0b23b6f

Browse files
docs: fill out remaining external link placeholders (#1564)
All the remaining "UPDATE LINKS" notes in the docs are replaced with actual links to the external Juju/Charmcraft docs. Also changes the "product page" to be `juju.is` rather than `juju.is/docs/sdk` as the latter is going away (`juju.is` was recommended by @tmihoc). (These changes were previously in [a commit in another PR](tmihoc@54dca52) but got lost when changes were forced - it seemed cleanest to break them out into a separate PR).
1 parent 73419d5 commit 0b23b6f

File tree

5 files changed

+13
-40
lines changed

5 files changed

+13
-40
lines changed

docs/custom_conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
# For example: "ubuntu.com/lxd" or "microcloud.is"
110110
# If there is no product website, edit the header template to remove the
111111
# link (see the readme for instructions).
112-
'product_page': 'juju.is/docs/sdk',
112+
'product_page': 'juju.is',
113113
# Add your product tag (the orange part of your logo, will be used in the
114114
# header) to ".sphinx/_static" and change the path here (start with "_static")
115115
# (default is the circle of friends)
@@ -298,8 +298,8 @@
298298
# that should be linked to in this documentation.
299299
intersphinx_mapping = {
300300
'python': ('https://docs.python.org/3', None),
301-
'juju': ('https://canonical-juju.readthedocs-hosted.com/en/latest/', None),
302-
'charmcraft': ('https://canonical-charmcraft.readthedocs-hosted.com/en/latest/', None),
301+
'juju': ('https://canonical-juju.readthedocs-hosted.com/en/latest', None),
302+
'charmcraft': ('https://canonical-charmcraft.readthedocs-hosted.com/en/latest', None),
303303
}
304304

305305
# -- General configuration ---------------------------------------------------

docs/explanation/storedstate-uses-limitations.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77

88
This is an explanatory doc covering how charm authors might track local state in a Juju unit. We'll cover the `ops` concept of [](ops.StoredState), along with some differences in how it works between machine charms and Kubernetes charms. We'll talk about Peer Relations as an alternative for storing some kinds of information, and also talk about how charm authors probably should avoid recording state when they can avoid doing so.
99

10-
<!-- UPDATE LINKS
11-
"Peer Relations", above
12-
-->
10+
> See more: {external+juju:ref}`Peer Relations <manage-relations>`
1311
1412
## A trivial example
1513

@@ -107,14 +105,10 @@ def some_event_handler(event):
107105

108106
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?)
109107

110-
<!-- UPDATE LINKS
111-
"Juju Storage" above
112-
-->
108+
> See more: {external+juju:ref}`Juju Storage <manage-storage>`
113109

114110
In the cases where it is important to share some lightweight configuration data between units of an application, charm author's should look into peer relations. And in the cases where data must be written to a container's local file system (Canonical's Kubeflow bundle, for example, must do this, because the sheer number of services mean that we run into limitations on attached storage in the underlying cloud), authors should do so mindfully, with an understanding of the pitfalls involved.
115111

116-
<!-- UPDATE LINKS
117-
"peer relations", above
118-
-->
112+
> See more: {external+juju:ref}`Peer Relations <manage-relations>`
119113

120114
In sum: use state mindfully, with well chosen tools, only when necessary.

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@ If the charm is a machine charm, workload operation calls can be done directly,
7777

7878
"Juju operations" are the most 'meta' of them all: they do not affect the workload in and of itself, but they share data which is meant to affect the operation of *other* charms that this charm is integrated with.
7979

80-
<!-- UPDATE LINKS:
81-
> See more: [Talking to a workload: control flow from A to Z](), [Charm lifecycle]()
82-
-->
83-
8480
### What we are testing when we unit-test
8581

8682
A 'live', deployed Juju application will have access to all the inputs we discussed above, including environment variables, host system access, and more. Unit tests will typically want to mock all that and focus on mapping inputs to expected outputs. Any combination of the input sources we mentioned above can result in any combination of operations. A few examples of increasing complexity of scenarios we may want to unit test:

docs/howto/manage-stored-state.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,14 @@ store the data in the relation databag.
120120

121121
#### Define a peer relation
122122

123-
Update the `charmcraft.yaml` file to add a `peers` block, as below:
123+
Update the {external+charmcraft:ref}`charmcraft.yaml file <charmcraft-yaml-file>` to add a `peers` block, as below:
124124

125125
```yaml
126126
peers:
127127
charm-peer:
128128
interface: my_charm_peers
129129
```
130130
131-
<!-- UPDATE LINKS
132-
> Read more: [File ‘charmcraft.yaml`]()
133-
-->
134-
135131
#### Set and get data from the peer relation databag
136132
137133
In your `src/charm.py` file, set and get the data from the peer relation

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

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ The instructions all use the Juju `python-libjuju` client, either through the `p
1919

2020
In order to run integrations tests you will need to have your environment set up with `tox` installed.
2121

22-
<!-- UPDATE LINKS
23-
> See more: {ref}`How to set up your development environment <set-up-your-development-environment>`
24-
-->
22+
> See more: {external+juju:ref}`How to set up your development environment <manage-your-deployment-environment>`
2523
2624
## Prepare the `tox.ini` configuration file
2725

@@ -175,9 +173,7 @@ async def test_config_changed(ops_test: OpsTest):
175173

176174
### Test an action
177175

178-
<!-- UPDATE LINKS
179-
> See also: [Action]()
180-
-->
176+
> See also: {external+juju:ref}`Action <action>`
181177
182178
You can execute an action on a unit and get its results.
183179

@@ -214,11 +210,9 @@ How you can connect to a private or public address is dependent on your configur
214210

215211
> Example implementations: [mongodb-k8s-operator](https://github.com/canonical/mongodb-k8s-operator/blob/8b9ebbee3f225ca98175c25781f1936dc4a62a7d/tests/integration/metrics_tests/test_metrics.py#L33), [tempo-k8s-operator](https://github.com/canonical/tempo-k8s-operator/blob/78a1143d99af99a1a56fe9ff82b1a3563e4fd2f7/tests/integration/test_integration.py#L69), [synapse](https://github.com/canonical/synapse-operator/blob/eb44f4959a00040f08b98470f8b17cae4cc616da/tests/integration/conftest.py#L170)
216212
217-
<!-- UPDATE LINKS:
218213
> See more:
219-
> - [Charm development best practices > Fetching network information]()
220-
> - [`juju` CLI commands > juju expose]()
221-
-->
214+
> - {external+juju:ref}`Charm development best practices > Fetching network information <charm-development-best-practices>`
215+
> - {external+juju:ref}`juju CLI commands > juju expose <command-juju-expose>`
222216
223217
### Run a subprocess command within Juju context
224218

@@ -280,15 +274,12 @@ Using the new alias, you can switch context to the new created model, similar to
280274

281275
> Example implementations: [`charm-kubernetes-autoscaler`](https://github.com/charmed-kubernetes/charm-kubernetes-autoscaler/blob/8f4ddf5d66802ade73ed3aab2bb8d09fd9e4d63a/tests/integration/test_kubernetes_autoscaler.py#L31)
282276
283-
<!-- UPDATE LINKS:
284277
> See more:
285-
> - [Juju offers]()
286-
> - [How to manage clouds]()
278+
> - {external+juju:ref}`Juju offers <manage-offers>`
279+
> - {external+juju:ref}`How to manage clouds <manage-clouds>`
287280
> - [pytest-operator | track_model](https://github.com/charmed-kubernetes/pytest-operator/blob/ab50fc20320d3ea3d8a37495f92a004531a4023f/pytest_operator/plugin.py#L720)
288281
> - [pytest-operator | model_context](https://github.com/charmed-kubernetes/pytest-operator/blob/ab50fc20320d3ea3d8a37495f92a004531a4023f/pytest_operator/plugin.py#L480)
289282
> - [pytest-operator | forget_model](https://github.com/charmed-kubernetes/pytest-operator/blob/ab50fc20320d3ea3d8a37495f92a004531a4023f/pytest_operator/plugin.py#L812)
290-
-->
291-
292283
293284
### Deploy a bundle
294285

@@ -377,10 +368,6 @@ There are different ways of specifying a subset of tests to run using `pytest`.
377368
tox -e integration -- tests/integration/test_charm.py -k "not test_one"
378369
```
379370

380-
<!-- UPDATE LINKS:
381-
> Example implementations: [`mysql-k8s-operator`]()
382-
-->
383-
384371
> See more:
385372
> - [`pytest-operator` | `skip_if_deployed`](https://github.com/charmed-kubernetes/pytest-operator/blob/ab50fc20320d3ea3d8a37495f92a004531a4023f/pytest_operator/plugin.py#L139)
386373
> - [`pytest | How to invoke pytest`](https://docs.pytest.org/en/7.1.x/how-to/usage.html)

0 commit comments

Comments
 (0)