Skip to content

Commit 888e0e2

Browse files
authoredMay 9, 2020
docs: fix links broken in previous doc cleanup. (envoyproxy#11115)
The links were broken in 8e8209f Fixes: envoyproxy#11078 Signed-off-by: Greg Greenway <ggreenway@apple.com>
1 parent 3337426 commit 888e0e2

File tree

11 files changed

+58
-21
lines changed

11 files changed

+58
-21
lines changed
 

‎DEPRECATED.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# DEPRECATED
22

3-
The [deprecated log](https://www.envoyproxy.io/docs/envoy/latest/intro/deprecated) can be found in the official Envoy developer documentation.
3+
The [deprecated log](https://www.envoyproxy.io/docs/envoy/latest/version_history/version_history)
4+
for each version can be found in the official Envoy developer documentation.

‎docs/root/intro/deprecated.rst

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Deprecated
2+
==========
3+
4+
The deprecations for each version have moved :ref:`here <version_history>`.
5+
6+
.. This page only exists because previous versions of Envoy link here.

‎docs/root/intro/intro.rst

+7
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,10 @@ Introduction
1010
arch_overview/arch_overview
1111
deployment_types/deployment_types
1212
getting_help
13+
14+
.. These pages are only here for redirects from log lines from shipping versions of Envoy, so hide them.
15+
.. toctree::
16+
:hidden:
17+
18+
version_history
19+
deprecated

‎docs/root/intro/version_history.rst

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Version History
2+
===============
3+
4+
The changes for each version have moved :ref:`here <version_history>`.
5+
6+
.. This page only exists because previous versions of Envoy link here.

‎docs/root/version_history/version_history.rst

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _version_history:
2+
13
Version history
24
---------------
35

‎source/common/common/BUILD

+5
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ envoy_cc_library(
7272
hdrs = ["compiler_requirements.h"],
7373
)
7474

75+
envoy_cc_library(
76+
name = "documentation_url_lib",
77+
hdrs = ["documentation_url.h"],
78+
)
79+
7580
envoy_cc_library(
7681
name = "empty_string",
7782
hdrs = ["empty_string.h"],
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace Envoy {
2+
3+
// TODO(ggreenway): replace 'latest' with the current version, pulled from the VERSION file at
4+
// the root of the repo.
5+
#define ENVOY_DOC_URL_ROOT "https://www.envoyproxy.io/docs/envoy/latest"
6+
7+
#define ENVOY_DOC_URL_VERSION_HISTORY ENVOY_DOC_URL_ROOT "/version_history/version_history"
8+
9+
#define ENVOY_DOC_URL_RUNTIME_OVERRIDE_DEPRECATED \
10+
ENVOY_DOC_URL_ROOT \
11+
"/configuration/operations/runtime#using-runtime-overrides-for-deprecated-features"
12+
13+
} // namespace Envoy

‎source/common/protobuf/BUILD

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ envoy_cc_library(
6464
"//include/envoy/protobuf:message_validator_interface",
6565
"//include/envoy/runtime:runtime_interface",
6666
"//source/common/common:assert_lib",
67+
"//source/common/common:documentation_url_lib",
6768
"//source/common/common:hash_lib",
6869
"//source/common/common:utility_lib",
6970
"//source/common/config:api_type_oracle_lib",

‎source/common/protobuf/utility.cc

+9-12
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "envoy/type/v3/percent.pb.h"
99

1010
#include "common/common/assert.h"
11+
#include "common/common/documentation_url.h"
1112
#include "common/common/fmt.h"
1213
#include "common/config/api_type_oracle.h"
1314
#include "common/config/version_converter.h"
@@ -198,11 +199,9 @@ void deprecatedFieldHelper(Runtime::Loader* runtime, bool proto_annotated_as_dep
198199
if (warn_only) {
199200
ENVOY_LOG_MISC(warn, "{}", with_overridden);
200201
} else {
201-
const char fatal_error[] =
202-
" If continued use of this field is absolutely necessary, see "
203-
"https://www.envoyproxy.io/docs/envoy/latest/configuration/operations/runtime"
204-
"#using-runtime-overrides-for-deprecated-features for how to apply a temporary and "
205-
"highly discouraged override.";
202+
const char fatal_error[] = " If continued use of this field is absolutely necessary, "
203+
"see " ENVOY_DOC_URL_RUNTIME_OVERRIDE_DEPRECATED " for how "
204+
"to apply a temporary and highly discouraged override.";
206205
throw ProtoValidationException(with_overridden + fatal_error, message);
207206
}
208207
}
@@ -408,8 +407,7 @@ void checkForDeprecatedNonRepeatedEnumValue(const Protobuf::Message& message,
408407
enum_value_descriptor->name(), " for enum '", field->full_name(), "' from file ",
409408
filename, ". This enum value will be removed from Envoy soon",
410409
(default_value ? " so a non-default value must now be explicitly set" : ""),
411-
". Please see https://www.envoyproxy.io/docs/envoy/latest/intro/deprecated "
412-
"for details.");
410+
". Please see " ENVOY_DOC_URL_VERSION_HISTORY " for details.");
413411
deprecatedFieldHelper(
414412
runtime, true /*deprecated*/,
415413
enum_value_descriptor->options().GetExtension(envoy::annotations::disallowed_by_default_enum),
@@ -440,11 +438,10 @@ class UnexpectedFieldProtoVisitor : public ProtobufMessage::ConstProtoVisitor {
440438

441439
// If this field is deprecated, warn or throw an error.
442440
if (field.options().deprecated()) {
443-
const std::string warning = absl::StrCat(
444-
"Using {}deprecated option '", field.full_name(), "' from file ", filename,
445-
". This configuration will be removed from "
446-
"Envoy soon. Please see https://www.envoyproxy.io/docs/envoy/latest/intro/deprecated "
447-
"for details.");
441+
const std::string warning =
442+
absl::StrCat("Using {}deprecated option '", field.full_name(), "' from file ", filename,
443+
". This configuration will be removed from "
444+
"Envoy soon. Please see " ENVOY_DOC_URL_VERSION_HISTORY " for details.");
448445

449446
deprecatedFieldHelper(runtime_, true /*deprecated*/,
450447
field.options().GetExtension(envoy::annotations::disallowed_by_default),

‎source/extensions/common/BUILD

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ envoy_cc_library(
1313
hdrs = ["utility.h"],
1414
deps = [
1515
"//include/envoy/runtime:runtime_interface",
16+
"//source/common/common:documentation_url_lib",
1617
"//source/common/common:minimal_logger_lib",
1718
],
1819
)

‎source/extensions/common/utility.h

+6-8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "envoy/common/exception.h"
66
#include "envoy/runtime/runtime.h"
77

8+
#include "common/common/documentation_url.h"
89
#include "common/common/logger.h"
910

1011
namespace Envoy {
@@ -103,21 +104,18 @@ class ExtensionNameUtil {
103104

104105
return fmt::format(
105106
"Using deprecated {}{}extension name '{}' for '{}'. This name will be removed from Envoy "
106-
"soon. Please see "
107-
"https://www.envoyproxy.io/docs/envoy/latest/intro/deprecated for details.",
108-
extension_type, spacing, deprecated_name, canonical_name);
107+
"soon. Please see {} for details.",
108+
extension_type, spacing, deprecated_name, canonical_name, ENVOY_DOC_URL_VERSION_HISTORY);
109109
}
110110

111111
static std::string fatalMessage(absl::string_view extension_type,
112112
absl::string_view deprecated_name,
113113
absl::string_view canonical_name) {
114114
std::string err = message(extension_type, deprecated_name, canonical_name);
115115

116-
const char fatal_error[] =
117-
" If continued use of this filter name is absolutely necessary, see "
118-
"https://www.envoyproxy.io/docs/envoy/latest/configuration/operations/runtime"
119-
"#using-runtime-overrides-for-deprecated-features for how to apply a temporary and "
120-
"highly discouraged override.";
116+
const char fatal_error[] = " If continued use of this filter name is absolutely necessary, "
117+
"see " ENVOY_DOC_URL_RUNTIME_OVERRIDE_DEPRECATED " for "
118+
"how to apply a temporary and highly discouraged override.";
121119

122120
return err + fatal_error;
123121
}

0 commit comments

Comments
 (0)
Please sign in to comment.