From 3f3f3f5353510e75f2aa269ba3e6f1692f9baeb8 Mon Sep 17 00:00:00 2001 From: Martin Taillefer Date: Tue, 26 Feb 2019 06:53:57 -0800 Subject: [PATCH] Add a new link check to prevent links to specific lines in GitHub files. (#3387) --- .../policy-and-telemetry/attribute-vocabulary/index.md | 2 +- .../policy-and-telemetry/attribute-vocabulary/index.md | 2 +- scripts/lint_site.sh | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/content/docs/reference/config/policy-and-telemetry/attribute-vocabulary/index.md b/content/docs/reference/config/policy-and-telemetry/attribute-vocabulary/index.md index d9661cba60..9a4527bf0b 100644 --- a/content/docs/reference/config/policy-and-telemetry/attribute-vocabulary/index.md +++ b/content/docs/reference/config/policy-and-telemetry/attribute-vocabulary/index.md @@ -92,7 +92,7 @@ deployments will have agents (Envoy or Mixer adapters) that produce these attrib | `request.auth.presenter` | string | The authorized presenter of the credential. This value should reflect the optional Authorized Presenter (`azp`) claim within a JWT or the OAuth2 client id. | 123456789012.my-svc.com | | `request.auth.claims` | map[string, string] | all raw string claims from the `origin` JWT | `iss`: `issuer@foo.com`, `sub`: `sub@foo.com`, `aud`: `aud1` | | `request.api_key` | string | The API key used for the request. | abcde12345 | -| `check.error_code` | int64 | The error [code](https://github.com/google/protobuf/blob/master/src/google/protobuf/stubs/status.h#L44) for Mixer Check call. | 5 | +| `check.error_code` | int64 | The error [code](https://github.com/google/protobuf/blob/master/src/google/protobuf/stubs/status.h) for Mixer Check call. | 5 | | `check.error_message` | string | The error message for Mixer Check call. | Could not find the resource | | `check.cache_hit` | boolean | Indicates whether Mixer check call hits local cache. | | | `quota.cache_hit` | boolean | Indicates whether Mixer quota call hits local cache. | | diff --git a/content_zh/docs/reference/config/policy-and-telemetry/attribute-vocabulary/index.md b/content_zh/docs/reference/config/policy-and-telemetry/attribute-vocabulary/index.md index ca52af743d..a37c3e4615 100644 --- a/content_zh/docs/reference/config/policy-and-telemetry/attribute-vocabulary/index.md +++ b/content_zh/docs/reference/config/policy-and-telemetry/attribute-vocabulary/index.md @@ -83,7 +83,7 @@ weight: 10 | `request.auth.presenter` | string | 授权证书的出示人。此值应反映 JWT 或 OAuth2 客户端 ID 中的可选授权演示者(`azp`)声明。 | 123456789012.my-svc.com | | `request.auth.claims` | map[string, string] | 原始 JWT 中所有的的字符串声明。 | `iss`: `issuer@foo.com`, `sub`: `sub@foo.com`, `aud`: `aud1` | | `request.api_key` | string | 用于请求的 API key 。 | abcde12345 | -| `check.error_code` | int64 | Mixer Check 调用的[错误码](https://github.com/google/protobuf/blob/master/src/google/protobuf/stubs/status.h#L44) 。 | 5 | +| `check.error_code` | int64 | Mixer Check 调用的[错误码](https://github.com/google/protobuf/blob/master/src/google/protobuf/stubs/status.h) 。 | 5 | | `check.error_message` | string | Mixer Check 调用的错误消息。 | Could not find the resource | | `check.cache_hit` | boolean | 标示 Mixer check 调用是否命中本地缓存。 | | | `quota.cache_hit` | boolean | 标示 Mixer 限额调用是否命中本地缓存。 | | diff --git a/scripts/lint_site.sh b/scripts/lint_site.sh index a6a33946ee..4c407bfc17 100755 --- a/scripts/lint_site.sh +++ b/scripts/lint_site.sh @@ -108,6 +108,14 @@ do echo "Ensure markdown content only uses {{< tip >}}, {{< warning >}}, {{< idea >}}, and {{< quote >}} instead of block quotes" FAILED=1 fi + + grep -e "\"https://github.*#L[0-9]*\"" $f + if [[ "$?" == "0" ]] + then + echo $f + echo "Ensure markdown doesn't use links to specific lines in GitHub files as those are too brittle" + FAILED=1 + fi done htmlproofer ./public --assume-extension --check-html --disable_external ${DISABLE_EXTERNAL} --check-external-hash --check-opengraph --timeframe 2d --storage-dir .htmlproofer --url-ignore "/localhost/,/github.com/istio/istio.io/edit/master/,/github.com/istio/istio/issues/new/choose/,/groups.google.com/forum/,/www.trulia.com/"