fix(tuples): reject bulk-only flags on single-tuple writes - #107
Merged
Conversation
--on-duplicate, --on-missing, --failed-file, --max-tuples-per-write, --max-parallel-requests and --file-format are read only inside the --file branch, so setting one on a single-tuple write or delete did nothing at all and said nothing about it: `ofga tuples write user:anne viewer doc:1 --on-duplicate ignore` still failed on a duplicate. Setting one without --file is now a usage error, mirroring the guard `model test` already applies to the connection flags it cannot honour. Only flags given on the command line trip it, so defaults are unaffected.
10 tasks
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
--on-duplicate,--on-missing,--failed-file,--max-tuples-per-write,--max-parallel-requestsand--file-formatare all read inside theif file != ""branch oftuples write/tuples delete. On the single-tuple path they were never consulted and never mentioned:Setting one without
--fileis now a usage error naming the flag. This mirrorsrejectInertConnectionFlags, the guardmodel testalready applies to the connection flags it can't honour — the same footgun, the same treatment. Only flags explicitly set on the command line trip it (.Changed), so defaults and--fileruns are unaffected.🏷 Type of change
An invocation that previously appeared to succeed while ignoring what was asked now fails loudly, which is the point.
✅ How to verify
TestBulkOnlyFlagsAreRejectedWithoutFilecovers each flag on bothwriteanddelete;TestBulkOnlyFlagsAreAcceptedWithFilepins that they still work in a bulk run.📋 Checklist
--help/ examples) if behavior changed — the flags' help already scopes them to--filemake checkpasses locally