Repository navigation
fix(check): check named file from GitHub blob URLs instead of falling back silently - #226
Conversation
… back silently Closes wheelgap#220
…named lockfiles - The named file is added after the repo's own files, so the badge's automatic pick is unchanged and its link keeps lock= (it checked pyproject.toml again). - The fallback notice says only why; the verdict names the file it actually checked, which can change after a tool-settings-only pyproject.toml. - A named uv.lock/poetry.lock/... in a folder plan() skips, and names wheelgap reads (pylock.*.toml, *.py.lock, requirements*.lock), are checked instead of refused; offline is set from the lockfile name. - With a truncated file list, a named file is fetched rather than called missing. - Tests for pickRequestedFile and isReadableFile. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks, @dev-burnern! Pulling the choice into a pure We've made these changes so it can go in:
It'll merge once a final review passes. (Review assisted by Claude.) |
- Files a link named are marked `added`, and the badge's default comes from the repo's own list, so a repo whose only file was named by the link keeps lock= in its badge. - The "isn't a file this page reads" notice also shows when the fallback file can't be read, and when it needs PyPI lookups. - ?lock= rejects empty, "." and leading-slash segments, as parseRepo() does for blob paths. - *.txt / *.in match case-sensitively, as wheelgap's file_kind does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks again, @dev-burnern! The final review found two more cases, so we've made these changes so it can go in:
It'll merge once a final review passes. (Review assisted by Claude.) |
|
Thanks again, @dev-burnern, this is very close. The review of our last round turned up two more cases, and since we've already been round twice, Patrick will take a final look and merge it himself:
(Review assisted by Claude.) |
driver.py decided offline from the exact names in OFFLINE, so a blob link to pylock.dev.toml or uv-py312.lock was checked as a lookups file and a Python its lock leaves out showed false gaps instead of being listed as outside the lock. needs(), check() and plan() now decide by sources.file_kind's reader (OFFLINE_KINDS), and the page mirrors wheelgap 0.13.0's file_kind in fileKind() for isReadableFile() and the added file's offline flag. *.py.lock is refused with the fallback notice, since 0.13.0 can't read it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d one The badge test still matched the old line, pickLockfile(state.plan.lockfiles, null). Since 7ef3656 renderNext() leaves out files a blob link or ?lock= added (added: true), so the badge for such a file keeps lock= and a visit with the repo alone picks what it always would. The code is right; the test now matches it and checks the three cases: an added file beside the repo's own, an added file that's the only one, and the repo's own default. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflicts with wheelgap#227 resolved by keeping both: the imports are the union (inputHint and pickRequestedFile in check.mjs; inputHint, pickRequestedFile, isReadableFile and fileKind in the logic tests), and both PRs' appended tests are kept. start() keeps wheelgap#227's inputError reset first and wheelgap#226's fileNotice reset and named file; parseRepo() keeps wheelgap#227's dotted-owner refusal with wheelgap#226's file. Co-Authored-By: Claude Opus 5.5 <[email protected]>
One conflict, in tests/site/check-page.test.mjs, where both sides appended tests: both kept (wheelgap#223's resultPage tests, then wheelgap#226's blob-link and wheelgap#227's hint tests). check.mjs, check-logic.mjs and driver.py merged without conflict: onResult() keeps the all-private fallback with its folder filter before wheelgap#226's fallback notice, renderVerdict() has both the private-pyproject verdict and the named-file notice, and driver.py has private_count with the reader-based offline check. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolved with wheelgap#226 and wheelgap#223 as the second review set out. plan() entries are {path, offline: _reads_offline(p)} with other: True for requirements files under other names. pickRequestedFile()'s own pick (no file named, or one that can't be checked) is now autoPick()'s and passes its choose through; a named or added file has choose null. onLoaded() takes wheelgap#226's picked/lockfiles/fileNotice, shows noLockfile only with neither a lock nor a choice, sets the targets, then asks with chooseFile(), which shows the fallback notice. renderSetup keeps the Choose a file option and clears fileNotice on change. The badge default is autoPick() over the files a link didn't add. wheelgap#223's private-pyproject folder filter runs before autoPick(), so covered other-named files are never offered or checked. Tests: both sides kept, harnesses given pickRequestedFile and privatePyprojectReason, pickRequestedFile results now carry choose, and new cases for these interactions. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolved with wheelgap#226 and wheelgap#229 as the second review set out. The page state and onLoaded() take both fileInTree and projectName, and the worker returns both; onLoaded() keeps wheelgap#226's picked/fileNotice and wheelgap#229's chooser, with the targets set before the no-lockfile answer. noLockfile() puts wheelgap#226's notice first on wheelgap#228's text, without the Run uvx wheelgap sentence; showPackageFallback() shows the notice first in #alerts; onResult()'s error branch keeps wheelgap#226's notice in the status, then the package fallback. The worker reads the project name with metadataFiles() over the files that aren't wheelgap#229's other-named requirements files. chooseFile() also offers the --deps command when the repo names its package. Tests: both sides kept; wheelgap#228's harnesses given pickRequestedFile, privatePyprojectReason, autoPick and chooseFile; its status assertion matches main's capitalised Wheelgap. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolved as the second review set out. renderVerdict() sets isClean, toggles the card, hides the README badge offer unless the result is clean with no private-index packages, then uses wheelgap#223's verdict ternary (private pyproject, every Python left out, verdictText). renderNext() keeps wheelgap#225's Keep it green condition (r.private empty) with main's badge default from wheelgap#226/wheelgap#229 untouched. The copy-share handler, with the private count that drops the ✓, sits beside main's copy-prompt handler, which passes state.lab (wheelgap#231). Imports are the union, with shareText. Tests: both sides kept; wheelgap#225's renderVerdict/renderNext harness given autoPick and privatePyprojectReason. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Merged, thanks @dev-burnern! We pushed a few fixes to your branch before merging; the commits say what and why. (Posted with help from Claude.) |
Closes #220
What this changes
site/check/check-logic.mjs:parseRepo()now returnsfile(decoded file path) for GitHub/blob/REF/FILEURLs while keepingdirunchanged, andfile: nullfor/tree/URLs andowner/nameinputs.isReadableFile(path)(*.txt,*.in,pyproject.toml) andpickRequestedFile(lockfiles, requested, inTree, dir)to resolve an explicitly named file (from a/blob/URL or?lock=query): checks it directly if listed, adds it toplan.lockfilesand checks it if present in the repo tree and readable, or falls back to the automatic pick with a clear notice (<file> isn't a file this page reads. Checked <fallback> instead.).site/check/worker.mjs&site/check/check.mjs:query?.lockfile || repo.file) toload(), checks whether it exists in the repo tree (fileInTree), and usespickRequestedFile()inonLoaded().#alerts(and innoLockfile()when the repo has no readable fallback), clearing it if the visitor picks another file in the dropdown.?lock=<file>acrosstoQuery()/fromQuery()so "Copy link to this result" reopens the same check.tests/site/check-logic.test.mjs&tests/site/check-page.test.mjs:parseRepo()fileextraction (nested path, root file,%20names,treeURLs,owner/name),toQuery()/fromQuery()round-trip forrequirements/default.txt, andonLoaded()for an unlistedrequirements/default.txt, a listedbackend/uv.lock, and an unreadableREADME.md.AI tools used (if any): Antigravity (Gemini)
Checklist
node --check site/check/*.mjspassesnode --test tests/site/check-logic.test.mjs tests/site/check-page.test.mjspasses (37/37)