fix(lychee): exclude self-referential URLs and fix stale GitHub branch-protection docs link#309
Conversation
|
This change is part of the following stack:
Change managed by git-spice. |
Greptile SummaryThis PR adds three lychee regex exclusion patterns in Confidence Score: 5/5Safe to merge — all changes are targeted exclusion patterns and a doc link fix with no logic regressions. No P0 or P1 findings. The exclusion regexes are correctly anchored with No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[lychee runs on scaffolded project] --> B{URL matches exclusion pattern?}
B -->|Self-referential repo URL\nhost/namespace/repo/*| C[Skip — repo doesn't exist yet]
B -->|GitHub/GitLab Pages URL\nnamespace.host.io/repo/*| D[Skip — docs not deployed yet]
B -->|PyPI project URL\npypi.org/project/distname| E[Skip — package not published yet\nonly if publish_to_pypi]
B -->|No match| F[Check URL]
F --> G{HTTP status}
G -->|Accepted: 200,204,301,302,403,429,502| H[Pass]
G -->|Other| I[Fail / report]
Reviews (3): Last reviewed commit: "fix(lychee): exclude self-referential UR..." | Re-trigger Greptile |
4785460 to
4c241cf
Compare
6e70c0a to
829e28b
Compare
4c241cf to
77fb7b7
Compare
…h-protection docs link
The lychee hook was 404'ing on a fresh scaffold for URLs that point at the
user's own repo (which doesn't exist on GitHub yet) and at the stale
`managing-a-branch-protection-rule` docs page (GitHub renamed the path).
Adds three exclusion patterns to `.lychee.toml.jinja`:
- `{repository_host}/{repository_namespace}/{repository_name}` -- covers
workflow badges, action queries, discussions URL, etc.
- `{repository_namespace}.github.io/{repository_name}` -- covers the
GitHub Pages docs site that doesn't exist before first deploy.
- `pypi.org/project/{distribution_name}` -- only generated when the
project plans to publish, but won't exist before first release.
These are user-owned URLs -- lychee can't tell us anything we don't already
know, and they break every fresh-scaffold first commit.
Updates the README's branch protection link to a current docs page.
77fb7b7 to
5ab22c6
Compare
829e28b to
947bada
Compare
Closes DOT-493
Closes DOT-494
Summary
project/.lychee.toml.jinjafor URLs that 404 on a fresh scaffold:{repository_host}/{repository_namespace}/{repository_name}/...— covers workflow badges, action queries, the discussions URL, etc.{repository_namespace}.github.io/{repository_name}/...— covers the GitHub Pages docs site that doesn't exist before first deploy.pypi.org/project/{distribution_name}— only emitted whenpublish_to_pypi; won't exist before first release.project/README.md.jinjawith the currentabout-protected-branchespage.Why
These URLs all 404 the first time lychee runs on a freshly scaffolded project (before the GitHub repo exists, before CI has run, before docs deploy, before publishing). They're user-owned anyway — lychee can't tell us anything we don't already know — so excluding them removes the noise without losing any real protection.
DOT-493 originally proposed enabling Discussions via the post-scaffold
gh repo edittask. This PR takes the opposite approach: it stops lychee from gating the first commit on a feature the user may not want enabled. Either solution closes the user-visible bug.Test plan
poe test— green