Repository navigation
Go SDK and dexcli: upload Flow Definition Graphs to the Dex Server - #1599
Merged
Merged
Conversation
Add UploadFlowDefinitions, ListFlowDefinitions, and GetFlowDefinitions to FlowService. server-zd keeps one FlowDefinitionRecord object per Flow type under registry/flow-definitions/<tenant_id>/types/, created with If-None-Match and replaced with If-Match by the replace rule.
Document the three FlowService RPCs, the replace rule and force, the flowDefinitions.maxDefinitionBytes key, the object layout under registry/flow-definitions/, and the 0.1.26 change log entries. Add the key to the example configuration and the dexzd-api README. Cover Flow types that contain percent signs, dots, and slashes in the tests.
…to feat/flow-definition-upload-go
Add WorkerOptions.FlowDefinitionPaths and FlowDefinitions. NewWorker reads and validates the documents; Start uploads those of registered Flow types after protocol negotiation and before opening task streams, and only logs a warning when the upload fails. Add ReadFlowDefinitionFiles and Client.UploadFlowDefinitions for deployment scripts. Add dexcli flow-definition upload and list, which read files with the Go SDK rules. Document both in the Go and cli references and changelogs.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Skip non-FDG JSON files found in directories, parse generatedAt strictly as RFC 3339, truncate generated times to milliseconds, and rewrite only absolute source.path values with lexical normalization and minimal JSON escaping. Upload without holding the Worker lifecycle lock so Stop cancels an in-flight upload, and log unknown outcomes as unknown. Add the shared conformance fixture under protos/conformance and assert it.
Rewrite source.path only when the top level has exactly one source object with exactly one string path, check RFC 3339 field ranges, and assert the extended conformance fixture. dexcli warns on unknown upload outcomes and reports the uploaded digest and time for KEPT_EXISTING.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
WorkerOptions.FlowDefinitionPaths(files or directories) andWorkerOptions.FlowDefinitions([]FlowDefinitionDocument).NewWorkerreads and merges them (invalid files and duplicate Flow types are configuration errors);Startuploads only the registered Flow types afterSyncAttributeIndexesand before opening task streams. Upload failures, including UNIMPLEMENTED from older servers (logged once), are warnings and never stop the Worker.source.pathis rewritten only when absolute (relative to the working directory, else the file name), byte-preserving otherwise. Batches split at 256 items or 16 MiB of content.Client.UploadFlowDefinitions(ctx, documents, force)andReadFlowDefinitionFiles, withFlowDefinitionUploadResultandFlowDefinitionUploadOutcome(including an unknown value for forward compatibility).dexcli flow-definition upload <path>... [--force]anddexcli flow-definition list.dexcli dev --flow-rendering-diris documented as optional.Why
Dex Web features (Designs, agent session view and Actions, Work Queue) need Flow Definition Graph JSON, which today must sit in a directory next to Dex Web. With the server-side storage in #1595, Workers can upload the graphs at startup so every Dex Web reads them from the Dex Server. Depends on #1595 (its commits appear here until it merges); Dex Web reading lands in a separate PR in the same 1.45 release.
Testing
sdk-go/integ/flow_definition_test.goagainst server-zd built from this branch: file and in-memory upload compared byte for byte via GetFlowDefinitions, registered-only filtering,source.pathrewrite, mtime versusgeneratedAt, duplicate-source error, rejected upload still lets the Worker run a Flow, Client outcomes and force. Full./integpasses.go test -race ./dex ./examples/....cli/internal/dev/flow_definition_integ_test.go: real server-zd and Dex Web without--flow-rendering-dir, 1001 definitions across several upload requests and list pages, KEPT_EXISTING then--force, 1.x file rejected.make -C sdk-go docsCheck,make copyright-check, gofmt,cd docs && npm run check.