Skip to content

Repo checker: a link to one file (…/blob/main/requirements/default.txt) checks a different file #220

Closed

Description

@patrickballard

Paste the GitHub link of a file and the checker reads the link as "this file's folder", then picks a file by its own rules. If the named file isn't one of the names it lists, it checks something else, or nothing:

https://github.com/celery/celery/blob/main/requirements/default.txt

The page loads celery/celery@main, picks pyproject.toml (the address bar shows lock=pyproject.toml) and ends with:

wheelgap couldn't read pyproject.toml: pyproject.toml: no [project] table, so there are no dependencies to read

The visitor pointed at the exact file they wanted checked. A link to a file is the one case where there is nothing to guess.

Where

  • parseRepo() in site/check/check-logic.mjs: for a blob URL, rest.pop() drops the file name and keeps the folder as dir.
  • onLoaded() in site/check/check.mjs: q?.lockfile && plan.lockfiles.find(...), then pickLockfile(plan.lockfiles, state.repo.dir).
  • plan() in site/check/driver.py only lists files with the names it knows.

What to do

  • parseRepo(): for a blob URL, also return the file's path (file: "requirements/default.txt"), and keep dir as it is.
  • When the link named a file: if plan.lockfiles has that path, check it (as a file the visitor chose: state.auto = false). If it doesn't, but the file exists in the repo tree and its name is one wheelgap reads as a requirements file (*.txt, *.in) or is pyproject.toml, add it to the list and check it.
  • If the named file isn't something the page can read (a .py, a setup.cfg), say so by name and offer the repo's other files: setup.cfg isn't a file this page reads. Checked uv.lock instead. Don't fall back in silence.
  • A link to a folder (/tree/main/backend) and a bare owner/name behave as today.

Done when:

  • tests/site/check-logic.test.mjs: parseRepo() returns file for blob URLs (nested path, root file, a name with %20), and no file for tree URLs and owner/name. The existing expectations get the new key.
  • tests/site/check-page.test.mjs: a blob link to requirements/default.txt checks that file; a blob link to a listed backend/uv.lock checks it, not the root lock; a blob link to README.md shows the message and checks the automatic pick.
  • toQuery() / fromQuery() round-trip the chosen file, so "Copy link to this result" reopens the same check.
  • In the PR: the celery link above, before and after, as screenshots.

Activity

  1. added
    bug
    good first issue
    on Nov 21, 2026
  2. dianatofficial commented on Nov 22, 2026

    @dianatofficial
    Contributor

    I'd like to take this! I'm on it and will follow the criteria closely, including the celery link verification and test coverage.

  3. patrickballard commented on Nov 22, 2026

    @patrickballard
    ContributorAuthor

    Thanks, @dianatofficial! #226 is already open for this one, so we'll take that PR forward.

    If you'd like something with no PR yet, wheelgap/wheelgap#631 could suit you: a pinned requirement is never checked against its -c constraint, so wheelgap passes an install pip refuses. It's in the requirements-file reading you've been close to on the checker side, and it's a correctness fix with a clear test to pin it.

    (Reply assisted by Claude.)

  4. added a commit that references this issue on Nov 22, 2026
    aa50658
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions