Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: link checker job #512

Merged
merged 6 commits into from
Oct 18, 2024
Merged

Conversation

ArthurFlag
Copy link
Member

@ArthurFlag ArthurFlag commented Oct 18, 2024

No description provided.

@ArthurFlag ArthurFlag requested a review from a team as a code owner October 18, 2024 09:00
@github-actions github-actions bot added service/kafka service/postgre platform tech Relates to technical updates of the docs platform. labels Oct 18, 2024
Copy link

cloudflare-workers-and-pages bot commented Oct 18, 2024

Deploying aiven-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: be1c838
Status:⚡️  Build in progress...

View logs

Copy link
Contributor

@harshini-rangaswamy harshini-rangaswamy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

scripts/check_links.sh Outdated Show resolved Hide resolved
Copy link

@rriski rriski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running bash scripts/check_links.sh locally I get lots of hits to other aiven.io subroutes, e.g. /developer, /cluster, /privacy. We should probably only check /docs from this repo?

�[33mhttps://aiven.io/developer/valkey�[0m
	�[31mtoo many redirections�[0m	https://twitter.com/aiven_io
�[33mhttps://aiven.io/developer/flink�[0m
	�[31mtoo many redirections�[0m	https://twitter.com/aiven_io
�[33mhttps://aiven.io/developer/alloydb-omni�[0m
	�[31mtoo many redirections�[0m	https://twitter.com/aiven_io
�[33mhttps://aiven.io/resources?contentType=podcast�[0m
	�[31mtoo many redirections�[0m	https://twitter.com/aiven_io
�[33mhttps://aiven.io/developer/postgresql�[0m
	�[31mtoo many redirections�[0m	https://twitter.com/aiven_io
�[33mhttps://aiven.io/events/aws-immersion-day�[0m
	�[31mtoo many redirections�[0m	https://twitter.com/aiven_io
�[33mhttps://aiven.io/solutions/aiven-for-ai�[0m
	�[31mtoo many redirections�[0m	https://twitter.com/aiven_io
�[33mhttps://aiven.io/recruitment-and-candidate-sourcing-privacy-policy�[0m
	�[31mtoo many redirections�[0m	https://twitter.com/aiven_io
�[33mhttps://aiven.io/blog/category/leader-insight�[0m
	�[31mtoo many redirections�[0m	https://twitter.com/aiven_io
�[33mhttps://aiven.io/blog/category/announcements�[0m
	�[31mtoo many redirections�[0m	https://twitter.com/aiven_io

Negative lookahead regex seems to do the trick:

#!/bin/bash

excludeList=(
	"aiven.io/?!docs"
	"aiven.io/docs/assets"
	"aiven.io/docs/images"
)

rateLimit="--rate-limit=30"
limitConnections="--max-connections=9"
bufferSize="--buffer-size=8192"
timeout="--timeout=3600" # 1 hour
address="https://aiven.io/docs/"
redirectionLimit="--max-redirections=5"
acceptedResponses="--accepted-status-codes=200..404"

muffet ${bufferSize} \
	   ${timeout} \
	   ${excludeList[@]/#/--exclude } \
	   ${limitConnections} \
	   ${rateLimit} \
	   ${redirectionLimit} \
	   ${acceptedResponses} \
	   "--color=always" \
	   ${address};

This should also makes the job quicker, which means we could probably run it more often (maybe once a day?) and the timeout could be reduced from 11hours to 1 hour perhaps?

@ArthurFlag ArthurFlag merged commit ef43930 into main Oct 18, 2024
3 of 4 checks passed
@ArthurFlag ArthurFlag deleted the DOC-657-ci-add-link-checker-cron-job branch October 18, 2024 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform service/kafka service/postgre tech Relates to technical updates of the docs platform.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants