Files
gateway/tests/integration_test.go
e1805283cb refactor(gateway): quarantine Lura/KrakenD behind legacy build tag — KrakenD-free default (#29) (#41)
* refactor(gateway): quarantine the Lura/KrakenD engine behind `legacy` build tag (#29)

Task #29 — own the framework deps. The gateway module path is already
hanzoai-owned (github.com/hanzoai/gateway/v2), but the default build still
pulled the upstream github.com/luraproject/lura + github.com/krakend/* graph
(105 packages) into `go build ./...` and the shipping ghcr.io/hanzoai/gateway
image. This decomplects the KrakenD engine from the default surface.

Decomplect (values, not places): the pure host/path reverse-proxy routing
table split out of router_engine.go into routes.go (stdlib + gin + yaml, ZERO
Lura/KrakenD). The Lura gin-engine builder moved to krakend_engine.go behind
`//go:build legacy`. Every remaining file that imports lura/krakend is gated
behind the same tag so the two builds are orthogonal:

  default  (go build ./...)          — KrakenD-free, ships the HIP-0110 ZAP
                                        relay + pure router. 0 krakend pkgs.
  legacy   (go build -tags legacy)   — full Lura/KrakenD engine, kept
                                        compilable for the Phase-A→C rollout
                                        safety window. 105 krakend pkgs.

Gated files (all lura/krakend importers): backend_factory, base_ha_backend,
base_network_backend, encoding, executor, handler_factory, plugin,
proxy_factory, rebrand, sd, zap_backend, zaphttp_listener + their tests, the
tests/ Lura integration harness, and cmd/gateway-integration. The default
routing/auth/mount/ZAP-relay surface (routes.go, mount.go, build_app.go,
gate.go, auth_middleware.go, ...) already had zero krakend imports.

Proof:
  go build ./...                         -> exit 0
  go list -deps ./cmd/gateway | krakend  -> 0   (KrakenD-free default/image)
  go build -tags legacy ./...            -> exit 0
  go list -tags legacy -deps | krakend   -> 105 (quarantined behind the tag)
  go vet ./...                           -> exit 0
  go test ./...                          -> all packages ok

* docs(gateway): document the Lura/KrakenD fork-ownership boundary + legacy gate (#29)

---------

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-03 03:18:12 -07:00

27 lines
383 B
Go

//go:build legacy
// +build legacy
package tests
import (
"testing"
)
func TestNewIntegration(t *testing.T) {
runner, tcs, err := NewIntegration(nil, nil, nil)
if err != nil {
t.Error(err)
return
}
defer runner.Close()
for _, tc := range tcs {
tc := tc
t.Run(tc.Name, func(t *testing.T) {
if err := runner.Check(tc); err != nil {
t.Error(err)
}
})
}
}