Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7a064b8
feat(iac/wfctlhelpers): lift resolveStateStore for shared module+CLI use
intel352 May 27, 2026
a9d66e3
refactor(iac/wfctlhelpers): consolidate writeEnvResolvedConfig + infr…
intel352 May 27, 2026
dd4a427
test(iac/wfctlhelpers): cover panic invariants + env-resolve branch +…
intel352 May 27, 2026
63129d6
feat(iac/wfctlhelpers): lift loadIaCProviderFromConfig for shared mod…
intel352 May 27, 2026
9dff952
feat(iac/wfctlhelpers): LoadAllIaCProvidersFromConfig multi-provider …
intel352 May 27, 2026
ecafd76
test(iac/wfctlhelpers): cover ExpandEnvInMap + empty-provider-skip + …
intel352 May 27, 2026
9aff32e
docs(iac/wfctlhelpers): rollback close-error + unique-Name invariant …
intel352 May 27, 2026
8146654
feat(iac/admin): proto contracts for typed admin service
intel352 May 27, 2026
ff06626
feat(iac/admin/catalog): T7a package skeleton + FieldSpecCatalog type
intel352 May 27, 2026
b2efb57
docs(iac/admin/proto): envelope doc comments + reserved tag ranges (T…
intel352 May 27, 2026
fefdf3c
docs(iac/admin/catalog): fix T7b reassignment mechanism in seam comme…
intel352 May 27, 2026
fad5f72
feat(iac/admin/ui_dist): asset pages resources/resource/new (T10-T12)
intel352 May 27, 2026
16ea059
feat(iac/admin/catalog): T7b fill 13 typed Configs + freeform audit
intel352 May 27, 2026
b7e47ab
feat(iac/admin/catalog): T8 region + engine catalogs
intel352 May 27, 2026
5fe88fe
feat(iac/admin/handler): T5 — ListResources + GetResource
intel352 May 27, 2026
98fabd3
feat(iac/admin): T9 vendor infra.proto + parity test + Makefile target
intel352 May 27, 2026
db9fd96
fix(iac/admin/catalog): T7b spec-review F1 + F2
intel352 May 27, 2026
eb08d95
fix(iac/admin/ui_dist): T10-T12 code-review I-1 + I-2 in new.js
intel352 May 27, 2026
1ea231f
feat(iac/admin/handler): T6 — ListResourceTypes + ListProviders + Gen…
intel352 May 27, 2026
a5751b1
test(iac/admin/handler): refactor mask via secrets.MaskSensitiveOutpu…
intel352 May 27, 2026
b77cdf3
feat(cmd/wfctl): T19 + T20 wfctl infra admin CLI + parity test
intel352 May 27, 2026
42b9e1c
feat(iac/admin): T13 embed.FS asset surface + T14 audit JSONL writer
intel352 May 27, 2026
2b01204
chore(cmd/wfctl): use $USER as infra admin audit subject when set
intel352 May 27, 2026
8ac54ca
fix(iac/admin): T6 F1 provider_type from YAML config + F2 config_mess…
intel352 May 27, 2026
25227d8
fix(cmd/wfctl): wire providerTypeByModule into wfctl admin deps (T6 F…
intel352 May 27, 2026
53a03a1
test(cmd/wfctl): refresh T20 parity fixture FQN per T6 F2 fix
intel352 May 27, 2026
c2fd6c3
fix(iac/admin/audit + cmd/wfctl): T14 F1 align Entry to AdminAuditEnt…
intel352 May 27, 2026
6097178
feat(module + engine): T15 host infra.admin module + T16 unit tests +…
intel352 May 27, 2026
aece71d
test(module + Makefile): T17 host-module integration test with live a…
intel352 May 27, 2026
b16aa30
fix(module/infra_admin): T15 F1 audit-tail query params + F2 denied r…
intel352 May 27, 2026
d1c2797
test(module): T17 v2 — real engine boot + external plugin load + HTTP…
intel352 May 27, 2026
136ef96
test(module): T17 v3 — switch to plugins/all.LoadAll + broaden skip p…
intel352 May 27, 2026
990a67a
test(module): T17 v4 — lighter harness w/ live admin plugin subproces…
intel352 May 27, 2026
47341ff
fix(module/infra_admin): T15 follow-up — auth middleware on routes (s…
intel352 May 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: build build-ui build-go test bench bench-baseline bench-compare lint fmt vet fix install-hooks clean ko-build build-wfctl
.PHONY: build build-ui build-go test bench bench-baseline bench-compare lint fmt vet fix install-hooks clean ko-build build-wfctl vendor-infra-proto test-integration-admin

# Common benchmark flags
BENCH_FLAGS = -bench=. -benchmem -run=^$$ -timeout=30m
Expand Down Expand Up @@ -52,6 +52,24 @@ lint:
echo "workflow#699 guard: rpc Apply correctly absent"; \
fi

# Run the T17 host-module integration test that exercises the live
# workflow-plugin-admin gRPC plugin subprocess. The test itself
# (module/infra_admin_integration_test.go) probes for the sibling
# repo at ../workflow-plugin-admin and skips when absent — this
# target makes the dependency explicit + lets CI pass an env var
# to point at a pre-checked-out clone. Per
# docs/plans/2026-05-27-infra-admin-dynamic.md Task 17.
#
# Usage:
# make test-integration-admin # uses ../workflow-plugin-admin
# WORKFLOW_PLUGIN_ADMIN_PATH=/path make ... # explicit override
test-integration-admin:
@if [ ! -f "$${WORKFLOW_PLUGIN_ADMIN_PATH:-../workflow-plugin-admin}/go.mod" ]; then \
echo "workflow-plugin-admin not found at $${WORKFLOW_PLUGIN_ADMIN_PATH:-../workflow-plugin-admin}; set WORKFLOW_PLUGIN_ADMIN_PATH or checkout the sibling repo"; \
exit 1; \
fi
GOWORK=off go test -run TestInfraAdmin_IntegrationWithLiveAdminPlugin -v ./module/

# Format code
fmt:
go fmt ./...
Expand Down Expand Up @@ -91,6 +109,24 @@ run-admin: build
ko-build:
KO_DOCKER_REPO=ko.local ko build ./cmd/server --bare --platform=linux/$(shell go env GOARCH)

# Refresh the vendored workflow-plugin-infra proto descriptor used by
# the FieldSpec catalog parity test (iac/admin/catalog/
# catalog_proto_parity_test.go). Run on every minor upstream
# workflow-plugin-infra release; then update the `Source version:`
# header inside iac/admin/testdata/infra.proto to match the new tag.
#
# Assumes workflow-plugin-infra is checked out as a workspace sibling
# (../workflow-plugin-infra) per the workspace convention.
vendor-infra-proto:
@if [ ! -f ../workflow-plugin-infra/internal/contracts/infra.proto ]; then \
echo "vendor-infra-proto: ../workflow-plugin-infra/internal/contracts/infra.proto not found"; \
exit 1; \
fi
@printf '// Vendored from GoCodeAlone/workflow-plugin-infra/internal/contracts/infra.proto\n// Source version: TODO-update-tag (sourced %s)\n// Refresh via: make vendor-infra-proto\n// Drift detection: catalog_proto_parity_test.go\n\n' "$$(date +%Y-%m-%d)" > iac/admin/testdata/infra.proto
@cat ../workflow-plugin-infra/internal/contracts/infra.proto >> iac/admin/testdata/infra.proto
@echo "Vendored infra.proto refreshed at iac/admin/testdata/infra.proto."
@echo " -> update the 'Source version:' header to the upstream tag now."

# Clean build artifacts
clean:
rm -f server
Expand Down
29 changes: 24 additions & 5 deletions cmd/wfctl/infra.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/GoCodeAlone/workflow/config"
"github.com/GoCodeAlone/workflow/iac/inputsnapshot"
"github.com/GoCodeAlone/workflow/iac/jitsubst"
"github.com/GoCodeAlone/workflow/iac/wfctlhelpers"
"github.com/GoCodeAlone/workflow/interfaces"
"github.com/GoCodeAlone/workflow/platform"
"github.com/GoCodeAlone/workflow/secrets"
Expand Down Expand Up @@ -110,6 +111,8 @@ func runInfra(args []string) error {
return fmt.Errorf("audit-state-secrets exited with code %d", rc)
}
return nil
case "admin":
return runInfraAdmin(args[1:])
default:
return infraUsage()
}
Expand All @@ -136,6 +139,9 @@ Actions:
align Validate IaC config + plan alignment (8 rule families)
test Hermetically validate expected infra config and plan outcomes
security-check Scan plan.json for security policy violations
admin Query the infra.admin host-side module surface
(list-resources, get-resource, list-types,
list-providers, generate-config, audit-tail)
cleanup Tag-based force-cleanup across providers (--tag NAME [--fix])
audit-secrets Report provider_credential anti-patterns in secrets.generate
audit-keys List cloud-side resources of --type via the provider's EnumeratorAll
Expand Down Expand Up @@ -414,9 +420,13 @@ func runInfraPlan(args []string) error {

// parseInfraResourceSpecs reads an infra YAML file and returns the list of
// infra.* modules as ResourceSpecs for plan computation.
// isInfraType returns true for module types handled by wfctl infra commands.
// isInfraType is a one-line delegating shim onto wfctlhelpers.IsInfraType.
// Implementation moved per docs/plans/2026-05-27-infra-admin-dynamic.md
// Task 1 (consolidation follow-up addressing spec-reviewer F2) so wfctl
// and the host-side infra.admin module share one definition. New code
// should call wfctlhelpers.IsInfraType directly.
func isInfraType(t string) bool {
return strings.HasPrefix(t, "infra.") || strings.HasPrefix(t, "platform.")
return wfctlhelpers.IsInfraType(t)
}

// extractDependsOn pulls the depends_on value from a module config map.
Expand Down Expand Up @@ -645,8 +655,10 @@ func planResourcesForEnv(path, envName string) ([]*config.ResolvedModule, error)
return out, nil
}

// isContainerType is a one-line delegating shim onto
// wfctlhelpers.IsContainerType. See isInfraType above for rationale.
func isContainerType(t string) bool {
return t == "infra.container_service"
return wfctlhelpers.IsContainerType(t)
}

// loadCurrentState loads ResourceStates from the configured iac.state backend.
Expand Down Expand Up @@ -1191,8 +1203,15 @@ func resolveProviderForSpec(cfgFile, envName string, spec interfaces.ResourceSpe
}

func isNoopStateStore(store infraStateStore) bool {
_, ok := store.(*noopStateStore)
return ok
if _, ok := store.(*noopStateStore); ok {
return true
}
// resolveStateStore now delegates to wfctlhelpers.ResolveStateStore,
// which returns *wfctlhelpers.NoopStateStore for configs without an
// iac.state module. Recognise both concrete types so downstream
// "do not persist; this is a no-op store" checks stay honest after the
// Task-1 lift.
return wfctlhelpers.IsNoopStateStore(store)
}

func resourceStateFromImportedState(spec interfaces.ResourceSpec, providerType string, imported *interfaces.ResourceState, providerIDOverride string) (interfaces.ResourceState, error) {
Expand Down
Loading
Loading