Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ syn = { version = "2.0.106", features = ["full"] }
[workspace.lints.rust]
unsafe_code = "forbid"
missing_docs = "warn"
unreachable_pub = "warn"

[workspace.lints.clippy]
all = { level = "warn", priority = -1 }
Expand Down
4 changes: 2 additions & 2 deletions apps/piquelctl/tests/support/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::process::{Command, Output};

/// Builds a `piquelctl` command isolated from inherited connection,
/// profile, and login configuration.
pub fn command() -> Command {
pub(crate) fn command() -> Command {
let mut command = Command::new(env!("CARGO_BIN_EXE_piquelctl"));
for name in [
"PIQUELD_PROFILE",
Expand Down Expand Up @@ -36,7 +36,7 @@ pub fn command() -> Command {

/// The one error event of a `--json` failure, checking that every stderr
/// line is a JSON event and that stdout is empty.
pub fn json_error(output: &Output) -> Value {
pub(crate) fn json_error(output: &Output) -> Value {
assert!(!output.status.success());
assert_eq!(output.stdout, b"", "a failure writes nothing on stdout");
let events: Vec<Value> = String::from_utf8_lossy(&output.stderr)
Expand Down
2 changes: 1 addition & 1 deletion apps/piqueld-ui/src/browser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ struct DashboardContext {
}

/// Mounts the CSR application into the document body.
pub fn mount() {
pub(super) fn mount() {
mount_to_body(|| view! { <auth::Gate /> });
}

Expand Down
4 changes: 4 additions & 0 deletions apps/piqueld-ui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ pub mod timeline;
pub mod traffic;

#[cfg(target_arch = "wasm32")]
#[expect(
unreachable_pub,
reason = "Leptos's #[component] generates public builder methods on each component's props struct"
)]
mod browser;

/// Mounts the dashboard into the current document.
Expand Down
4 changes: 2 additions & 2 deletions apps/piqueld-ui/src/overview/fixtures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde_json::json;

/// An environment named `name`, `stopped` or running, with `status`, if one
/// was recorded.
pub fn environment(
pub(super) fn environment(
name: &str,
stopped: bool,
status: Option<(ApplicationState, Option<&str>)>,
Expand Down Expand Up @@ -37,7 +37,7 @@ pub fn environment(

/// Application `id` with `environments`, and one latest deployment per
/// `(operation ID, requested at)`.
pub fn application(
pub(super) fn application(
id: &str,
environments: Vec<EnvironmentRow>,
deployments: &[(&str, i64)],
Expand Down
4 changes: 2 additions & 2 deletions apps/piqueld/build/dashboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const PACKAGED: &str = "Cargo.toml.orig";
/// Workspace builds ignore [`SHIPPED`], so they never embed one that
/// `cargo xtask publish` is packaging or left behind. It isn't tracked: a
/// package never changes.
pub fn embed(manifest_dir: &Path) -> Result<(), Box<dyn Error>> {
pub(crate) fn embed(manifest_dir: &Path) -> Result<(), Box<dyn Error>> {
println!("cargo::rustc-check-cfg=cfg(embedded_dashboard)");
#[cfg(feature = "embedded-ui")]
let dist = Some(Dashboard::new(manifest_dir)?.build()?);
Expand All @@ -56,7 +56,7 @@ fn write_bundle_module(dist: &Path) -> Result<(), Box<dyn Error>> {
let mut module = String::from(
"// Generated by the piqueld build script; do not edit.\n\
/// Dashboard bundle compiled by the piqueld build script.\n\
pub static BUNDLE: &[(&str, &[u8])] = &[\n",
pub(crate) static BUNDLE: &[(&str, &[u8])] = &[\n",
);
for file in walk_files(dist)? {
let relative = file.strip_prefix(dist)?;
Expand Down
8 changes: 4 additions & 4 deletions apps/piqueld/examples/generate_openapi/settings_reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use serde_json::Value;
use std::{collections::BTreeMap, fmt::Write as _};

/// A settings reference page: where it goes, and its hand-written parts.
pub struct SettingsPage {
pub(crate) struct SettingsPage {
/// Where the page is written, relative to the repository root.
pub path: &'static str,
/// What the page is generated from, named in its do-not-edit comment.
Expand All @@ -31,7 +31,7 @@ pub struct SettingsPage {

impl SettingsPage {
/// Every setting of an application manifest.
pub const MANIFEST: Self = Self {
pub(crate) const MANIFEST: Self = Self {
path: "docs/user/reference/manifest-settings.md",
source: "the doc comments of the manifest types in `crates/piqueld-core/src/manifest`",
title: "Manifest settings",
Expand Down Expand Up @@ -63,7 +63,7 @@ start with a letter and end with a letter or digit."#,
};

/// Every setting of the daemon's configuration file.
pub const CONFIG: Self = Self {
pub(crate) const CONFIG: Self = Self {
path: "docs/user/reference/configuration-settings.md",
source: "the configuration types in `crates/piqueld-config`",
title: "Daemon configuration settings",
Expand Down Expand Up @@ -91,7 +91,7 @@ stands for each entry of an array of tables: `dns.providers[].kind` is the
/// # Errors
/// If the schema has a shape the page cannot show, or lacks a
/// description the page needs.
pub fn render(&self, schema: &Value) -> Result<String> {
pub(crate) fn render(&self, schema: &Value) -> Result<String> {
let document = Document::deserialize(schema)
.with_context(|| format!("read the JSON Schema of {}", self.path))?;
Renderer {
Expand Down
2 changes: 1 addition & 1 deletion apps/piqueld/src/api/http/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::path::Path;

/// One embedded dashboard file: its bundle name relative to `/dashboard/`,
/// plus its bytes.
pub type EmbeddedFile = (&'static str, &'static [u8]);
pub(super) type EmbeddedFile = (&'static str, &'static [u8]);

/// The complete set of dashboard files compiled into the daemon binary.
pub type EmbeddedBundle = [EmbeddedFile];
Expand Down
2 changes: 1 addition & 1 deletion apps/piqueld/src/telemetry/sockets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::os::unix::fs::DirBuilderExt as _;
use std::path::{Path, PathBuf};

/// The socket a receiver's collector listens on, inside its directory.
pub const SOCKET: &str = "otlp.sock";
pub(super) const SOCKET: &str = "otlp.sock";

/// Where every receiver's directory lives.
#[derive(Clone, Debug)]
Expand Down
18 changes: 9 additions & 9 deletions apps/piqueld/tests/support/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use piqueld_store::{Store, StoreError};
use std::sync::Arc;

/// An [`ApplicationService`] with shorthands for the daemon's own mutations.
pub struct TestApplications {
pub(crate) struct TestApplications {
service: ApplicationService,
store: Arc<Store>,
}
Expand All @@ -24,7 +24,7 @@ impl std::ops::Deref for TestApplications {
}

impl TestApplications {
pub fn new(
pub(crate) fn new(
store: Arc<Store>,
runtime: Arc<dyn RuntimeBoundary>,
sources: Arc<Sources>,
Expand All @@ -36,7 +36,7 @@ impl TestApplications {
}

// Controller scenarios explicitly save and deploy in one acceptance.
pub async fn apply(
pub(crate) async fn apply(
&self,
manifest: ValidatedTemplate,
expected_generation: Option<u64>,
Expand All @@ -48,7 +48,7 @@ impl TestApplications {
self.service.operation(&operation_id).await
}

pub async fn save(
pub(crate) async fn save(
&self,
manifest: ValidatedTemplate,
expected_generation: Option<u64>,
Expand Down Expand Up @@ -77,7 +77,7 @@ impl TestApplications {
Ok(saved)
}

pub async fn deploy(
pub(crate) async fn deploy(
&self,
id: &EnvironmentId,
expected_generation: Option<u64>,
Expand All @@ -87,7 +87,7 @@ impl TestApplications {
}

/// Deletes the application of environment `id`, its only environment.
pub async fn delete(
pub(crate) async fn delete(
&self,
id: &EnvironmentId,
expected_generation: Option<u64>,
Expand All @@ -105,7 +105,7 @@ impl TestApplications {
self.service.operation(&operation.operation_id).await
}

pub async fn reconcile(
pub(crate) async fn reconcile(
&self,
id: &EnvironmentId,
expected_generation: Option<u64>,
Expand All @@ -115,12 +115,12 @@ impl TestApplications {
}

/// Stops environment `id`, returning its latest operation.
pub async fn stop(&self, id: &EnvironmentId) -> Result<Operation, ApplicationError> {
pub(crate) async fn stop(&self, id: &EnvironmentId) -> Result<Operation, ApplicationError> {
self.submit(Mutation::Stop { id: id.clone() }, None).await
}

/// Accepts `mutation` and returns the operation it requested.
pub async fn submit(
pub(crate) async fn submit(
&self,
mutation: Mutation,
expected_generation: Option<u64>,
Expand Down
2 changes: 1 addition & 1 deletion apps/piqueld/tests/support/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/// Starts `piqueld` with the configuration at `config`, expects it to exit
/// unsuccessfully, and returns what it wrote to standard error.
pub fn refused_start(config: &std::path::Path) -> String {
pub(crate) fn refused_start(config: &std::path::Path) -> String {
let output = std::process::Command::new(env!("CARGO_BIN_EXE_piqueld"))
.arg("--config")
.arg(config)
Expand Down
Loading
Loading