Repository navigation
feat: instance operator controls (WI-2175) - #509
Conversation
|
Size Change: 0 B 🆕 Total Size: 0 B |
|
This PR has merge conflicts that need to be resolved before it can be merged. Please rebase on the latest |
|
Re-review at Blocker: needs another
|
|
Merge conflicts have been resolved. |
Review findings addressedPushed both existing branches to
Revalidated after integrationAll passed: go build ./internal/... ./cmd/...
make lint
make openapi-v2-check
../core-tests/overlay.sh . -- -tags=test -count=1 ./internal/operatorcontrols/... ./internal/blobstore/... ./internal/llm/... ./internal/smtp/... ./internal/middleware/... ./internal/restapi/v2/...
../core-tests/overlay.sh . -- -tags=test -count=1 -run 'Test(Operator|Script|Condition|Attachment|.*LDAP|.*Action|.*Import|.*Channel|.*Setup)' ./internal/services/... ./internal/handlers/... ./internal/repository/... ./internal/server/...
../core-tests/overlay.sh . -- -tags=test -race -count=1 -run 'TestOperator|TestScriptEngine' ./internal/operatorcontrols/... ./internal/blobstore/... ./internal/services/... ./internal/handlers/... ./internal/repository/... ./internal/middleware/... ./internal/llm/... ./internal/smtp/... ./internal/ldap/... ./internal/restapi/v2/...
TEST_DB_TYPE=postgres TEST_POSTGRES_DSN="$LOCAL_DISPOSABLE_SCHEMA_DSN" ../core-tests/overlay.sh . -- -tags=test -p=1 -count=1 -run TestOperator ./internal/repository/... ./internal/services/... ./internal/handlers/... ./internal/smtp/... ./internal/llm/... ./internal/middleware/... ./internal/restapi/v2/...
../core-tests/overlay.sh . -- -tags=test -count=1 ./internal/auth/... ./internal/ldap/...
../core-tests/overlay.sh . -- -tags=test -count=1 -run 'Test(WeekStartPreferences|ActionDefinitionServiceResolvesCapabilitiesByType|ApplyActionTemplateRollsBackOnGraphWriteFailure)' ./internal/services/...
VITEST_RUNTIME=bun ../core-tests/run-overlay-script.sh . scripts/run-frontend-tests.sh src/lib/settings/OperatorControls.test.js src/lib/settings/SecuritySettings.test.js src/lib/settings/AttachmentSettings.test.js
WINDSHIFT_OPERATOR_POLICY="$PWD/../core-tests/e2e/fixtures/operator-policy.json" E2E_KEEP_ARTIFACTS=1 ../core-tests/run-e2e.sh tests/operator-controls.spec.ts
Not run/claimed: full repository Go/frontend/browser suites, fleet/load testing, or production relay/AI/storage/import qualification. Both PRs still need to merge together; no epic/story closure is claimed. |
Summary
Implement immutable operator controls for WI-2175 and WI-2176–WI-2183, keeping one public application implementation and customer-instance isolation. Production policies, credentials, fleet decisions and qualification remain outside core.
Companion tests: https://github.com/Windshiftapp/core-tests-internal/pull/52 (merge together).
Main integration
Updated to current application
main(f496f1a9), preserving the security and seamless-time-tracking changes. Resolved the appended migration catalog conflict by retaining both sets of migrations and regenerated canonical metadata/OpenAPI. Application merge head:13d21077. The companion test head includes existing time-tracking test PR #50 commits because that API is already on application main; merge that test PR first if desired to keep the review diff focused. No upstream test implementation was rewritten.Post-integration operator/script
-racecoverage, serial PostgreSQL operator coverage, full pre-commit checks and policy-enabled Chromium (setup + 2 tests) passed again. GitHub reports the application branch mergeable; hosted CI checks are still in progress.--operator-policy/WINDSHIFT_OPERATOR_POLICYstartup JSON; no tenant policy-write API or privileged operator account./api/v2/operator-controlsand/rest/api/v2/operator-controls, admin permission + bearer scope, generated contract, shell discovery and admin UI.Story coverage / merge closure checklist
Operational authority matrix, configuration examples, accounting semantics and external prerequisites:
internal/operatorcontrols/README.md.Validation
All Go commands use the companion test repository overlay. Passed:
TestOperatorsuites passed across repository/services/handlers/SMTP/LLM/middleware withTEST_DB_TYPE=postgres, a local disposable-schema DSN and-p=1. Parallel schema creation initially exhausted local PostgreSQL shared lock memory (53200); serial package execution passed without weakening assertions. Final script-blocker inventory also passed on both SQLite and PostgreSQL.make lintand all pre-commit checks passed: Go/static/architecture guards, canonical metadata/OpenAPI reproducibility and client smoke compilation, full frontend checks, locale parity and Svelte check. Initial Svelte validation had zero errors/warnings; after main integration it has zero errors and two upstream warnings.VITEST_RUNTIME=bun ../core-tests/run-overlay-script.sh . scripts/run-frontend-tests.sh ....WINDSHIFT_OPERATOR_POLICY=<test-fixture> E2E_KEEP_ARTIFACTS=1 ../core-tests/run-e2e.sh tests/operator-controls.spec.ts— setup + 2 browser tests passed, including reload and restricted direct navigation. The runner builds app, embed bundle and Go binary.Not claimed: full repository Go/frontend/browser suites, fleet stress/capacity testing or production provider qualification.
Deployment safety / external gates
The restrictive example keeps unqualified AI, mail and imports disabled. Enabling optional services still requires operator qualification:
No production policy file, relay credentials, internal admission directory or planning documents are committed.