Skip to content
Merged
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
10 changes: 0 additions & 10 deletions src/v/config/BUILD
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
load("//bazel:build.bzl", "redpanda_cc_library")

redpanda_cc_library(
name = "startup_config",
hdrs = ["startup_config.h"],
visibility = ["//visibility:public"],
deps = [
"//src/v/base",
"@seastar",
],
)

redpanda_cc_library(
name = "config",
srcs = [
Expand Down
8 changes: 4 additions & 4 deletions src/v/config/configuration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3825,11 +3825,11 @@ configuration::configuration()
*this,
"schema_registry_enable_qualified_subjects",
"Enable parsing of qualified subject syntax (:.context:subject). "
"When true, qualified syntax is parsed to extract context and subject. "
"When false, subjects are treated literally, as subjects in the default "
"context. When true, qualified syntax is parsed to extract context and "
"subject.",
{.needs_restart = needs_restart::yes, .visibility = visibility::tunable},
false)
"context.",
{.needs_restart = needs_restart::yes, .visibility = visibility::user},
true)
, pp_sr_smp_max_non_local_requests(
*this,
"pp_sr_smp_max_non_local_requests",
Expand Down
79 changes: 0 additions & 79 deletions src/v/config/startup_config.h

This file was deleted.

14 changes: 0 additions & 14 deletions src/v/config/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -251,17 +251,3 @@ redpanda_cc_gtest(
"@googletest//:gtest",
],
)

redpanda_cc_gtest(
name = "startup_config_test",
timeout = "short",
srcs = [
"startup_config_test.cc",
],
cpu = 1,
deps = [
"//src/v/config:startup_config",
"//src/v/test_utils:gtest",
"@googletest//:gtest",
],
)
67 changes: 0 additions & 67 deletions src/v/config/tests/startup_config_test.cc

This file was deleted.

5 changes: 1 addition & 4 deletions src/v/pandaproxy/schema_registry/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ redpanda_cc_library(
],
implementation_deps = [
"//src/v/bytes:iobuf_parser",
"//src/v/config",
"//src/v/container:chunked_vector",
"//src/v/model",
"//src/v/pandaproxy:error",
Expand All @@ -56,7 +57,6 @@ redpanda_cc_library(
visibility = ["//visibility:public"],
deps = [
"//src/v/base",
"//src/v/config:startup_config",
"//src/v/json",
"//src/v/kafka/protocol",
"//src/v/utils:named_type",
Expand Down Expand Up @@ -193,7 +193,6 @@ redpanda_cc_library(
"//src/v/base",
"//src/v/bytes:iobuf_parser",
"//src/v/config",
"//src/v/config:startup_config",
"//src/v/container:chunked_vector",
"//src/v/json",
"//src/v/metrics",
Expand Down Expand Up @@ -314,7 +313,6 @@ redpanda_cc_library(
"//src/v/cluster:fwd",
"//src/v/cluster:plugin_table",
"//src/v/cluster:rpc_utils",
"//src/v/config:startup_config",
"//src/v/utils:variant",
],
)
Expand Down Expand Up @@ -345,7 +343,6 @@ redpanda_cc_library(
deps = [
":server",
":transport",
"//src/v/config:startup_config",
"//src/v/pandaproxy:core",
],
)
Expand Down
7 changes: 1 addition & 6 deletions src/v/pandaproxy/schema_registry/api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,10 @@ api::api(
api::~api() noexcept = default;

ss::future<> api::start() {
co_await enable_qualified_subjects::initialize(
config::shard_local_cfg().schema_registry_enable_qualified_subjects());
vlog(
srlog.info,
"Qualified subject parsing enabled: {}",
enable_qualified_subjects::get());
config::shard_local_cfg().schema_registry_enable_qualified_subjects());

_store = std::make_unique<sharded_store>();
co_await _store->start(is_mutable(_cfg.mode_mutability), _sg);
Expand Down Expand Up @@ -151,9 +149,6 @@ ss::future<> api::stop() {
if (_store) {
co_await _store->stop();
}
if (enable_qualified_subjects::is_initialized()) {
co_await enable_qualified_subjects::reset();
}
vlog(srlog.debug, "Stopped schema registry API...");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ using parse_result
= pps::post_subject_versions_request_handler<>::rjson_parse_result;

SEASTAR_THREAD_TEST_CASE(test_post_subject_versions_parser) {
pps::enable_qualified_subjects::set_local(true);
auto reset_flag = ss::defer(
[] { pps::enable_qualified_subjects::reset_local(); });
const ss::sstring escaped_schema_def{
R"({\"type\":\"record\",\"name\":\"test\",\"fields\":[{\"type\":\"string\",\"name\":\"field1\"},{\"type\":\"com.acme.Referenced\",\"name\":\"int\"}]})"};
const pps::schema_definition expected_schema_def{
Expand Down Expand Up @@ -81,10 +78,6 @@ SEASTAR_THREAD_TEST_CASE(test_post_subject_versions_parser) {
}

BOOST_AUTO_TEST_CASE(test_post_subject_versions_serde_metadata) {
pps::enable_qualified_subjects::set_local(true);
auto reset_flag = ss::defer(
[] { pps::enable_qualified_subjects::reset_local(); });

const auto sub = pps::context_subject::unqualified("test_subject");
{
constexpr std::string_view no_metadata{
Expand Down
1 change: 1 addition & 0 deletions src/v/pandaproxy/schema_registry/test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ redpanda_cc_gtest(
"context_subject.cc",
],
deps = [
"//src/v/config",
"//src/v/pandaproxy/schema_registry:types",
"//src/v/test_utils:gtest",
"@googletest//:gtest",
Expand Down
12 changes: 0 additions & 12 deletions src/v/pandaproxy/schema_registry/test/consume_to_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@ inline model::record_batch make_delete_subject_permanently_batch(
}

SEASTAR_THREAD_TEST_CASE(test_consume_to_store) {
pps::enable_qualified_subjects::set_local(true);
auto reset_flag = ss::defer(
[] { pps::enable_qualified_subjects::reset_local(); });

pps::sharded_store s;
s.start(pps::is_mutable::yes, ss::default_smp_service_group()).get();
auto stop_store = ss::defer([&s]() { s.stop().get(); });
Expand Down Expand Up @@ -206,10 +202,6 @@ model::record_batch as_record_batch(Key key) {
}

SEASTAR_THREAD_TEST_CASE(test_consume_to_store_after_compaction) {
pps::enable_qualified_subjects::set_local(true);
auto reset_flag = ss::defer(
[] { pps::enable_qualified_subjects::reset_local(); });

pps::sharded_store s;
s.start(pps::is_mutable::no, ss::default_smp_service_group()).get();
auto stop_store = ss::defer([&s]() { s.stop().get(); });
Expand Down Expand Up @@ -260,10 +252,6 @@ SEASTAR_THREAD_TEST_CASE(test_consume_to_store_after_compaction) {
}

SEASTAR_THREAD_TEST_CASE(test_writes_disabled) {
pps::enable_qualified_subjects::set_local(true);
auto reset_flag = ss::defer(
[] { pps::enable_qualified_subjects::reset_local(); });

pps::sharded_store s;
s.start(pps::is_mutable::no, ss::default_smp_service_group()).get();
auto stop_store = ss::defer([&s]() { s.stop().get(); });
Expand Down
21 changes: 10 additions & 11 deletions src/v/pandaproxy/schema_registry/test/context_subject.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0

#include "config/configuration.h"
#include "pandaproxy/schema_registry/error.h"
#include "pandaproxy/schema_registry/exceptions.h"
#include "pandaproxy/schema_registry/types.h"
Expand All @@ -17,8 +18,10 @@ namespace pandaproxy::schema_registry {

class ContextSubjectTest : public ::testing::Test {
protected:
void SetUp() override { enable_qualified_subjects::set_local(true); }
void TearDown() override { enable_qualified_subjects::reset_local(); }
void TearDown() override {
config::shard_local_cfg()
.schema_registry_enable_qualified_subjects.reset();
}
};

TEST_F(ContextSubjectTest, FromString) {
Expand Down Expand Up @@ -77,8 +80,8 @@ TEST_F(ContextSubjectTest, ToStringAndRoundTrip) {
}

TEST_F(ContextSubjectTest, FlagOffTreatsQualifiedAsLiteral) {
enable_qualified_subjects::reset_local();
enable_qualified_subjects::set_local(false);
config::shard_local_cfg()
.schema_registry_enable_qualified_subjects.set_value(false);

auto ctx_sub = context_subject::from_string(":.myctx:my-topic");

Expand All @@ -103,8 +106,8 @@ TEST_F(ContextSubjectTest, FlagOnUnqualifiedUsesDefaultContext) {
}

TEST_F(ContextSubjectTest, FlagOffUnqualifiedUsesDefaultContext) {
enable_qualified_subjects::reset_local();
enable_qualified_subjects::set_local(false);
config::shard_local_cfg()
.schema_registry_enable_qualified_subjects.set_value(false);

auto ctx_sub = context_subject::from_string("plain-topic");

Expand Down Expand Up @@ -208,11 +211,7 @@ TEST_F(ContextSubjectTest, ValidateSubjectConfigModeFlag) {
exception);
}

class ContextSubjectReferenceTest : public ::testing::Test {
protected:
void SetUp() override { enable_qualified_subjects::set_local(true); }
void TearDown() override { enable_qualified_subjects::reset_local(); }
};
class ContextSubjectReferenceTest : public ::testing::Test {};

TEST_F(ContextSubjectReferenceTest, FromString) {
// Unqualified subjects: qualified=false
Expand Down
6 changes: 1 addition & 5 deletions src/v/pandaproxy/schema_registry/test/storage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,7 @@ const auto expected_context_value = context_value{

} // namespace

class StorageTest : public ::testing::Test {
protected:
void SetUp() override { enable_qualified_subjects::set_local(true); }
void TearDown() override { enable_qualified_subjects::reset_local(); }
};
class StorageTest : public ::testing::Test {};

TEST_F(StorageTest, Serde) {
{
Expand Down
Loading
Loading