Skip to content

Lychee CI: only check changed URLs in PRs - #9614

Merged
Alkarex merged 1 commit into
FreshRSS:edgefrom
Inverle:lychee-only-changed-urls-in-prs
Nov 23, 2026
Merged

Alkarex merged 1 commit into
FreshRSS:edgefrom
Inverle:lychee-only-changed-urls-in-prs

Conversation

@Inverle

@Inverle Inverle commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Ref: #9209 (comment)

Only checks modified or added URLs in PRs to reduce noise. The workflow still continues to scan the entire repo for push and cron events.

Tested working in a fork PR.

@Inverle Inverle added this to the 1.31.0 milestone Nov 22, 2026
@Inverle Inverle added System care Everything related to system care github_actions Pull requests that update GitHub Actions code labels Nov 22, 2026
echo "Changed files:"
cat changed-files.txt
# Lychee doesn't have an option for checking only the changed links, so neutralize all the other URLs of the changed files (`http` -> `hxxp`).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@Alkarex

Alkarex commented Nov 22, 2026

Copy link
Copy Markdown
Member

Looks a bit complicated, but we can give it a try.
I have not looked into the details, but what about taking a diff of the PR, making a file of it, and check only the resulting file?

@Inverle

Inverle commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

I have not looked into the details, but what about taking a diff of the PR, making a file of it, and check only the resulting file?

It wouldn't preserve the exact filenames and line numbers of the failed URLs in the summary output.

Comment thread lychee.toml
Comment on lines +38 to +39
# Files (PHPUnit tests)
'(^|/)tests/app/Utils/httpUtilTest\.php$',

@Inverle Inverle Nov 22, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added it because lychee fails to parse the file (the URLs were added when the workflow was disabled):

# Summary

| Status         | Count |
|----------------|-------|
| 🔍 Total       | 7024  |
| 🔗 Unique      | 5246  |
| ✅ Successful  | 422   |
| ⏳ Timeouts    | 0     |
| 🔀 Redirected  | 0     |
| 👻 Excluded    | 6599  |
| ❓ Unknown     | 0     |
| 🚫 Errors      | 3     |
| ⛔ Unsupported | 0     |

## Errors per input

### Errors in ./tests/app/Utils/httpUtilTest.php

* [ERROR] <error:> (at 63:41) | Cannot parse 'https://example.net/"><b>' into a URL: invalid international domain name
* [ERROR] <error:> (at 64:49) | Cannot parse 'https://example.net/path?a=1&b=2' into a URL: invalid international domain name
* [ERROR] <error:> (at 65:43) | Cannot parse 'https://example.net@example.org/' into a URL: invalid international domain name

@Alkarex

Alkarex commented Nov 22, 2026

Copy link
Copy Markdown
Member

It wouldn't preserve the exact filenames and line numbers of the failed URLs in the summary output.

If the error is for instance Link http://abc.example.net/ is invalid, it might be sufficient (and we can even automatically grep for it afterwards if we want the filenames and lines back)

@Inverle

Inverle commented Nov 22, 2026 •

Copy link
Copy Markdown
Member Author

It wouldn't preserve the exact filenames and line numbers of the failed URLs in the summary output.

If the error is for instance Link http://abc.example.net/ is invalid, it might be sufficient (and we can even automatically grep for it afterwards if we want the filenames and lines back)

The config rules would have to be followed too, e.g.

FreshRSS/lychee.toml

Lines 20 to 43 in dcd40cb

extensions = [
"md", "html", "css", "js", "php", "phtml", "sh", "json", "jsonc", "xml", "yml", "yaml", "toml", "neon", "dist", "conf", "txt",
# Dotfiles
"htaccess", "editorconfig", "gitattributes", "gitignore", "jshintignore", "jshintrc", "stylelintignore", "dockerignore"
]
# For extensionless files
default_extension = "txt"
include_verbatim = true
hidden = true
exclude_path = [
# Files
'(^|/)index\.html$',
'(^|/)\.github/ISSUE_TEMPLATE/feed-report-form\.yml$',
# Directories
'(^|/)data/(cache|users|favicons)($|/)',
'(^|/)lib/(phpmailer|simplepie|phpgt|marienfressinaud)($|/)',
'(^|/)docs/(_includes|_layouts|i18n)($|/)',
'(^|/)p/scripts/vendor($|/)'
]

I know the changed-files.txt extraction step follows extensions and default_extension, but not sure about exclude_path and hidden (might have to fix that if not).

Anyway I think that would be inconvenient, if wanting to fix the failed URLs one by one. And that approach would also scan more URLs than necessary.

I guess printing the colored diff alongside would help, but it would still be harder to read than the Markdown summary.

@Alkarex

Alkarex commented Nov 23, 2026

Copy link
Copy Markdown
Member

Let's try with that for now, but it would be nice we something simpler and lighter at some point

@Alkarex
Alkarex merged commit 306327a into FreshRSS:edge Nov 23, 2026
5 checks passed
@Inverle
Inverle deleted the lychee-only-changed-urls-in-prs branch November 23, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code System care Everything related to system care

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants