Repository navigation
Sources: drafts, and every problem on its pipeline stage (#104) - #108
Open
phornstein wants to merge 3 commits into
Open
phornstein wants to merge 3 commits into
phornstein wants to merge 3 commits into
Conversation
A source that is not complete yet saves as a draft that cannot be enabled, instead of being refused: - SourceSpec::problems lists every problem, each with its stage (source, decode, map, ..., output) and setting. Only an invalid id or name stops a save. validate() still returns the first, as before. - Empty transport settings are reported by name. - MappingSpec::problems reports every rule's problems. - Sources store their problems (migration 0020); a draft cannot be enabled, in the store as well as the API. - PUT on an enabled source is refused unless the spec is complete; enable re-checks. - A refusal is a 422 whose body lists the problems beside the error. - Configuration backups carry drafts; an enabled source in a file must be complete. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Enable stores what checking again finds, so a draft whose problem was resolved elsewhere (a schema published since) can be enabled without re-saving. A refused enable keeps the problems without logging a decision. - The store refuses to save problems onto an enabled source inside its write, so a concurrent enable cannot leave it running a draft. - One draft test (a non-empty JSON array) everywhere; an import's non-array problems read as none. - Transport checks run even with an empty setting; a gRPC source's protobuf compiles once. - Config import lists every problem of a source. - validate_against is gone (problems covers it); ApiError has one constructor. - The client keeps a refusal's problems on ApiError. The Add Source wizard updates a source it already saved (a draft) instead of creating it again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Phase 2 of #104: the backend for drafts and structured errors.
Behaviour (as decided in #104):
{error, problems: [{kind: invalid|incomplete, stage, field?, message}]}.stageissource,decode,map,static_join,registry,affiliation,filter,tracker,throttleoroutput, andnullfor the source as a whole.erroris still the first problem's message, so existing callers keep working.draftandproblems, kept in a new column (migration0020, SQLite schema 20). Sources saved before this migrate as complete.Code
SourceSpec::problems()(ot-source) does all the checking.validate()returns its first result, as before;validate_againstis removed.TransportConfig::missing()andMappingSpec::problems()are new.UI. Nothing visible changes. The client types gain
draft,problemsandSourceProblem, andApiError.problemsis kept for the editor in phase 4. The current Add Source wizard now updates a source it has already saved as a draft, instead of trying to create it again (which returned 409).Review.
/code-review highfound 10 issues. All 10 are fixed in the second commit.Gate (dev server):
cargo fmt --checkandcargo clippy --workspace --all-targets -D warningspass.cargo test --workspacepasses exceptnodes_share_one_picture_under_one_number, the date bug fixed by #106. UI:tsc -bpasses, oxlint has 0 errors, vitest 58/58.🤖 Generated with Claude Code