diff --git a/CHANGELOG.md b/CHANGELOG.md index 7215e0e0a..140188fa9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file. rego policies in weaver. ([#1038](https://github.com/open-telemetry/weaver/pull/1038) by @jsuereth) - Add Log support for emit and live-check ([#1042](https://github.com/open-telemetry/weaver/pull/1042) by @jerbly) - Add OTLP log emission for policy findings in live-check. Whenever a PolicyFinding is created, a log_record is emitted to your configured OTLP endpoint. ([#1045](https://github.com/open-telemetry/weaver/pull/1045) by @jerbly) +- Deprecate `weaver registry search` command. This command is not compatible with V2 schema and will be removed in a future version. Users should search the generated documentation instead. ([#1057](https://github.com/open-telemetry/weaver/pull/1057) by @jerbly) # [0.19.0] - 2025-11-04 diff --git a/docs/docker-guide.md b/docs/docker-guide.md index 68a8224bb..dc03a10f6 100644 --- a/docs/docker-guide.md +++ b/docs/docker-guide.md @@ -35,6 +35,8 @@ This has four key components: Weaver comes with an interactive component which can be leveraged with docker. Simply run the container with an interactive terminal attached: +> **DEPRECATED**: The `registry search` command is deprecated and will be removed in a future version. It is not compatible with V2 schema. + ```sh docker run -it \ otel/weaver:latest \ diff --git a/docs/usage.md b/docs/usage.md index ba29354fc..0ba49845c 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -257,9 +257,9 @@ Options: ### registry search -```text -Searches a registry (Note: Experimental and subject to change) +> **DEPRECATED**: This command is deprecated and will be removed in a future version. It is not compatible with V2 schema. Please search the generated documentation instead. +```text Usage: weaver registry search [OPTIONS] [SEARCH_STRING] Arguments: diff --git a/src/registry/mod.rs b/src/registry/mod.rs index d26fa7030..33b751cc4 100644 --- a/src/registry/mod.rs +++ b/src/registry/mod.rs @@ -103,7 +103,8 @@ pub enum RegistrySubCommand { /// The process exits with a code of 0 if the resolution is successful. #[clap(verbatim_doc_comment)] Resolve(RegistryResolveArgs), - /// Searches a registry (Note: Experimental and subject to change). + /// DEPRECATED - Searches a registry. This command is deprecated and will be removed in a future version. + /// It is not compatible with V2 schema. Please search the generated documentation instead. Search(RegistrySearchArgs), /// Calculate a set of general statistics on a semantic convention registry. Stats(RegistryStatsArgs), diff --git a/src/registry/search.rs b/src/registry/search.rs index cd8481f91..06f4f4943 100644 --- a/src/registry/search.rs +++ b/src/registry/search.rs @@ -55,6 +55,8 @@ pub struct RegistrySearchArgs { enum Error { #[error("{0}")] StdIoError(String), + #[error("The search command is deprecated and not compatible with V2 schema. Please search the generated documentation instead.")] + V2SchemaIncompatible, } impl From for Error { @@ -85,7 +87,7 @@ impl<'a> SearchApp<'a> { Block::default() .borders(Borders::TOP) .border_style(Style::default().fg(Color::Gray)) - .title("Search (press `Esc` or `Ctrl-Q` to stop running) ") + .title("Search [DEPRECATED] (press `Esc` or `Ctrl-Q` to stop running) ") .title_style(Style::default().fg(Color::Green)), ); SearchApp { @@ -100,19 +102,29 @@ impl<'a> SearchApp<'a> { let title_block = Block::default() .borders(Borders::TOP) .style(Style::default().bg(Color::Black)) - .border_style(Style::default().fg(Color::Gray)) + .border_style(Style::default().fg(Color::Yellow)) .title_alignment(ratatui::layout::Alignment::Center) - .title_style(Style::default().fg(Color::Green)) - .title("Weaver Search"); + .title_style( + Style::default() + .fg(Color::Yellow) + .add_modifier(Modifier::BOLD), + ) + .title("Weaver Search [DEPRECATED]"); let group_count: usize = self.schema.registry.stats().group_count; - let title_contents = Line::from(vec![Span::styled( - format!( - "Loaded {0:?} groups w/ {1} attributes", - group_count, - self.schema.catalog.count_attributes() - ), - Style::default().fg(Color::Gray), - )]); + let title_contents = vec![ + Line::from(vec![Span::styled( + "⚠ DEPRECATED: This command will be removed. Search generated documentation instead.", + Style::default().fg(Color::Yellow).add_modifier(Modifier::BOLD), + )]), + Line::from(vec![Span::styled( + format!( + "Loaded {0:?} groups w/ {1} attributes", + group_count, + self.schema.catalog.count_attributes() + ), + Style::default().fg(Color::Gray), + )]), + ]; Paragraph::new(title_contents).block(title_block) } @@ -364,6 +376,11 @@ fn run_command_line_search(schema: &ResolvedTelemetrySchema, pattern: &str) { pub(crate) fn command(args: &RegistrySearchArgs) -> Result { info!("Resolving registry `{}`", args.registry.registry); + // Check for V2 schema incompatibility + if args.registry.v2 { + return Err(DiagnosticMessages::from_error(Error::V2SchemaIncompatible)); + } + let mut diag_msgs = DiagnosticMessages::empty(); let policy_config = PolicyArgs { policies: vec![], @@ -374,6 +391,11 @@ pub(crate) fn command(args: &RegistrySearchArgs) -> Result