-
Notifications
You must be signed in to change notification settings - Fork 58
Support other rufus scheduling options #183
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
Conversation
Allow jdbc input to be scheduled with different options supported by rufus scheduler.
💚 CLA has been signed |
@ash-darin Thank you for your contribution! Would you mind signing the CLA? |
@robbavey I'm currently clearing this with higher up. I have to critizise that I have to provide an e-mail address before I am even allowed to read it, or is there a hidden link to the PDF somewhere? |
@ash-darin I'll provide that feedback to the team, but just to clarify, the initial name+email form serves only to pre-fill data in the agreement docusign, after introducing the data you get full access to the agreement and the option to start the signing process itself. [edit] on that next page you can view and download the agreement as a pdf |
@jsvd on that "next page" I have to agree "to use electronic records and signatures", marked with an "*" as mandatory, or if I want to "Finish later" I have to provide an e-mail address. Otherwise I do not get access to the PDF. |
@ash-darin right, those are docusign's own formalities on agreeing to use digital signing. if you are/your company is not comfortable agreeing to that before seeing the CLA itself I'll reach out internally to find a way to get the pdf to you first. |
Is there anything else I ought to do / observe? |
Given |
I don't see the reason to limit us in that way, there is a use case for which
I would therefore ask that both, |
Thanks for the clarification, could I ask you to add docs for period and interval and their equivalent section to docs/input-jdbc.asciidoc? Example:
|
Of course, should I do this in this PR? Or better not add to this and open a separate one? |
I'd prefer in the same PR so the same changeset introduces the feature and its associated documentation. 🙏 |
@ash-darin thanks for the doc work! I created a PR against yours to make the exclusive nature of these settings explicit to the user ash-darin#1 |
make scheduling option exclusivity explicit
Remove default "no error case", build fails otherwise
@jsvd Hi, I merged your PR but had to remove the else path as it made the build fail for reasons I could not understand. It was "just" the "ok, do nothing" path, so I think that ought to be sufficient? See here for an example: https://app.travis-ci.com/github/logstash-plugins/logstash-integration-jdbc/jobs/633122890 The Travis builds still fail in part but not due to anything in my PR it seems to me. |
This is enough to fix it, while keeping the test: diff --git a/spec/inputs/jdbc_spec.rb b/spec/inputs/jdbc_spec.rb
index 6085c41..4d08ccd 100755
--- a/spec/inputs/jdbc_spec.rb
+++ b/spec/inputs/jdbc_spec.rb
@@ -229,19 +229,28 @@ describe LogStash::Inputs::Jdbc do
end
describe "scheduling options" do
+ let(:settings) { super().merge("statement" => "SELECT :num_param as num_param FROM SYSIBM.SYSDUMMY1") }
scheduling_options = ["interval", "schedule", "period"]
scheduling_options.combination(2).each do |option1, option2|
context "when using '#{option1}' and '#{option2}' at the same time" do
let(:settings) { super().merge(option1 => 'a', option2 => 'b') }
it "raises a configuration error" do
- expect { plugin.register }.to raise_error(LogStash::ConfigurationError)
+ expect { plugin.register }.to raise_error(LogStash::ConfigurationError, /Use only one/)
end
end
end
context "when using 'schedule', 'period' and 'interval' at the same time" do
let(:settings) { super().merge("interval" => "a", "period" => "b", "schedule" => "c") }
it "raises a configuration error" do
- expect { plugin.register }.to raise_error(LogStash::ConfigurationError)
+ expect { plugin.register }.to raise_error(LogStash::ConfigurationError, /Use only one/)
+ end
+ end
+ scheduling_options.each do |option|
+ context "when using only '#{option}'" do
+ let(:settings) { super().merge(option => "a") }
+ it "does not raise a configuration error" do
+ expect { plugin.register }.to_not raise_error
+ end
end
end
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI failures are unrelated and due to an issue in the snapshot logstash docker images that will be fixed by tomorrow. LGTM. I'll merge and publish the PR. thanks for the contribution!
Allow jdbc input to be scheduled with different options supported by rufus scheduler.
Thanks for contributing to Logstash! If you haven't already signed our CLA, here's a handy link: https://www.elastic.co/contributor-agreement/