Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a validate phase that allows more validation at definition time #443

Merged
merged 1 commit into from
Apr 13, 2016

Conversation

jonseymour
Copy link
Contributor

With this change, more validation can be pushed from runtime to definition time.

See the current implementation of #431 for an example of how it is used.

Signed-off-by: Jon Seymour jon@wildducktheories.com

@jonseymour jonseymour force-pushed the jss-438-add-validate-phase branch 2 times, most recently from 7e3ca5e to 0f02f80 Compare April 9, 2016 06:41
jonseymour added a commit to jonseymour/kapacitor that referenced this pull request Apr 9, 2016
…cycle.

It is better if we can detect and report configuration errors of task
pipeline early, during task definition, rather than deferring such
checks to runtime (when this is possible).

To support such checks, we add a Validate() error method to
the pipeline.Node() interface which gives pipeline nodes a chance
to validate their configuration. Any pipeline containing nodes
that do not pass these test cannot be saved.

Signed-off-by: Jon Seymour <jon@wildducktheories.com>
jonseymour added a commit to jonseymour/kapacitor that referenced this pull request Apr 9, 2016
…finition time.

Assuming the acceptance of PR influxdata#443, some validations previously performed
at runtime can now be performed at definition time.

The existing validations are moved into the pipeline.JoinNode type.

The validations are extended to resolve the panic reported in issue influxdata#331.

Signed-off-by: Jon Seymour <jon@wildducktheories.com>
@nathanielc
Copy link
Contributor

@jonseymour I like this change. The only part that I don't like is that now that all specific Validate implementation have to mark them selves as tick:ignore or they will show up in the public API docs, and be callable from TICKscript. Want do you think about making this validate method private? It would still exist and provide utility but isn't necessary outside the package since its called on CreatePipeline for you.

…cycle.

It is better if we can detect and report configuration errors of task
pipeline early, during task definition, rather than deferring such
checks to runtime (when this is possible).

To support such checks, we add a Validate() error method to
the pipeline.Node() interface which gives pipeline nodes a chance
to validate their configuration. Any pipeline containing nodes
that do not pass these test cannot be saved.

Signed-off-by: Jon Seymour <jon@wildducktheories.com>
jonseymour added a commit to jonseymour/kapacitor that referenced this pull request Apr 13, 2016
…finition time.

Assuming the acceptance of PR influxdata#443, some validations previously performed
at runtime can now be performed at definition time.

The existing validations are moved into the pipeline.JoinNode type.

The validations are extended to resolve the panic reported in issue influxdata#331.

Signed-off-by: Jon Seymour <jon@wildducktheories.com>
@jonseymour
Copy link
Contributor Author

I'll have to rebase again tomorrow - dead tired now.

@nathanielc nathanielc merged commit c043293 into influxdata:master Apr 13, 2016
nathanielc pushed a commit that referenced this pull request May 4, 2016
…ime.

Assuming the acceptance of PR #443, some validations previously performed
at runtime can now be performed at definition time.

The existing validations are moved into the pipeline.JoinNode type.

The validations are extended to resolve the panic reported in issue #331.

Signed-off-by: Jon Seymour <jon@wildducktheories.com>
nathanielc pushed a commit that referenced this pull request May 5, 2016
* PR #431: Move some join node validations from runtime to definition time.

Assuming the acceptance of PR #443, some validations previously performed
at runtime can now be performed at definition time.

The existing validations are moved into the pipeline.JoinNode type.

The validations are extended to resolve the panic reported in issue #331.

Signed-off-by: Jon Seymour <jon@wildducktheories.com>

* CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants