Skip to content

fix: allow unauthenticated access to packages and resgistries for juliahub.com - #51

Closed
thelonewolf1603 wants to merge 12 commits into
mainfrom
nd/jh-cli-e2e-tests
Closed

fix: allow unauthenticated access to packages and resgistries for juliahub.com#51
thelonewolf1603 wants to merge 12 commits into
mainfrom
nd/jh-cli-e2e-tests

Conversation

@thelonewolf1603

Copy link
Copy Markdown
Contributor

No description provided.

thelonewolf1603 and others added 11 commits June 8, 2026 06:21
Add an `e2e`-tagged Go test suite under e2e/ that builds the jh binary and
runs its read/GET commands against a live JuliaHub instance (the platform
nightly instance by default). One file per command category; commands that
need a specific entity (dataset, registry, project) list first and drive the
detail command off the first entry. Tests assert real behaviour and skip
gracefully on backend gaps (missing perms, absent endpoints, disallowed
queries, timeouts) while still failing on genuine CLI defects.

Authentication is purely file-based: the harness materializes a throwaway
~/.juliahub in an isolated HOME from credentials supplied via env vars, so the
CLI's auth path is exercised unchanged and a real login is never touched. The
suite is build-tag gated so `go test ./...` is unaffected; CI compile-checks it.

Also fix `admin group list`, which failed to parse the /app/config/groups
response: the endpoint returns groups bucketed by category
({"juliahub":{"groups":[...]},"site":{"groups":[...]}}) but the code expected a
top-level array. Parse the categorized object, flatten, and sort by id.

Includes e2e/ci/ glue (composite action + example job) for wiring the suite
into the JuliaHub platform nightly CI.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add e2e/scan_test.go for `jh scan`: a deterministic input-validation test
(missing manifest) plus a submit→status→results lifecycle that uploads a sample
Manifest.toml with --no-wait, then drives `scan status`/`scan results` off the
server-assigned run_uuid. Skips when the static-analysis endpoint is absent on
the instance (404). Adds an errorLine() harness helper for clearer skip
diagnostics.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Self-review cleanup of the e2e suite:

- Split the 459-line harness_test.go: run machinery stays in harness_test.go;
  assertions, output parsers, and backend-gap/skip helpers move to
  helpers_test.go.
- Unify the duplicated packageBackendGap/scanBackendGap into a single
  backendGap() helper; use the clearer errorLine() in their skip messages.
- Fix a temp-dir leak: the freshly built binary's dir is now removed on exit.
- Drop the write-only result.err field and the dead expectedName var.
- Remove the duplicated e2e/ci/ CI snippets; the canonical wiring lives in the
  JuliaHub repo. Fold a concise "Running in CI" section into e2e/README.md.
- Add a Makefile (make e2e / e2e-fast / e2e-compile / check) so developers
  don't have to remember the -tags e2e invocations; e2e-fast skips the slow
  project-list tests (~14s vs ~70s).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@thelonewolf1603 thelonewolf1603 changed the title fix: trim package info response fix: allow unauthenticated access to packages and resgistries for juliahub.com Aug 13, 2026
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.

1 participant