Skip to content

Commit

Permalink
WEB-1761 - anchor link checking (#13840)
Browse files Browse the repository at this point in the history
* test

ignores

* anchors to pass htmltest

* run on schedule
  • Loading branch information
davidejones authored May 17, 2023
1 parent 9cf428e commit 0f1d4eb
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions .htmltest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ IgnoreDirs:
- api
- fr
- ja
- ko
- es
- security/default_rules
IgnoreURLs:
- "/?api/(v1|v2)/*"
- play.google.com
Expand Down
2 changes: 1 addition & 1 deletion layouts/shortcodes/integrations.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<div id="integration-popper" class="dropdown-menu" style="display:none;" data-ref="mobilecontrols">
<a data-ref="filter" data-filter="all" href="#all" class="dropdown-item sort-time">{{ i18n "all" }}</a>
{{ range $i, $e := (sort ($.Scratch.Get "filters") "value" "asc") }}
<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>
<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>
{{ end }}
</div>
</div>
Expand Down

0 comments on commit 0f1d4eb

Please sign in to comment.