Skip to content

Commit 7713c60

Browse files
Merge branch 'main' into 3803-update-premium-service-pages
2 parents 00cc52a + 5cc854d commit 7713c60

File tree

27 files changed

+913
-400
lines changed

27 files changed

+913
-400
lines changed

.github/actions/redirection-verification/package-lock.json

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/scheduled-check-links.yaml

Lines changed: 49 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,37 @@ on:
77
inputs:
88
url:
99
description: 'Site to check for broken links'
10-
required: true
1110
type: string
12-
default: 'https://docs.platform.sh/'
11+
default: ''
1312

1413
jobs:
14+
determine-urls:
15+
name: determine which urls to use
16+
runs-on: ubuntu-latest
17+
outputs:
18+
urls: ${{ steps.determine-url.outputs.urls }}
19+
steps:
20+
- id: determine-url
21+
run: |
22+
# default URLs we want to check
23+
# todo: replace this with a vars.VAL ?
24+
urls="[\"https://docs.platform.sh\",\"https://docs.upsun.com\"]"
25+
if [ "workflow_dispatch" = "${{ github.event_name }}" ]; then
26+
# make sure there's no extra spaces in what we were given
27+
inputURL=$(echo "${{ inputs.url }}" | xargs)
28+
if [ -n "${inputURL}" ]; then
29+
urls="[\"${inputURL}\"]"
30+
fi
31+
fi
32+
echo "urls=${urls}" >> $GITHUB_OUTPUT
1533
check-links:
1634
name: Check links
1735
runs-on: ubuntu-latest
36+
strategy:
37+
matrix:
38+
url: ${{ fromJSON(needs.determine-urls.outputs.urls) }}
39+
needs:
40+
- determine-urls
1841
steps:
1942
- uses: actions/setup-python@v4
2043
with:
@@ -26,38 +49,29 @@ jobs:
2649
pip3 install linkchecker
2750
2851
- name: checkout xml to markdown
29-
uses: actions/checkout@v3
52+
uses: actions/checkout@v4
3053
with:
3154
repository: platformsh/linkchecker-xml2md
3255

56+
- name: checkout linkchecker config
57+
uses: actions/checkout@v4
58+
with:
59+
sparse-checkout: |
60+
linkcheckerrc
61+
sparse-checkout-cone-mode: false
62+
path: linkchecker
3363
- name: install-parser
3464
run: |
3565
pip3 install -r requirements.txt
3666
37-
- name: Set URL to scan
38-
id: set-url
39-
shell: bash
40-
run: |
41-
# If this is a workflow dispatch, then use what was entered.
42-
# If not, then use the repository variable SCAN_URL if it is set
43-
# if not, fall back to the hard-coded default
44-
scanURL="https://docs.platform.sh/"
45-
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
46-
scanURL="${{ inputs.url }}"
47-
elif [[ -n "${{ vars.SCAN_URL }}" ]]; then
48-
scanURL="${{ vars.SCAN_URL }}"
49-
fi
50-
51-
echo "scanURL=${scanURL}" >> "$GITHUB_ENV"
52-
5367
- name: Run linkchecker
5468
id: run-link-checker
5569
continue-on-error: true
5670
shell: bash
5771
run: |
58-
echo "::notice::Scanning ${{ inputs.url }} for broken links."
72+
echo "::notice::Scanning ${{ matrix.url }} for broken links."
5973
# if linkchecker exits with a non-zero then it means broken links were found.
60-
scan=$(linkchecker ${{ env.scanURL }} -F xml/utf_8/brokenlinks.xml --check-extern --user-agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" --ignore-url="^https://github.com/platformsh*" --ignore-url="console.platform.sh/projects/*" --ignore-url="support.blackfire.io/*" --ignore-url="cloud.orange-business.com/*" --ignore-url="developers.cloudflare.com/*" --ignore-url="discord.com/*" --ignore-url="pptr.dev/*" --ignore-url="mvnrepository.com/*" --ignore-url="https://dev.mysql.com/doc/refman/en/" --ignore-url="https://www.microsoft.com/en-us/trust-center/privacy/data-management")
74+
scan=$(linkchecker ${{ matrix.url }} -f ./linkchecker/linkcheckerrc -F xml/utf_8/brokenlinks.xml )
6175
result=$?
6276
if [[ $result -ne 0 ]]; then
6377
echo "::notice::Broken links detected."
@@ -74,14 +88,21 @@ jobs:
7488
run: |
7589
echo "::notice::No broken links were detected"
7690
91+
- name: get domain name
92+
if: ${{ steps.run-link-checker.outcome == 'failure' }}
93+
id: get-domain-name
94+
run: |
95+
domainName=$(basename ${{ matrix.url }})
96+
echo "domain=${domainName}" >> $GITHUB_OUTPUT
7797
- name: check message size
7898
id: check-msg-size
7999
if: ${{ steps.run-link-checker.outcome == 'failure' }}
80100
run: |
81101
artifact="false"
82102
sizeOfMessage=$(cat broken_links.md | wc -c)
103+
echo "::notice::Size of report: ${sizeOfMessage}"
83104
# the size of a comment in an issue is 65536
84-
if [ "${sizeOfMessage}" -gt 650000 ]; then
105+
if [ "${sizeOfMessage}" -gt 65000 ]; then
85106
# we'll need to store the broken_links.md file as an aritifact
86107
artifact="true"
87108
fi
@@ -93,26 +114,27 @@ jobs:
93114
if: ${{ steps.run-link-checker.outcome == 'failure' && env.artifact == 'true' }}
94115
uses: actions/upload-artifact@v4
95116
with:
96-
name: broken-links
117+
name: broken-links-${{ steps.get-domain-name.outputs.domain }}
97118
path: |
98-
${{ github.action_path }}/broken_links.md
119+
./broken_links.md
99120
100121
- name: Create issue
101122
id: create-issue
102123
if: ${{ steps.run-link-checker.outcome == 'failure' }}
103124
env:
104125
ARTIFACT: ${{ env.artifact }}
126+
DOMAIN: ${{ steps.get-domain-name.outputs.domain }}
105127
uses: actions/github-script@v6
106128
with:
107129
script: |
108-
const { ARTIFACT } = process.env
130+
const { ARTIFACT, DOMAIN } = process.env
109131
var fs = require('fs');
110132
//
111-
failMsg = ':bug: Broken links detected'
133+
failMsg = ':bug: Broken links detected on ' + DOMAIN
112134
113135
if ('true' == ARTIFACT) {
114136
address = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}#artifacts`
115-
var bodyMsg = `Visual Regression Testing failed. Please view the report artifact at ${address}`
137+
var bodyMsg = `Broken links found. Please view the report artifact at ${address}`
116138
} else {
117139
var bodyMsg = fs.readFileSync('broken_links.md','utf8');
118140
}

linkcheckerrc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[checking]
2+
threads=5
3+
useragent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
4+
maxrequestspersecond=5
5+
6+
[filtering]
7+
checkextern=1
8+
ignore=
9+
^https://github.com/platformsh*
10+
console.platform.sh/projects/*
11+
support.blackfire.io/*
12+
cloud.orange-business.com/*
13+
developers.cloudflare.com/*
14+
discord.com/*
15+
pptr.dev/*
16+
mvnrepository.com/*
17+
https://dev.mysql.com/doc/refman/en/
18+
https://www.microsoft.com/en-us/trust-center/privacy/data-management
19+
http://localhost:1337/*
20+
21+
[output]
22+
warnings=0
23+
ignoreerrors=
24+
^https://(www|new)\.drupal\.org/.*$ ^403 Forbidden
25+
^https://support\.platform\.sh/hc/en-us/.*$ ^403 Forbidden
26+
^https://www\.ipaddressguide\.com/.*$ ^403 Forbidden
27+
^https://www\.abuseipdb\.com/.*$ ^403 Forbidden
28+
^https://www\.cloudflare\.com/.*$ ^403 Forbidden
29+
^https://mkyong.com/java/java-how-to-send-email/$ ^403 Forbidden
30+
^https://www.baeldung.com/maven-wrapper$ ^403 Forbidden

search/poetry.lock

Lines changed: 46 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

search/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ license = "Attribution-ShareAlike 4.0 International"
77

88
[tool.poetry.dependencies]
99
python = "^3.10"
10-
cryptography = "^43.0.1"
10+
cryptography = "^44.0.1"
1111
Scrapy = "^2.11.2"
1212
meilisearch = "^0.24.0"
1313
platformshconfig = "^2.3.1"

shared/data/registry.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@
208208
"1.9"
209209
],
210210
"supported": [
211+
"1.18",
211212
"1.15",
212213
"1.14"
213214
],

0 commit comments

Comments
 (0)