Skip to content

Move all GitHub checks into dedicated module - #2254

Open
mre wants to merge 5 commits into
masterfrom
github-specialized-readme-checker
Open

mre wants to merge 5 commits into
masterfrom
github-specialized-readme-checker

Conversation

@mre

@mre mre commented Jul 5, 2026 •

Copy link
Copy Markdown
Member

This PR moves GitHub-specific link handling out of the generic website checker and request quirks.

What changed:

  • GitHub URL parsing now lives in checker::github::url.
  • GitHub API calls now go through checker::github::api and the existing HostPool.
  • GitHub request rewrites now live in checker::github::request instead of generic Quirks.
  • WebsiteChecker delegates GitHub behavior before and after the normal website path.
  • The old types::uri::github::GithubUri parser and Octocrab dependency are gone.

This is still a draft. I mainly want to check whether this module split feels right before polishing the edge cases further.

@mre mre closed this Jul 5, 2026
@mre mre changed the title Prototype specialized GitHub README checks Move all GitHub checks into dedicated module Jul 5, 2026
@mre mre reopened this Jul 5, 2026
@mre
mre marked this pull request as draft July 5, 2026 15:17
@mre
mre force-pushed the github-specialized-readme-checker branch 3 times, most recently from a424ad5 to fe75bd7 Compare July 5, 2026 19:52
@katrinafyi

Copy link
Copy Markdown
Member

Just some quick thoughts.. Yeah, I think this is the right approach. Thanks for getting started!

I think we should centralise around the GithubUrl enum. The other files like api.rs are probably less important in a first pass.

There is a architecture decision of how to hook it into the website checker. I don't love the before+after functions. Maybe a GithubChecker should wrap a WebsiteChecker, so then the github checker naturally has control over whether to delegate to the website checker.

I also see that github/request.rs does some rewriting and logging. I'm increasingly thinking that we need to abstract the remaps/redirect history feature into a generic "url transformation history". It would be something like a Vec<(Url, TransformKind)> and could record remaps, redirects, github, maybe quirks, and it would increase transparency around these various URL transformations.

But these are just very rough thoughts and it doesn't have to happen all at once (or at all). I'll let you keep working on it and exploring the solution space :)

@thomas-zahner thomas-zahner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I really like this draft already. I also really like how this enables us to simply drop the dependency on octocrab

Comment thread lychee-lib/src/checker/github/api.rs Outdated
&self,
owner: &str,
repo: &str,
ref_: Option<&str>,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is the trailing underscore intentional? Seems to repeat itself quite a lot in this PR.


#[derive(Debug)]
pub(crate) struct RepoStatus {
pub(crate) status: Status,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some doc comments would help here

Comment thread lychee-lib/src/checker/github/mod.rs Outdated
///
/// This keeps private repository checks working without leaving GitHub API
/// details in the generic website checker.
pub(crate) async fn check_after_website_failure(&self, status: Status, uri: &Uri) -> Status {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As @katrinafyi mentions the before/after distinction feels a bit funky. But I'm not sure what the best approach is. Making the GitHub checker wrap a Websitechecker might indeed make sense.

@mre
mre force-pushed the github-specialized-readme-checker branch from fe75bd7 to 2302d50 Compare September 20, 2026 16:24
@mre
mre marked this pull request as ready for review September 20, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants