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

✅ Automated URL checking #26975

Open
wants to merge 5 commits into
base: bugfix-2.1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
102 changes: 102 additions & 0 deletions .github/workflows/check-urls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#
# check-urls.yml
# Check (most) distinct URLs in the project for reachability
#

name: Check URLs

on:
pull_request:
branches:
- bugfix-2.1.x

jobs:
check_urls:
name: Check All URLs
if: github.repository == 'MarlinFirmware/Marlin'

runs-on: ubuntu-latest

permissions:
issues: write
pull-requests: write

steps:

- name: Check out bugfix-2.1.x
uses: actions/checkout@v4
with:
ref: bugfix-2.1.x

- name: Check All URLs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Exit with an error to notify fail on URL tests
run: |
UA="Mozilla/5.0 (Linux; Android 10; SM-G996U Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36"
UTMP=$(mktemp)
echo "[debug 1] UTMP = ${UTMP}"
echo "Gathering URLs. Please wait..."
grep -R -E "https?:\/\/[^ \"''\(\)\<\>]+" . 2>/dev/null \
| grep -v "Binary file" \
| sed -E "s/\/https?:\/\//\//" \
| sed -E 's/.*\((https?:\/\/[^ ]+)\).*$/\1/' \
| sed -E 's/.*\[(https?:\/\/[^ ]+)\].*$/\1/' \
| sed -E 's/.*(https?:\/\/[^ \"''()<>]+).*/\1/' \
| grep -vE "(127\.0\.0\.1|localhost|myserver|doc\.qt\.io|docs\.google\.com|raw\.githubusercontent\.com|[\${}])" \
| sed -E 's/]$//' | sed -E "s/'$//" | sed -E "s/[#.',]+$//" \
| sed -E 's/youtu\.be\/(.+)/www.youtube.com\/watch?v=\1/' \
| sort -u -R \
>"$UTMP"

echo "[debug 2] link count = $(wc -l $UTMP)"
ISERR=
declare -a BADURLS
while IFS= read -r URL
do
echo -n "Checking ${URL} ... "
HEAD=$(curl -s -I -A "${UA}" --request GET "${URL}" 2>/dev/null) ; HERR=$?
if [[ $HERR > 0 ]]; then
# Error 92 may be domain blocking curl / wget
[[ $HERR == 92 ]] || { ISERR=1 ; BADURLS+=($URL) ; }
echo "[FAIL ($HERR)]"
else
HEAD1=$(echo $HEAD | head -n1)
EMSG=
case "$HEAD1" in
*" 301"*) EMSG="[Moved Permanently]" ;;
*" 302"*) EMSG="[Moved Temporarily]" ;;
*" 303"*) echo "[See Other]" ;;
*" 400"*) EMSG="[Invalid Request]" ;;
*" 403"*) EMSG="[Forbidden]" ;;
*" 404"*) EMSG="[Not Found]" ;;
*" 503"*) EMSG="[Unavailable]" ;;
*" 200"*) echo "[ OK ]" ;;
*) EMSG="[Other Err]" ;;
esac
if [[ -n $EMSG ]]; then
if [[ -n $WHERE ]]; then
[[ ${HEAD,,} =~ "location: " ]] && EMSG+=" to $(echo "$HEAD" | grep -i "location: " | sed -E 's/location: (.*)/\1/')"
else
ISERR=1 ; BADURLS+=($URL)
fi
echo $EMSG
fi
fi
done <"$UTMP"

echo "[debug 3]"
if [[ -n $ISERR ]]; then
# Join bad URLs into a bulleted markdown list
printf -v BADSTR -- "- %s\n" "${BADURLS[@]}"
BODY=$(echo -e "URL Checker reports one or more URLs could not be reached:\n${BADSTR}")
echo -e "\n$BODY"
#gh issue comment 26975 --repo $GITHUB_REPOSITORY --body "${BODY}"
exit 1
else
gh issue comment 26975 --body "Comment generated by action."
fi

echo -e "\nURL Check Passed."
exit 0
10 changes: 5 additions & 5 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
*
* Calibration Guides: https://reprap.org/wiki/Calibration
* https://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide
* https://web.archive.org/web/20220907014303/https://sites.google.com/site/repraplogphase/calibration-of-your-reprap
* https://web.archive.org/web/20220907014303/sites.google.com/site/repraplogphase/calibration-of-your-reprap
* https://youtu.be/wAL9d7FgInk
* https://teachingtechyt.github.io/calibration.html
*
Expand Down Expand Up @@ -2785,7 +2785,7 @@

//
// Original RADDS LCD Display+Encoder+SDCardReader
// https://web.archive.org/web/20200719145306/http://doku.radds.org/dokumentation/lcd-display/
// https://web.archive.org/web/20200719145306/doku.radds.org/dokumentation/lcd-display/
//
//#define RADDS_DISPLAY

Expand Down Expand Up @@ -2851,7 +2851,7 @@

//
// Elefu RA Board Control Panel
// https://web.archive.org/web/20140823033947/http://www.elefu.com/index.php?route=product/product&product_id=53
// https://web.archive.org/web/20140823033947/www.elefu.com/index.php?route=product/product&product_id=53
//
//#define RA_CONTROL_PANEL

Expand Down Expand Up @@ -2983,7 +2983,7 @@

//
// Cartesio UI
// https://web.archive.org/web/20180605050442/http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
// https://web.archive.org/web/20180605050442/mauk.cc/webshop/cartesio-shop/electronics/user-interface
//
//#define CARTESIO_UI

Expand All @@ -2994,7 +2994,7 @@

//
// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder
// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1)
// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_%28x1%29
//
//#define ULTI_CONTROLLER

Expand Down
2 changes: 1 addition & 1 deletion Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -3527,7 +3527,7 @@
//#define PHOTOGRAPH_PIN 23

// Canon Hack Development Kit
// https://web.archive.org/web/20200920094805/https://captain-slow.dk/2014/03/09/3d-printing-timelapses/
// https://web.archive.org/web/20200920094805/captain-slow.dk/2014/03/09/3d-printing-timelapses/
//#define CHDK_PIN 4

// Optional second move with delay to trigger the camera shutter
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
* Logical Pin: 28 29 30 31 32 33 34 35 20 21 22 23 24 25 26 27 10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07 08 09(46*47)36 37 18 19 38 39 40 41 42 43 44 45
* Port: A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7
* The logical pins 46 and 47 are not supported by Teensyduino, but are supported below as E2 and E3
* Logical pins 46-47 aren't supported by Teensyduino, but are supported below as E2 and E3
*/

#include "../fastio.h"
Expand Down
11 changes: 3 additions & 8 deletions Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@

/**
* Smoothieware Smoothieboard pin assignments
* Schematic: http://smoothieware.org/_media///external/http.i.imgur.com.oj4zqs3.png
* See https://smoothieware.github.io/Webif-pack/documentation/web/html/smoothieboard.html
*/

#include "env_validate.h"

#define BOARD_INFO_NAME "Smoothieboard"
#define BOARD_WEBSITE_URL "smoothieware.org/smoothieboard"
#define BOARD_WEBSITE_URL "smoothieware.github.io"

//
// Servos
Expand Down Expand Up @@ -131,12 +131,7 @@

/**
* The Smoothieboard supports the REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER with either
* a custom cable with breakouts to the pins indicated below or the RRD GLCD Adapter board
* found at http://smoothieware.org/rrdglcdadapter
*
* Other links to information about setting up a display panel with Smoothieboard
* http://chibidibidiwah.wdfiles.com/local--files/panel/smoothieboard2sd.jpg
* http://smoothieware.org/panel
* a custom cable with breakouts to the pins indicated below or the RRD GLCD Adapter board.
*/
#if IS_RRD_FG_SC
// EXP1 Pins
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/mega/pins_CHEAPTRONICv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* Cheaptronic v2.0 pin assignments
* Built and sold by Michal Dyntar - RRO
* www.reprapobchod.cz (DOES NOT EXIST ANYMORE)
* https://web.archive.org/web/20190306201523/http://reprapobchod.cz/
* https://web.archive.org/web/20190306201523/reprapobchod.cz
* ATmega2560
*/

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/mega/pins_CNCONTROLS_11.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/**
* CartesioV11 pin assignments
* Comes with an Arduino Mega, see
* https://web.archive.org/web/20171024190029/http://mauk.cc/mediawiki/index.php/Electronical_assembly
* https://web.archive.org/web/20171024190029/mauk.cc/mediawiki/index.php/Electronical_assembly
* ATmega2560, ATmega1280
*/

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/mega/pins_CNCONTROLS_12.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/**
* CartesioV12 pin assignments
* Comes with an Arduino Mega, see
* https://web.archive.org/web/20171024190029/http://mauk.cc/mediawiki/index.php/Electronical_assembly
* https://web.archive.org/web/20171024190029/mauk.cc/mediawiki/index.php/Electronical_assembly
* ATmega2560, ATmega1280
*/

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

/**
* BAM&DICE Due (Arduino Mega) pin assignments
* Schematic: http://www.2printbeta.de/download/2PRINTBETA-BAM&DICE-DUE-V1.1-sch.pdf
* Schematic: http://www.2printbeta.de/de/download/2PRINTBETA-BAM&DICE-DUE-V1.1-sch.pdf
* ATmega2560, ATmega1280
*/

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/ramps/pins_K8800.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

/**
* Velleman K8800 (Vertex)
* Schematic: https://www.velleman.eu/downloads/files/vertex-delta/schematics/K8800-schematic-V1.4.pdf
* Schematic: https://cdn.velleman.eu/downloads/files/vertex-delta/schematics/K8800-schematic-V1.4.pdf
* ATmega2560, ATmega1280
*/

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/ramps/pins_ULTIMAIN_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* - https://github.com/Ultimaker/Ultimaker2/blob/master/1546%20ultimainboard%20V2.1.4/schema4.SchDoc
* - https://github.com/Ultimaker/Ultimaker2/blob/master/1546%20ultimainboard%20V2.1.4/schema5.SchDoc
* Schematics (Original+):
* Schematic (Original+): https://github.com/Ultimaker/Ultimaker-Original-Plus/blob/master/1091_Main_board_v2.1.1_(x1)/Ultimainboard%20rev.%202.1.1%20altium.zip
* Schematic (Original+): https://github.com/Ultimaker/Ultimaker-Original-Plus/blob/master/1091_Main_board_v2.1.1_%28x1%29/Ultimainboard%20rev.%202.1.1%20altium.zip
* ATmega2560
*/

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/sam/pins_RADDS.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@

/**
* RADDS Extension Board V2 / V3
* http://doku.radds.org/dokumentation/extension-board
* https://web.archive.org/web/20210627142010/doku.radds.org/dokumentation/extension-board/
*/
//#define RADDS_EXTENSION 2
#if RADDS_EXTENSION >= 2
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/sam/pins_RURAMPS4D_11.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@

#elif ENABLED(SPARK_FULL_GRAPHICS)

//http://doku.radds.org/dokumentation/other-electronics/sparklcd/
// https://sparklab-shop.de/elektronik/40/sparklcd-adapter
#error "Oops! SPARK_FULL_GRAPHICS not supported with RURAMPS4D."
//#define LCD_PINS_D4 29 //?
//#define LCD_PINS_EN 27 //?
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/pins/sanguino/pins_ANET_10.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
#elif IS_RRD_FG_SC

// Pin definitions for the Anet A6 Full Graphics display and the RepRapDiscount Full Graphics
// display using an adapter board. See https://go.aisler.net/benlye/anet-lcd-adapter/pcb
// display using an adapter board. See https://aisler.net/benlye/anet-lcd-adapter/pcb
// See below for alternative pin definitions for use with https://www.thingiverse.com/thing:2103748

#if ENABLED(CTC_A10S_A13)
Expand Down Expand Up @@ -305,8 +305,8 @@
* ====================================================================
*
* Anet V1.0 controller | ZONESTAR_LCD | ANET_FULL_ | RepRapDiscount Full | Thingiverse RepRap wiring
* physical logical alt | | GRAPHICS_LCD | Graphics Display Wiring | https://www.thingiverse
* pin pin functions | | | | .com/thing:2103748
* physical logical alt | | GRAPHICS_LCD | Graphics Display Wiring | https://www.thingiverse.com/thing:2103748
* pin pin functions | | | |
*--------------------------------------------------------------------------------------------------------------------
* ANET-J3.1 8 *** | N/A | J3_TX *** | |
* ANET-J3.2 9 *** | N/A | J3_RX *** | |
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/sanguino/pins_OMCA.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
*
* When installing select 1.0.2
*
* Installation instructions can be found at http://learn.sparkfun.com/pages/CustomBoardsArduino
* Installation instructions can be found at https://learn.sparkfun.com:443/pages/CustomBoardsArduino
* Just use the above JSON URL instead of Sparkfun's JSON.
*
* Once installed select the Sanguino board and then select the CPU.
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f4/pins_RUMBA32_AUS3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/**
* Pin assignments for the RUMBA32
*
* https://aus3d.com.au/rumba32
* https://aus3d.com.au/products/rumba32-control-board
* https://github.com/Aus3D/RUMBA32
*/

Expand Down
3 changes: 1 addition & 2 deletions buildroot/share/PlatformIO/scripts/signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def enabled_defines(filepath):
our crude scraping method and the actual compiler output.
We end up with the actual configured state,
better than what the config files say. You can then use the
a decent reflection of all enabled options that (probably) came from
resulting config.ini to produce more exact configuration files.
'''
outdict = {}
Expand Down Expand Up @@ -188,7 +187,7 @@ def tryint(key):

ini_fmt = '{0:40} = {1}'
ext_fmt = '{0:40} {1}'
ignore = ('CONFIGURATION_H_VERSION', 'CONFIGURATION_ADV_H_VERSION', 'CONFIG_EXPORT')
ignore = ('CONFIGURATION_H_VERSION', 'CONFIGURATION_ADV_H_VERSION', 'CONFIG_EXAMPLES_DIR', 'CONFIG_EXPORT')

if extended_dump:
# Extended export will dump config options by section
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
pins_arduino.h - Pin definition functions for Arduino
Part of Arduino - http://www.arduino.cc/
Part of Arduino - https://www.arduino.cc/

Copyright (c) 2007 David A. Mellis

Expand Down