Skip to content

Commit 0f1d4eb

Browse files
authored
WEB-1761 - anchor link checking (#13840)
* test ignores * anchors to pass htmltest * run on schedule
1 parent 9cf428e commit 0f1d4eb

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

.gitlab-ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,36 @@ manage_ignored_translations:on-schedule:
367367
- echo "Downloading ignored translation source files..."
368368
- manage_ignored_translation_files
369369

370+
# This checks anchor links,
371+
# its too noisy to run all the time but we want some insight so its running on schedule
372+
link_checks:on-schedule:
373+
<<: *base_template
374+
<<: *live_rules
375+
stage: post-deploy
376+
cache: {}
377+
environment: "live"
378+
variables:
379+
URL: ${LIVE_DOMAIN}
380+
GIT_STRATEGY: none
381+
dependencies:
382+
- build_live
383+
script:
384+
- 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}"
385+
- find ./public -name "*.html" -exec sed -i -e "s#https://docs.datadoghq.com/#/#g" {} +
386+
- find ./public -name "*.html" -exec sed -i -e "s#/api/v1/#/api/latest/#g" {} +
387+
- find ./public -name "*.html" -exec sed -i -e "s#/api/v2/#/api/latest/#g" {} +
388+
- "sed -i'' -e 's/CheckInternalHash: false/CheckInternalHash: true/' .htmltest.yml"
389+
- htmltest
390+
after_script:
391+
- "[ -f /usr/local/bin/helpers.sh ] && source /usr/local/bin/helpers.sh" # source helpers
392+
- RESULT="⛈ htmltest result; the following issues were found:\n$(tail -n +2 ./tmp/.htmltest/htmltest.log)\n--------------------" # output all but first line
393+
- if grep -q "not exist" tmp/.htmltest/htmltest.log; then notify_slack "${RESULT}" "#31b834"; fi
394+
artifacts:
395+
paths:
396+
- ./tmp/.htmltest
397+
interruptible: true
398+
allow_failure: true
399+
370400
test_missing_tms_live:
371401
<<: *base_template
372402
<<: *live_rules

.htmltest.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ IgnoreDirs:
2626
- api
2727
- fr
2828
- ja
29+
- ko
30+
- es
31+
- security/default_rules
2932
IgnoreURLs:
3033
- "/?api/(v1|v2)/*"
3134
- play.google.com

layouts/shortcodes/integrations.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
<div id="integration-popper" class="dropdown-menu" style="display:none;" data-ref="mobilecontrols">
7070
<a data-ref="filter" data-filter="all" href="#all" class="dropdown-item sort-time">{{ i18n "all" }}</a>
7171
{{ range $i, $e := (sort ($.Scratch.Get "filters") "value" "asc") }}
72-
<a data-ref="filter" data-filter=".cat-{{ replace $e "/" "" | urlize }}" href="#cat-{{ replace $e "/" "" | urlize }}" class="dropdown-item sort-time sort-{{ replace $e "/" "" | urlize }}">{{ $e | upper }}</a>
72+
<a id="cat-{{ replace $e "/" "" | urlize }}" data-ref="filter" data-filter=".cat-{{ replace $e "/" "" | urlize }}" href="#cat-{{ replace $e "/" "" | urlize }}" class="dropdown-item sort-time sort-{{ replace $e "/" "" | urlize }}">{{ $e | upper }}</a>
7373
{{ end }}
7474
</div>
7575
</div>

0 commit comments

Comments
 (0)