Repository navigation
fix: send package-search sorts the API accepts; download a small dataset in e2e - #65
Merged
Merged
Conversation
…set in e2e `jh package search` sent `sorts[1]=name` as its tiebreak. The packages API requires every sort key to carry a direction sign (`^[+-].+$`) and rejects the unsigned key with a 400. Send `-name`: any fixed direction keeps paging stable, and the signed form is accepted. TestDatasetDownloadFirst downloaded the first Blob listed, which on a shared instance can be a large blob left by another suite and outlast the command timeout. It now downloads the smallest uploaded Blob whose listed size is at most 20 MiB, and skips with a clear message when there is none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
krynju
marked this pull request as ready for review
October 9, 2026 14:27
tanmaykm
approved these changes
Oct 9, 2026
pankgeorg
added a commit
that referenced
this pull request
Oct 14, 2026
* fix(packages): use /api/v1/ui/packages/info for package search and name lookup
`jh package search`, `jh search packages`, `jh package info` and every
`--package <name>` lookup called `/packages/info`, which current JuliaHub
does not route: the request falls through to the git `/packages/` handler
and returns 404. The GraphQL fallback is then refused ("query is not
allowed"), so all of these failed.
Call the web UI's package listing, `/api/v1/ui/packages/info`, instead. It
pages with `pagination[page]`/`pagination[per_page]` (at most 100 per page)
rather than limit/offset, so map the CLI's `--limit`/`--offset` window onto
the covering pages (`planRESTPages`). Order by relevance (`-score`) when a
search term is given, by stars otherwise, and always break ties by name:
packages from one repository share a score, and without a tiebreak their
order changes between requests, so consecutive pages could repeat or skip
rows.
* fix(packages): find a package's registry via the REST listing in `jh package dependency`
Without `--registry`, `jh package dependency <name>` looked the package's
registry up through the GraphQL package search only, which current JuliaHub
refuses ("query is not allowed"), so the command failed. Look it up in the
REST package listing first (`findPackageRegistry`) and keep GraphQL as the
fallback, reporting both errors if both fail.
* fix(packages): send package-search sorts the API accepts
The packages API's `Sorts` schema requires every key to carry a direction
sign (`^[+-].+$`), so the unsigned `sorts[1]=name` tiebreak was rejected with
a 400. Send `-name` instead.
Package changes of #65 (7ad14d9), without its e2e changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat: `jh package dependents <package-name>` lists reverse dependencies
The docs pkg.json that `jh package dependency` already reads also carries
`reversedeps`. `dependents` prints the direct, indirect and total counts and
lists the direct dependents; `--indirect` lists the indirect ones too.
`--registry` and `--server` work as for `dependency`.
A dependent can appear in `reversedeps` once as direct and once as indirect,
so entries are collapsed to one per UUID (direct wins), which matches the
count on JuliaHub's "Dependents" badge.
The pkg.json fetch moves into `fetchPackageDocs`, shared by both commands.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: tan <tanmaykm@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's wrong
jh package searchgets a 400. The CLI sends a name tiebreak assorts[1]=name. The packages API'sSortsschema requires every key to carry a direction sign (^[+-].+$), so the unsigned key is rejected:TestDatasetDownloadFirstcan time out. It downloads the first Blob injh dataset list. On a shared instance that can be a large blob left behind by another suite (around 1 GB), which takes longer than the command timeout to download.What this changes
buildPackagesInfoQuerysends-nameas the tiebreak. The tiebreak only exists to keep paging stable (packages of one repository share a score), so its direction doesn't matter.TestBuildPackagesInfoQuerynow also checks everysorts[i]value against the API's pattern.smallestIDOfTypeanddatasetEntriesOfTypeine2e/helpers_test.go.firstIDOfTypekeeps its behaviour for the status tests. NewTestSmallestIDOfTypeis a pure parsing test.Testing
make checkpasses: gofmt,go vetwith and without thee2etag, unit tests, e2e compile.go test -tags e2e -run 'TestFirstIDOfType|TestSmallestIDOfType' ./e2e/passes.jh dataset listprints every dataset; if it ever paginates, the smallest Blob on the first page is used.🤖 Generated with Claude Code