Repository navigation
[+] reject parameter values that do not match the task kind - #870
Open
pashagolub wants to merge 5 commits into
Open
pashagolub wants to merge 5 commits into
pashagolub wants to merge 5 commits into
Conversation
Move yaml-format.md chain examples into samples/yaml and pull them in with pymdownx.snippets, so the sample test covers them without regex extraction from Markdown.
SQL parameters must be JSON arrays and PROGRAM parameters arrays of strings; scalars were accepted on insert and failed only at run time. BUILTIN values are checked against the documented top-level type for Sleep, SendMail, Download and the Copy* commands. Migration 00868 adds the check_parameter trigger on timetable.parameter and on kind/command updates of timetable.task, raising 23514. Existing rows are not rewritten. YAML import rejects the same SQL/PROGRAM shapes before touching the database, and every samples/yaml file is now loaded into a real database in TestYamlSamplesLoad.
Coverage Report for CI Build 38942600065Coverage increased (+0.2%) to 88.101%Details
Uncovered Changes
Coverage Regressions1 previously-covered line in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
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.
SQL parameters must be JSON arrays and PROGRAM parameters arrays of strings. Until now a scalar such as
parameters: ["x"]was stored without complaint and only failed when the task ran.Stacked on #867. The first two commits belong to #867 (sample fixes). Review only the last commit; this PR will be rebased onto
masteronce #867 merges.Changes
New migration adds the
check_parametertrigger ontimetable.parameter(insert/update) and onUPDATE OF kind, commandoftimetable.task. Violations raise23514, naming the task and the expected shape.SleepSendMail,Download,Copy*Log,Shutdown,NoOp, unknownNULL, JSONnullYamlTask.ValidateTaskrejects the same SQL/PROGRAM shapes at import, before touching the database.Existing rows are not rewritten. Installs that already hold scalar SQL/PROGRAM parameters keep them (they fail at run time, as before); this belongs in the release notes.
Tests
ddl_test.sql: every example fromreference-commands-tasks-chains.mdis accepted, one wrong-type value per command is rejected, and so is a kind/command change that invalidates stored values.TestYamlSamplesLoadloads everysamples/yamlfile into a real database.TestMigrationschecks the trigger after migrating.Follow-ups
timetable.validate_json_schema