Skip to content

Commit

Permalink
ci(docs): add docs job (#220)
Browse files Browse the repository at this point in the history
* ci(docs): add docs checking workflow

Signed-off-by: mikeee <hey@mike.ee>

* fix(ci): remove override toolchain

Signed-off-by: mikeee <hey@mike.ee>

* docs: fix warnings and regen protos

Signed-off-by: mikeee <hey@mike.ee>

---------

Signed-off-by: mikeee <hey@mike.ee>
  • Loading branch information
mikeee authored Aug 20, 2024
1 parent 60c0bbe commit ece8714
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 28 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ env:
CARGO_TERM_COLOR: always
CARGO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
PROTOC_VERSION: 24.4
RUSTUP_TOOLCHAIN: stable
RUSTFLAGS: "-D warnings"

jobs:
Expand Down Expand Up @@ -70,10 +69,32 @@ jobs:
- name: Run Tests
run: cargo test --workspace --all-targets --all-features

test-docs-sdk:
name: Docs SDK
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/install@cargo-docs-rs
- run: cargo docs-rs -p dapr

test-docs-macros:
name: Docs Macros
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/install@cargo-docs-rs
- run: cargo docs-rs -p dapr-macros

publish:
name: Publish
runs-on: ubuntu-latest
needs: [lint, build]
needs: [test-docs-sdk, test-docs-macros, lint, build]
if: startswith(github.ref, 'refs/tags/v')

steps:
Expand Down
12 changes: 6 additions & 6 deletions dapr/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ impl<T: DaprInterface> Client<T> {
self.0.unsubscribe_configuration(request).await
}

/// Encrypt binary data using Dapr. returns Vec<StreamPayload> to be used in decrypt method
/// Encrypt binary data using Dapr. returns `Vec<StreamPayload>` to be used in decrypt method
///
/// # Arguments
///
Expand Down Expand Up @@ -467,11 +467,11 @@ impl<T: DaprInterface> Client<T> {
self.0.encrypt(requested_items).await
}

/// Decrypt binary data using Dapr. returns Vec<u8>.
/// Decrypt binary data using Dapr. returns `Vec<u8>`.
///
/// # Arguments
///
/// * `encrypted` - Encrypted data usually returned from encrypted, Vec<StreamPayload>
/// * `encrypted` - Encrypted data usually returned from encrypted, `Vec<StreamPayload>`
/// * `options` - Decryption request options.
pub async fn decrypt(
&mut self,
Expand Down Expand Up @@ -721,7 +721,7 @@ impl DaprInterface for dapr_v1::dapr_client::DaprClient<TonicChannel> {
.into_inner())
}

/// Encrypt binary data using Dapr. returns Vec<StreamPayload> to be used in decrypt method
/// Encrypt binary data using Dapr. returns `Vec<StreamPayload>` to be used in decrypt method
///
/// # Arguments
///
Expand All @@ -745,11 +745,11 @@ impl DaprInterface for dapr_v1::dapr_client::DaprClient<TonicChannel> {
Ok(return_data)
}

/// Decrypt binary data using Dapr. returns Vec<u8>.
/// Decrypt binary data using Dapr. returns `Vec<u8>`.
///
/// # Arguments
///
/// * `encrypted` - Encrypted data usually returned from encrypted, Vec<StreamPayload>
/// * `encrypted` - Encrypted data usually returned from encrypted, `Vec<StreamPayload>`
/// * `options` - Decryption request options.
async fn decrypt(&mut self, request: Vec<DecryptRequest>) -> Result<Vec<u8>, Status> {
let request = Request::new(tokio_stream::iter(request));
Expand Down
2 changes: 1 addition & 1 deletion dapr/src/dapr/dapr.proto.common.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// when Dapr runtime delivers HTTP content.
///
/// For example, when callers calls http invoke api
/// POST <http://localhost:3500/v1.0/invoke/<app_id>/method/<method>?query1=value1&query2=value2>
/// `POST <http://localhost:3500/v1.0/invoke/<app_id>/method/<method>?query1=value1&query2=value2`>
///
/// Dapr runtime will parse POST as a verb and extract querystring to quersytring map.
#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down
16 changes: 8 additions & 8 deletions dapr/src/dapr/dapr.proto.runtime.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2983,14 +2983,14 @@ pub struct Job {
/// "0 15 3 * * *" - every day at 03:15
///
/// Period string expressions:
/// Entry | Description | Equivalent To
/// ----- | ----------- | -------------
/// @every <duration> | Run every <duration> (e.g. '@every 1h30m') | N/A
/// @yearly (or @annually) | Run once a year, midnight, Jan. 1st | 0 0 0 1 1 *
/// @monthly | Run once a month, midnight, first of month | 0 0 0 1 * *
/// @weekly | Run once a week, midnight on Sunday | 0 0 0 * * 0
/// @daily (or @midnight) | Run once a day, midnight | 0 0 0 * * *
/// @hourly | Run once an hour, beginning of hour | 0 0 * * * *
/// Entry | Description | Equivalent To
/// ----- | ----------- | -------------
/// @every `<duration>` | Run every `<duration>` (e.g. '@every 1h30m') | N/A
/// @yearly (or @annually) | Run once a year, midnight, Jan. 1st | 0 0 0 1 1 *
/// @monthly | Run once a month, midnight, first of month | 0 0 0 1 * *
/// @weekly | Run once a week, midnight on Sunday | 0 0 0 * * 0
/// @daily (or @midnight) | Run once a day, midnight | 0 0 0 * * *
/// @hourly | Run once an hour, beginning of hour | 0 0 * * * *
#[prost(string, optional, tag = "2")]
pub schedule: ::core::option::Option<::prost::alloc::string::String>,
/// repeats is the optional number of times in which the job should be
Expand Down
Binary file modified dapr/src/dapr/types.bin
Binary file not shown.
4 changes: 2 additions & 2 deletions proto/dapr/proto/common/v1/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ option go_package = "github.com/dapr/dapr/pkg/proto/common/v1;common";
// when Dapr runtime delivers HTTP content.
//
// For example, when callers calls http invoke api
// POST http://localhost:3500/v1.0/invoke/<app_id>/method/<method>?query1=value1&query2=value2
// `POST http://localhost:3500/v1.0/invoke/<app_id>/method/<method>?query1=value1&query2=value2`
//
// Dapr runtime will parse POST as a verb and extract querystring to quersytring map.
message HTTPExtension {
Expand Down Expand Up @@ -157,4 +157,4 @@ message ConfigurationItem {

// the metadata which will be passed to/from configuration store component.
map<string,string> metadata = 3;
}
}
18 changes: 9 additions & 9 deletions proto/dapr/proto/runtime/v1/dapr.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ message EncryptRequestOptions {
// If true, the encrypted document does not contain a key reference.
// In that case, calls to the Decrypt method must provide a key reference (name or name/version).
// Defaults to false.
bool omit_decryption_key_name = 11 [json_name = "omitDecryptionKeyName"];
bool omit_decryption_key_name = 11 [json_name="omitDecryptionKeyName"];
// Key reference to embed in the encrypted document (name or name/version).
// This is helpful if the reference of the key used to decrypt the document is different from the one used to encrypt it.
// If unset, uses the reference of the key used to encrypt the document (this is the default behavior).
Expand Down Expand Up @@ -1212,14 +1212,14 @@ message Job {
// "0 15 3 * * *" - every day at 03:15
//
// Period string expressions:
// Entry | Description | Equivalent To
// ----- | ----------- | -------------
// @every <duration> | Run every <duration> (e.g. '@every 1h30m') | N/A
// @yearly (or @annually) | Run once a year, midnight, Jan. 1st | 0 0 0 1 1 *
// @monthly | Run once a month, midnight, first of month | 0 0 0 1 * *
// @weekly | Run once a week, midnight on Sunday | 0 0 0 * * 0
// @daily (or @midnight) | Run once a day, midnight | 0 0 0 * * *
// @hourly | Run once an hour, beginning of hour | 0 0 * * * *
// Entry | Description | Equivalent To
// ----- | ----------- | -------------
// @every `<duration>` | Run every `<duration>` (e.g. '@every 1h30m') | N/A
// @yearly (or @annually) | Run once a year, midnight, Jan. 1st | 0 0 0 1 1 *
// @monthly | Run once a month, midnight, first of month | 0 0 0 1 * *
// @weekly | Run once a week, midnight on Sunday | 0 0 0 * * 0
// @daily (or @midnight) | Run once a day, midnight | 0 0 0 * * *
// @hourly | Run once an hour, beginning of hour | 0 0 * * * *
optional string schedule = 2 [json_name = "schedule"];

// repeats is the optional number of times in which the job should be
Expand Down

0 comments on commit ece8714

Please sign in to comment.