Skip to content

Commit 863659a

Browse files
committed
chore(vector-common): Move ExtraContext out of the binary crate
Moves the leaf module into vector-common. Call sites import it from vector_lib.
1 parent 8cc1daf commit 863659a

27 files changed

Lines changed: 44 additions & 34 deletions

File tree

‎lib/vector-common/src/lib.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ pub use event_data_eq::EventDataEq;
4646
#[cfg(any(test, feature = "test"))]
4747
pub mod event_test_util;
4848

49+
pub mod extra_context;
50+
4951
pub mod finalization;
5052
pub mod finalizer;
5153
pub use finalizer::EmptyStream;

‎lib/vector-lib/src/lib.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ pub use vector_buffers as buffers;
1111
pub use vector_common::event_test_util;
1212
pub use vector_common::{
1313
Error, NamedInternalEvent, Result, TimeZone, assert_event_data_eq, atomic, btreemap,
14-
byte_size_of, byte_size_of::ByteSizeOf, conversion, counter, encode_logfmt, finalization,
15-
finalizer, gauge, histogram, id, impl_event_data_eq, internal_event, json_size,
14+
byte_size_of, byte_size_of::ByteSizeOf, conversion, counter, encode_logfmt, extra_context,
15+
finalization, finalizer, gauge, histogram, id, impl_event_data_eq, internal_event, json_size,
1616
registered_event, request_metadata, sampling, sensitive_string, shutdown,
1717
spawn_in_current_span, stats, trigger,
1818
};

‎src/app.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use tokio::{
1818
sync::{MutexGuard, broadcast::error::RecvError},
1919
};
2020
use tokio_stream::wrappers::UnboundedReceiverStream;
21+
use vector_lib::extra_context::ExtraContext;
2122

2223
#[cfg(feature = "api")]
2324
use crate::api;
@@ -26,7 +27,6 @@ use crate::internal_events::ApiStarted;
2627
use crate::{
2728
cli::{LogFormat, Opts, RootOpts, WatchConfigMethod, handle_config_errors},
2829
config::{self, Component, ComponentConfig, ComponentKind, Config, ConfigPath},
29-
extra_context::ExtraContext,
3030
heartbeat,
3131
internal_events::{
3232
VectorConfigLoadError, VectorQuit, VectorStarted, VectorStopped, VectorStopping,

‎src/components/validation/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ fn run_validation(configuration: ValidationConfiguration, test_case_data_path: s
309309
let mut runner = Runner::from_configuration(
310310
configuration,
311311
test_case_data_path,
312-
crate::extra_context::ExtraContext::default(),
312+
vector_lib::extra_context::ExtraContext::default(),
313313
);
314314
runner.add_validator(StandardValidators::ComponentSpec);
315315

‎src/components/validation/runner/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use tokio::{
1818
use tokio_util::codec::Encoder as _;
1919
use vector_lib::{
2020
EstimatedJsonEncodedSizeOf, codecs::encoding, config::LogNamespace, event::Event,
21+
extra_context::ExtraContext,
2122
};
2223

2324
pub use self::config::TopologyBuilder;
@@ -30,7 +31,6 @@ use crate::{
3031
codecs::Encoder,
3132
components::validation::{RunnerMetrics, TestCase},
3233
config::ConfigBuilder,
33-
extra_context::ExtraContext,
3434
topology::RunningTopology,
3535
};
3636

‎src/config/sink.rs‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ use vector_vrl_metrics::MetricsStorage;
2121
use super::{
2222
ComponentKey, DynValidatedSink, ProxyConfig, Resource, dot_graph::GraphConfig, schema,
2323
};
24-
use crate::{
25-
extra_context::ExtraContext,
26-
sinks::{Healthcheck, util::UriSerde},
27-
};
24+
use vector_lib::extra_context::ExtraContext;
25+
26+
use crate::sinks::{Healthcheck, util::UriSerde};
2827

2928
pub type BoxedSink = Box<dyn SinkConfig>;
3029

‎src/config/source.rs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ use vector_lib::{
1818
use vector_vrl_metrics::MetricsStorage;
1919

2020
use super::{ComponentKey, ProxyConfig, Resource, dot_graph::GraphConfig, schema};
21-
use crate::{SourceSender, extra_context::ExtraContext, shutdown::ShutdownSignal};
21+
use vector_lib::extra_context::ExtraContext;
22+
23+
use crate::{SourceSender, shutdown::ShutdownSignal};
2224

2325
pub type BoxedSource = Box<dyn SourceConfig>;
2426

‎src/config/transform.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ use vector_lib::{
2222
};
2323
use vector_vrl_metrics::MetricsStorage;
2424

25+
use vector_lib::extra_context::ExtraContext;
26+
2527
use super::{ComponentKey, OutputId, dot_graph::GraphConfig, schema::Options as SchemaOptions};
26-
use crate::extra_context::ExtraContext;
2728

2829
pub type BoxedTransform = Box<dyn TransformConfig>;
2930

‎src/lib.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ mod convert_config;
7979
pub mod cpu_time;
8080
pub mod encoding_transcode;
8181
pub mod enrichment_tables;
82-
pub mod extra_context;
8382
#[cfg(feature = "gcp")]
8483
pub mod gcp;
8584
pub(crate) mod graph;

0 commit comments

Comments
 (0)