Skip to content

fix: register missing harness-config import routes#186

Closed
scion-gteam[bot] wants to merge 2 commits into
mainfrom
scion/dev-import-path
Closed

fix: register missing harness-config import routes#186
scion-gteam[bot] wants to merge 2 commits into
mainfrom
scion/dev-import-path

Conversation

@scion-gteam

@scion-gteam scion-gteam Bot commented Jun 9, 2026

Copy link
Copy Markdown

Summary

Fixes #185

  • Register the unified /api/v1/resources/import endpoint in registerRoutes() — it was defined but never wired up, so all global-scope resource imports (templates and harness-configs) returned 404
  • Add import-harness-configs sub-route in handleProjectRoutes with a new handleProjectImportHarnessConfigs handler, mirroring the existing import-templates endpoint
  • Add tests for global harness-config import, single-directory (leaf) import, and per-project import via HTTP

Test plan

  • TestHandleResourcesImport_HarnessConfigGlobal — unified endpoint with kind: harness-config and scope: global
  • TestHandleResourcesImport_SingleHarnessConfig — importing a single harness-config dir (leaf, not parent-of-dirs)
  • TestHandleProjectImportHarnessConfigs — per-project endpoint POST /api/v1/projects/{id}/import-harness-configs
  • All pre-existing harness-config bootstrap tests still pass

ptone added 2 commits June 9, 2026 00:46
The hub import screen returned HTTP 404 when importing harness-configs
because two routes were never wired up:

1. The unified `/api/v1/resources/import` endpoint handler existed but
   was not registered in registerRoutes() — global-scope imports for
   both templates and harness-configs were unreachable.

2. The per-project `/api/v1/projects/{id}/import-harness-configs`
   endpoint had no backend route or handler (only import-templates
   existed).

Add the missing route registration, implement the per-project
handleProjectImportHarnessConfigs handler, and add tests covering
global harness-config import, single-directory (leaf) import, and
per-project import.
The handleProjectImportHarnessConfigs handler was passing raw user
input to importHarnessConfigsFromRemote without URL normalization,
unlike the analogous template handler and the unified import endpoint
which both call config.NormalizeTemplateSourceURL. This meant bare
hostnames (e.g. "github.com/org/repo") would fail with a non-remote
URI error.
@ptone ptone closed this Jun 9, 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.

Bug: Hub import fails with 404 when importing harness-configs (missing route registration)

1 participant