From 0f1d4eb7fb66de601594b2628ebe2431f97e2dfe Mon Sep 17 00:00:00 2001 From: David Jones Date: Wed, 17 May 2023 14:09:32 +0100 Subject: [PATCH] WEB-1761 - anchor link checking (#13840) * test ignores * anchors to pass htmltest * run on schedule --- .gitlab-ci.yml | 30 ++++++++++++++++++++++++++++ .htmltest.yml | 3 +++ layouts/shortcodes/integrations.html | 2 +- 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8084aa6b624c4..7bbd2bad69768 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -367,6 +367,36 @@ manage_ignored_translations:on-schedule: - echo "Downloading ignored translation source files..." - manage_ignored_translation_files +# This checks anchor links, +# its too noisy to run all the time but we want some insight so its running on schedule +link_checks:on-schedule: + <<: *base_template + <<: *live_rules + stage: post-deploy + cache: {} + environment: "live" + variables: + URL: ${LIVE_DOMAIN} + GIT_STRATEGY: none + dependencies: + - build_live + script: + - dog --config "$HOME/.dogrc" event post "documentation htmltest ${CI_COMMIT_REF_NAME} started" "${CI_PROJECT_URL}/pipelines/${CI_PIPELINE_ID}" --alert_type "info" --tags="${DEFAULT_TAGS}" + - find ./public -name "*.html" -exec sed -i -e "s#https://docs.datadoghq.com/#/#g" {} + + - find ./public -name "*.html" -exec sed -i -e "s#/api/v1/#/api/latest/#g" {} + + - find ./public -name "*.html" -exec sed -i -e "s#/api/v2/#/api/latest/#g" {} + + - "sed -i'' -e 's/CheckInternalHash: false/CheckInternalHash: true/' .htmltest.yml" + - htmltest + after_script: + - "[ -f /usr/local/bin/helpers.sh ] && source /usr/local/bin/helpers.sh" # source helpers + - RESULT="⛈ htmltest result; the following issues were found:\n$(tail -n +2 ./tmp/.htmltest/htmltest.log)\n--------------------" # output all but first line + - if grep -q "not exist" tmp/.htmltest/htmltest.log; then notify_slack "${RESULT}" "#31b834"; fi + artifacts: + paths: + - ./tmp/.htmltest + interruptible: true + allow_failure: true + test_missing_tms_live: <<: *base_template <<: *live_rules diff --git a/.htmltest.yml b/.htmltest.yml index 972fd20eaff4e..b965150f226df 100644 --- a/.htmltest.yml +++ b/.htmltest.yml @@ -26,6 +26,9 @@ IgnoreDirs: - api - fr - ja + - ko + - es + - security/default_rules IgnoreURLs: - "/?api/(v1|v2)/*" - play.google.com diff --git a/layouts/shortcodes/integrations.html b/layouts/shortcodes/integrations.html index 5e55d122a4a1a..b952d4fe02ff0 100644 --- a/layouts/shortcodes/integrations.html +++ b/layouts/shortcodes/integrations.html @@ -69,7 +69,7 @@