Skip to content

Commit 7ef08a3

Browse files
committed
Switch to htmltest link checker -- and fix issues
Made switch to [htmltest](https://github.com/wjdp/htmltest) because previous link checker didn't find lots of missing images, anchors that didn't exist, external URL checks, etc. These have all been fixed now. This checker is _brutally_ efficient at finding issues, although because it checks external URLs, it can not be the fastest. I've integrated the external URL cache into `make site-test`, which, when populated, runs the test in several seconds, which makes local testing nice.
1 parent 55522dd commit 7ef08a3

20 files changed

Lines changed: 76 additions & 35 deletions

File tree

‎build/build-image/Dockerfile‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
FROM gcr.io/agones-images/grpc-cxx:1.16.1
2020

2121
RUN apt-get update && \
22-
apt-get install -y wget psmisc rsync make python bash-completion zip nano jq graphviz linkchecker \
22+
apt-get install -y wget psmisc rsync make python bash-completion zip nano jq graphviz \
2323
gettext-base plantuml && \
2424
apt-get clean
2525

@@ -126,6 +126,13 @@ RUN mkdir /tmp/hugo && \
126126
RUN curl -sL https://deb.nodesource.com/setup_11.x | bash - && \
127127
apt-get install -y nodejs
128128

129+
# html checker
130+
RUN mkdir /tmp/htmltest && \
131+
wget -O /tmp/htmltest/htmltest.tar.gz https://github.com/wjdp/htmltest/releases/download/v0.10.1/htmltest_0.10.1_linux_amd64.tar.gz && \
132+
tar -zxvf /tmp/htmltest/htmltest.tar.gz -C /tmp/htmltest && \
133+
mv /tmp/htmltest/htmltest /usr/local/bin && \
134+
rm -r /tmp/htmltest
135+
129136
# make sure we keep the path to go
130137
RUN echo "export PATH=/usr/local/go/bin:/go/bin/:\$PATH" >> /root/.bashrc
131138
# make nano the editor

‎build/includes/website.mk‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
# generate the latest website
2828
site-server: ARGS ?=-F
29-
site-server: ENV ?= RELEASE_VERSION="$(base_version)"
29+
site-server: ENV ?= RELEASE_VERSION="$(base_version)" RELEASE_BRANCH=master
3030
site-server: ensure-build-image
3131
docker run --rm $(common_mounts) --workdir=$(mount_path)/site $(DOCKER_RUN_ARGS) -p 1313:1313 $(build_tag) bash -c \
3232
"$(ENV) hugo server --watch --baseURL=http://localhost:1313/ --bind=0.0.0.0 $(ARGS)"
@@ -52,17 +52,13 @@ site-deploy: site-gen-app-yaml site-static
5252
gcloud app deploy .app.yaml --no-promote --version=$(shell git rev-parse --short=7 HEAD)
5353

5454
site-static-preview:
55-
$(MAKE) site-static ARGS="-F" ENV=RELEASE_VERSION=$(base_version)
55+
$(MAKE) site-static ARGS="-F" ENV="RELEASE_VERSION=$(base_version) RELEASE_BRANCH=master"
5656

5757
site-deploy-preview: site-static-preview
5858
$(MAKE) site-deploy SERVICE=preview
5959

6060
site-test:
61-
docker run --rm --name=agones-website $(common_mounts) --workdir=$(mount_path)/site $(DOCKER_RUN_ARGS) $(build_tag) \
62-
hugo server --watch --baseURL="http://localhost:1313/site/" &
63-
until docker exec agones-website curl -o /dev/null --silent http://localhost:1313/site/; \
64-
do \
65-
echo "Waiting for server to start..."; \
66-
sleep 1; \
67-
done
68-
( trap 'docker stop agones-website' EXIT; docker exec agones-website linkchecker --anchors http://localhost:1313/site/ )
61+
# generate actual html and run test against - provides a more accurate tests
62+
$(MAKE) site-static-preview
63+
docker run --rm -t -e "TERM=xterm-256color" $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) bash -c \
64+
"mkdir -p /tmp/website && cp -r $(mount_path)/site/public /tmp/website/site && htmltest -c $(mount_path)/site/htmltest.yaml /tmp/website"

‎docs/governance/templates/release_issue.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and copy it into a release issue. Fill in relevent values, found inside {}
1919
- [ ] Create a *draft* release with the [release template][release-template]
2020
- [ ] Make a `tag` with the release version.
2121
- [ ] Site updated
22+
- [ ] Review all `link_test` and `data-proofer-ignore` attributes and remove for link testing
2223
- [ ] If full release, review and remove all instances of the `feature` shortcode
2324
- [ ] If full release, update to the new release branch {version}+0.1.
2425
- [ ] If full release, update site with the new release version (`release-version` in config.toml) to {version}+0.1

‎site/content/en/docs/Contribute/_index.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ with the Docsy theme for open source documentation.
2525

2626
- [Hugo Documentation](https://gohugo.io/documentation/)
2727
- [Docsy Guide](https://github.com/google/docsy)
28+
- [Link Checker](https://github.com/wjdp/htmltest)
2829

2930
## Documentation for upcoming features
3031

‎site/content/en/docs/Examples/_index.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ weight: 120
1515

1616
- {{< ghlink href="examples/simple-udp" >}}Simple UDP{{< /ghlink >}} (Go) - simple server and client that send UDP packets back and forth.
1717
- {{< ghlink href="examples/cpp-simple" >}}CPP Simple{{< /ghlink >}} (C++) - C++ example that starts up, stays healthy and then shuts down after 60 seconds.
18-
- {{< ghlink href="examples/xonotic" >}}Xonotic{{< /ghlink >}} - Wraps the SDK around the open source FPS game {{< ghlink href="http://www.xonotic.org" >}}Xonotic{{< /ghlink >}} and hosts it on Agones.
18+
- {{< ghlink href="examples/xonotic" >}}Xonotic{{< /ghlink >}} - Wraps the SDK around the open source FPS game [Xonotic](http://www.xonotic.org) and hosts it on Agones.

‎site/content/en/docs/Getting Started/create-fleet.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ simple-udp-llg4x-rx6rc Ready 192.168.122.205 7752 minikube 9m
6666
simple-udp-llg4x-v6g2r Ready 192.168.122.205 7623 minikube 9m
6767
```
6868

69-
For the full details of the YAML file head to the [Fleet Specification Guide]({{< ref "/docs/Reference/fleet.md#fleet-specification" >}})
69+
For the full details of the YAML file head to the [Fleet Specification Guide]({{< ref "/docs/Reference/fleet.md" >}})
7070

7171
### 2. Fetch the Fleet status
7272

‎site/content/en/docs/Guides/Client SDKs/cpp.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ grpc::Status status = sdk->Shutdown();
6565
if (!status.ok()) { ... }
6666
```
6767

68-
To [set a Label]({{< relref "_index.md#setlabelkey-value" >}}) on the backing `GameServer` call
68+
To [set a Label]({{< relref "_index.md#setlabel-key-value" >}}) on the backing `GameServer` call
6969
`sdk->SetLabel(key, value)`.
7070

7171
This will return a grpc::Status object, from which we can call `status.ok()` to determine
@@ -78,7 +78,7 @@ grpc::Status status = sdk->SetLabel("test-label", "test-value");
7878
if (!status.ok()) { ... }
7979
```
8080
81-
To [set an Annotation]({{< relref "_index.md#setannotationkey-value" >}}) on the backing `GameServer` call
81+
To [set an Annotation]({{< relref "_index.md#setannotation-key-value" >}}) on the backing `GameServer` call
8282
`sdk->SetAnnotation(key, value)`.
8383
8484
This will return a grpc::Status object, from which we can call `status.ok()` to determine
@@ -104,7 +104,7 @@ grpc::Status status = sdk->GameServer(&gameserver);
104104
if (!status.ok()) {...}
105105
```
106106
107-
To get [updates on the backing `GameServer`]({{< relref "_index.md#watchgameserverfunctiongameserver" >}}) as they happen,
107+
To get [updates on the backing `GameServer`]({{< relref "_index.md#watchgameserver-function-gameserver" >}}) as they happen,
108108
call `sdk->WatchGameServer([](stable::agones::dev::sdk::GameServer gameserver){...})`.
109109
110110
This will call the passed in `std::function`

‎site/content/en/docs/Guides/Client SDKs/rest.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ $ curl -d "{}" -H "Content-Type: application/json" -X POST http://localhost:5935
7171

7272
Apply a Label with the prefix "stable.agones.dev/sdk-" to the backing `GameServer` metadata.
7373

74-
See the SDK [SetLabel]({{< ref "/docs/Guides/Client SDKs/_index.md#setlabelkey-value" >}}) documentation for restrictions.
74+
See the SDK [SetLabel]({{< ref "/docs/Guides/Client SDKs/_index.md#setlabel-key-value" >}}) documentation for restrictions.
7575

7676
#### Example
7777

‎site/content/en/docs/Guides/gameserver-lifecycle.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: >
88
when being started and match made.
99
---
1010

11-
![Lifecyle Sequence Diagram](../../../../diagrams/gameserver-lifecycle.puml.png)
11+
![Lifecyle Sequence Diagram](../../../diagrams/gameserver-lifecycle.puml.png)
1212

1313
## Next Steps:
1414

‎site/content/en/docs/Guides/metrics.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ Finally to access dashboards run
193193
kubectl port-forward deployments/grafana 3000 -n metrics
194194
```
195195

196-
Open a web browser to [http://127.0.0.1:3000](http://127.0.0.1:3000), you should see Agones [dashboards](#grafana-dashboards) after login as admin.
196+
Open a web browser to [http://localhost:3000](http://localhost:3000), you should see Agones [dashboards](#grafana-dashboards) after login as admin.
197197

198198
> Makefile targets `make grafana-portforward`,`make kind-grafana-portforward` and `make minikube-grafana-portforward`.
199199

0 commit comments

Comments
 (0)