diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f7bc4023cec8..32b72157f3f3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -74,8 +74,8 @@ maximize the chances of your PR being merged. field to describe HTTP/2 window settings is valid if a more comprehensive HTTP/2 protocol options field is being introduced to replace it. The PR author deprecating the old configuration is responsible for updating all tests and - canonical configuration, or guarding them with ifndef DISABLE_DEPRECATED_FEATURES. - This will be validated by the bazel.debug target, which will hard-fail when + canonical configuration, or guarding them with ifndef ENVOY_DISABLE_DEPRECATED_FEATURES. + This will be validated by the bazel.asan target, which will hard-fail when deprecated configuration is used. * For configuration deprecations that are not covered by the above semantic replacement policy, any deprecation will only take place after diff --git a/bazel/envoy_internal.bzl b/bazel/envoy_internal.bzl index 94e2ce7f4fc3..2562390311de 100644 --- a/bazel/envoy_internal.bzl +++ b/bazel/envoy_internal.bzl @@ -57,7 +57,7 @@ def envoy_copts(repository, test = False): repository + "//bazel:disable_object_dump_on_signal_trace": [], "//conditions:default": ["-DENVOY_OBJECT_TRACE_ON_DUMP"], }) + select({ - repository + "//bazel:disable_deprecated_features": ["-DDISABLE_DEPRECATED_FEATURES"], + repository + "//bazel:disable_deprecated_features": ["-DENVOY_DISABLE_DEPRECATED_FEATURES"], "//conditions:default": [], }) + select({ repository + "//bazel:enable_log_debug_assert_in_release": ["-DENVOY_LOG_DEBUG_ASSERT_IN_RELEASE"], diff --git a/ci/do_ci.sh b/ci/do_ci.sh index e8440e0bcc81..1f28459a0570 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -133,7 +133,7 @@ elif [[ "$CI_TARGET" == "bazel.debug" ]]; then echo "bazel debug build with tests..." bazel_binary_build debug echo "Testing ${TEST_TARGETS}" - bazel test ${BAZEL_BUILD_OPTIONS} --define deprecated_features=disabled -c dbg ${TEST_TARGETS} + bazel test ${BAZEL_BUILD_OPTIONS} -c dbg ${TEST_TARGETS} exit 0 elif [[ "$CI_TARGET" == "bazel.debug.server_only" ]]; then setup_clang_toolchain @@ -144,10 +144,10 @@ elif [[ "$CI_TARGET" == "bazel.asan" ]]; then setup_clang_toolchain echo "bazel ASAN/UBSAN debug build with tests" echo "Building and testing envoy tests ${TEST_TARGETS}" - bazel_with_collection test ${BAZEL_BUILD_OPTIONS} -c dbg --config=clang-asan ${TEST_TARGETS} + bazel_with_collection test ${BAZEL_BUILD_OPTIONS} -c dbg --define deprecated_features=disabled --config=clang-asan ${TEST_TARGETS} echo "Building and testing envoy-filter-example tests..." pushd "${ENVOY_FILTER_EXAMPLE_SRCDIR}" - bazel_with_collection test ${BAZEL_BUILD_OPTIONS} -c dbg --config=clang-asan \ + bazel_with_collection test ${BAZEL_BUILD_OPTIONS} -c dbg --define deprecated_features=disabled --config=clang-asan \ //:echo2_integration_test //:envoy_binary_test popd # Also validate that integration test traffic tapping (useful when debugging etc.) diff --git a/source/common/runtime/runtime_impl.cc b/source/common/runtime/runtime_impl.cc index 0d4569c133c8..4162141f5920 100644 --- a/source/common/runtime/runtime_impl.cc +++ b/source/common/runtime/runtime_impl.cc @@ -186,7 +186,7 @@ bool SnapshotImpl::deprecatedFeatureEnabled(const std::string& key) const { // The feature is allowed. It is assumed this check is called when the feature // is about to be used, so increment the feature use stat. stats_.deprecated_feature_use_.inc(); -#ifdef DISABLE_DEPRECATED_FEATURES +#ifdef ENVOY_DISABLE_DEPRECATED_FEATURES return false; #endif diff --git a/test/common/protobuf/utility_test.cc b/test/common/protobuf/utility_test.cc index 61f879a5eb6c..13bb4fb38aa2 100644 --- a/test/common/protobuf/utility_test.cc +++ b/test/common/protobuf/utility_test.cc @@ -492,7 +492,7 @@ TEST_F(DeprecatedFieldsTest, NoErrorWhenDeprecatedFieldsUnused) { EXPECT_EQ(0, runtime_deprecated_feature_use_.value()); } -#ifndef DISABLE_DEPRECATED_FEATURES +#ifndef ENVOY_DISABLE_DEPRECATED_FEATURES TEST_F(DeprecatedFieldsTest, IndividualFieldDeprecated) { envoy::test::deprecation_test::Base base; base.set_is_deprecated("foo"); diff --git a/test/common/runtime/runtime_impl_test.cc b/test/common/runtime/runtime_impl_test.cc index 2c4e3d8276d2..55d9bf662744 100644 --- a/test/common/runtime/runtime_impl_test.cc +++ b/test/common/runtime/runtime_impl_test.cc @@ -180,7 +180,7 @@ TEST_F(DiskLoaderImplTest, All) { EXPECT_EQ(false, snapshot->runtimeFeatureEnabled("envoy.reloadable_features.test_feature_false")); // Deprecation -#ifdef DISABLE_DEPRECATED_FEATURES +#ifdef ENVOY_DISABLE_DEPRECATED_FEATURES EXPECT_EQ(false, snapshot->deprecatedFeatureEnabled("random_string_should_be_enabled")); #else EXPECT_EQ(true, snapshot->deprecatedFeatureEnabled("random_string_should_be_enabled"));