Skip to content

Commit 0173a98

Browse files
authored
Merge pull request #890 from input-output-hk/djo/fix_doc_warnings_not_in_ci
Make doc ci reports & fails if there's an error
2 parents 9e5ab51 + 6cee784 commit 0173a98

File tree

12 files changed

+48
-18
lines changed

12 files changed

+48
-18
lines changed

.github/workflows/docs.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,32 @@ jobs:
2222
uses: ./.github/workflows/actions/toolchain-and-cache
2323
with:
2424
cache-version: ${{ secrets.CACHE_VERSION }}
25+
cargo-tools: clippy-sarif sarif-fmt
2526

2627
- name: Generate cargo doc
27-
run: cargo doc --no-deps -p mithril-stm -p mithril-common -p mithril-aggregator -p mithril-signer -p mithril-client
28+
run: |
29+
cargo doc --no-deps -p mithril-stm -p mithril-common -p mithril-aggregator \
30+
-p mithril-signer -p mithril-client --message-format=json \
31+
| clippy-sarif | tee rust-cargo-doc-results.sarif | sarif-fmt
32+
33+
# Update tool sarif metadata from "clippy" to "cargo-doc" (since it's set this way by clippy-sarif)
34+
contents=$(cat rust-cargo-doc-results.sarif \
35+
| jq '.runs[].tool.driver.name = "cargo-doc"' \
36+
| jq '.runs[].tool.driver.informationUri = "https://doc.rust-lang.org/cargo/commands/cargo-doc.html"' \
37+
)
38+
echo -E "${contents}" > rust-cargo-doc-results.sarif
39+
40+
# Make this step fail if any warning has been found
41+
if [[ $(cat rust-cargo-doc-results.sarif | jq '.runs[0].results') != "[]" ]]; then
42+
false
43+
fi
44+
45+
- name: Upload cargo-doc results to GitHub
46+
if: success() || failure()
47+
uses: github/codeql-action/upload-sarif@v2
48+
with:
49+
sarif_file: rust-cargo-doc-results.sarif
50+
wait-for-processing: true
2851

2952
- name: Publish Mithril-rust-doc
3053
uses: actions/upload-artifact@v3

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mithril-aggregator/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-aggregator"
3-
version = "0.3.8"
3+
version = "0.3.9"
44
description = "A Mithril Aggregator server"
55
authors = { workspace = true }
66
edition = { workspace = true }

mithril-aggregator/src/certifier_service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! ## Certifier Service
22
//!
33
//! This service is responsible of [OpenMessage] cycle of life. It creates open
4-
//! messages and turn them into [CertificateRecord]. To do so, it registers
4+
//! messages and turn them into [Certificate]. To do so, it registers
55
//! single signatures and deal with the multi_signer for aggregate signature
66
//! creation.
77
use std::sync::Arc;

mithril-aggregator/src/database/provider/open_message.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ impl OpenMessageRepository {
471471
Self { connection }
472472
}
473473

474-
/// Return the latest [OpenMessage] for the given Epoch and [SignedEntityType].
474+
/// Return the latest [OpenMessageRecord] for the given Epoch and [SignedEntityType].
475475
pub async fn get_open_message(
476476
&self,
477477
signed_entity_type: &SignedEntityType,
@@ -486,7 +486,7 @@ impl OpenMessageRepository {
486486
Ok(messages.next())
487487
}
488488

489-
/// Create a new [OpenMessage] in the database.
489+
/// Create a new [OpenMessageRecord] in the database.
490490
pub async fn create_open_message(
491491
&self,
492492
epoch: Epoch,
@@ -503,7 +503,7 @@ impl OpenMessageRepository {
503503
.ok_or_else(|| panic!("Inserting an open_message should not return nothing."))
504504
}
505505

506-
/// Updates an [OpenMessage] in the database.
506+
/// Updates an [OpenMessageRecord] in the database.
507507
pub async fn update_open_message(
508508
&self,
509509
open_message: &OpenMessageRecord,
@@ -518,7 +518,7 @@ impl OpenMessageRepository {
518518
.ok_or_else(|| panic!("Updating an open_message should not return nothing."))
519519
}
520520

521-
/// Remove all the [OpenMessage] for the given Epoch in the database.
521+
/// Remove all the [OpenMessageRecord] for the given Epoch in the database.
522522
/// It returns the number of messages removed.
523523
pub async fn clean_epoch(&self, epoch: Epoch) -> StdResult<usize> {
524524
let lock = self.connection.lock().await;

mithril-aggregator/src/dependency_injection/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ impl DependenciesBuilder {
864864
Ok(signer_recorder)
865865
}
866866

867-
/// [SignerRecorder]
867+
/// [SignerRecorder] service
868868
pub async fn get_signer_recorder(&mut self) -> Result<Arc<dyn SignerRecorder>> {
869869
if self.signer_recorder.is_none() {
870870
self.signer_recorder = Some(self.build_signer_recorder().await?);

mithril-aggregator/src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,14 @@ mod store;
3434
pub mod ticker_service;
3535
mod tools;
3636

37+
pub use crate::artifact_builder::{ArtifactBuilder, ArtifactBuilderService};
3738
pub use crate::configuration::{
3839
Configuration, DefaultConfiguration, ExecutionEnvironment, SnapshotUploaderType,
3940
};
4041
pub use crate::multi_signer::{MultiSigner, MultiSignerImpl, ProtocolError};
42+
pub use crate::signable_builder::{
43+
ImmutableSignableBuilder, MithrilStakeDistributionSignableBuilder, SignableBuilderService,
44+
};
4145
pub use crate::snapshot_stores::{LocalSnapshotStore, SnapshotStore};
4246
pub use command_args::MainOpts;
4347
pub use dependency::DependencyManager;
@@ -48,8 +52,8 @@ pub use runtime::{
4852
AggregatorConfig, AggregatorRunner, AggregatorRunnerTrait, AggregatorRuntime, RuntimeError,
4953
};
5054
pub use signer_registerer::{
51-
MithrilSignerRegisterer, SignerRegisterer, SignerRegistrationError, SignerRegistrationRound,
52-
SignerRegistrationRoundOpener,
55+
MithrilSignerRegisterer, SignerRecorder, SignerRegisterer, SignerRegistrationError,
56+
SignerRegistrationRound, SignerRegistrationRoundOpener,
5357
};
5458
pub use snapshot_uploaders::{
5559
DumbSnapshotUploader, LocalSnapshotUploader, RemoteSnapshotUploader, SnapshotUploader,

mithril-aggregator/src/signable_builder/immutable_signable_builder.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use mithril_common::{
88
StdResult,
99
};
1010

11+
/// A [SignableBuilder] for cardano immutable files.
1112
pub struct ImmutableSignableBuilder {
1213
immutable_digester: Arc<dyn ImmutableDigester>,
1314
}

mithril-aggregator/src/signable_builder/mithril_stake_distribution.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use mithril_common::{
1111

1212
use crate::MultiSigner;
1313

14-
/// A [MithrilStakeDistributionSignable] builder
14+
/// A [SignableBuilder] for mithril stake distribution.
1515
pub struct MithrilStakeDistributionSignableBuilder {
1616
multi_signer: Arc<RwLock<dyn MultiSigner>>,
1717
}

mithril-common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-common"
3-
version = "0.2.44"
3+
version = "0.2.45"
44
authors = { workspace = true }
55
edition = { workspace = true }
66
documentation = { workspace = true }

0 commit comments

Comments
 (0)