Repository navigation
Release 0.4.1: package fixes and jh package dependents - #68
Merged
Merged
Conversation
…me 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.
…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.
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>
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.
Backports the package fixes from
mainonto the 0.4 line so they can ship as v0.4.1. In v0.4.0,jh package dependency,jh package infoandjh package searchall fail against current JuliaHub withGraphQL errors: [{query is not allowed}]: the REST listing they call (/packages/info) is no longer routed, and the GraphQL fallback query is not on JuliaHub's Hasura allowlist./api/v1/ui/packages/info, anddependencyfinds the package's registry through it before falling back to GraphQL.-name, which the API accepts.jh package dependents <package-name>(also open againstmainas feat:jh package dependents <package-name>lists reverse dependencies #67): it reads thereversedepsalready present in thepkg.jsonthatdependencyfetches and prints direct, indirect and total counts.Everything else on
mainsince v0.4.0 is left out, notablyjh search(#62) and the homepage-layoutjh admin landing-page(#59), which rely on JuliaHub server changes juliahub.com does not run yet, and the auth and device-flow changes from #64. Resolving the cherry-picks droppedsearch.goand two unused imports;CLAUDE.mdkeeps the v0.4.0 text with the package endpoint updated.Tested against juliahub.com with a local build:
package dependency JuMP,package info JuMP,package search JuMP,package searchwith no term and with--offset, andpackage dependents JuMP(335 direct, 94 indirect, 429 total).go vetis clean and the package unit tests pass.ci.ymlat v0.4.0 only runs formain, so this PR gets no CI. After merge, pushingv0.4.1onrelease-0.4runs the release workflow.