Skip to content

Commit

Permalink
Linkify proto/rrg/action in the docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
panhania committed Nov 17, 2023
1 parent 9f83b36 commit 6aa5bf8
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions docs/creating-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ steps outlined in this guide for more details.

Each action should define its arguments and result as Protocol Buffer messages
in its own package using the `proto3` syntax. All `.proto` definitions live in
the `proto/rrg/action` subfolder. The file (and package) should be named as the
action it corresponds to and should contain at least two messages named `Args`
and `Result` and have an appropriate license header.
the [`proto/rrg/action`][1] subfolder. The file (and the package) should have
the same name as the action it corresponds to and should contain at least two
messages named `Args` and `Result` and have an appropriate license header.

For example, when implementing an action called `list_foo`, you should create
a `proto/rrg/action/list_foo.proto` file that looks like this:
Expand All @@ -34,7 +34,7 @@ a `proto/rrg/action/list_foo.proto` file that looks like this:
}
~~~

The path to the created file needs to be added to the [build script][1] of the
The path to the created file needs to be added to the [build script][2] of the
`rrg-proto` crate.

### Define a Cargo feature
Expand All @@ -43,7 +43,7 @@ Every action needs to be hidden behind a feature. This way actions that are
irrelevant for specific deployments can be completely compiled-out from the
agent executable making it smaller and potentially more secure.

Action features are defined in the [Cargo manifest][2] of the main `rrg` crate
Action features are defined in the [Cargo manifest][3] of the main `rrg` crate
and should use `action-` prefix. For example, a feature flag for the `list_foo`
action would be named `action-list_foo`. You can also add the feature to the
list of default features, if it makes sense for your action.
Expand Down Expand Up @@ -136,7 +136,7 @@ be hidden behind the feature declared earlier:
Finally, the action has to be registered so that requests can actually be routed
to invoke it.

First, you need to extend the [RRG protocol][3]. Add the new variant to the
First, you need to extend the [RRG protocol][4]. Add the new variant to the
`Action` enum that has the same name as the action. If you are contributing
upstream, pick and use the first available field number. If you are developing
an action that is internal to your deployment, use one of the field numbers from
Expand All @@ -153,9 +153,10 @@ branch with the corresponding feature to avoid issues when compiling with the
feature disabled.


[1]: https://github.com/google/rrg/blob/master/crates/rrg-proto/build.rs
[2]: https://github.com/google/rrg/blob/master/crates/rrg/Cargo.toml
[3]: https://github.com/google/rrg/blob/master/proto/rrg.proto
[1]: https://github.com/google/rrg/blob/master/proto/rrg/action
[2]: https://github.com/google/rrg/blob/master/crates/rrg-proto/build.rs
[3]: https://github.com/google/rrg/blob/master/crates/rrg/Cargo.toml
[4]: https://github.com/google/rrg/blob/master/proto/rrg.proto

[`rrg::action`]: https://github.com/google/rrg/blob/master/crates/rrg/src/action.rs
[`rrg::request`]: https://github.com/google/rrg/blob/master/crates/rrg/src/request.rs
Expand Down

0 comments on commit 6aa5bf8

Please sign in to comment.