Hi everyone, I'm planning to build a common modul...
# best-practices
s
Hi everyone, I'm planning to build a common module to validate tap and target configurations (credentials, connection, etc.) before a pipeline is run. The main challenge is that every connector has a different API or method for testing a connection. My first thought is a large
switch
statement to handle each connector individually, but that doesn't seem scalable. Has anyone approached this problem before? I'd love to hear any recommendations or design patterns you'd suggest instead of a massive
switch
case. In any case if meltano offers something which can solve my issue ? Thanks!
👀 1
r
meltano config <tap> test
exists, but no equivalent for targets currently.
s
ohh ok
Any other way I can verify the credentials & configurations for the target ?
r
Not currently without invoking the target directly passing it some input. I could see a way forward for targets built with the SDK in theory, but that is no longer generic as
meltano config <tap> test
is.
s
ohh ok
r
Probably some useful information in https://github.com/meltano/meltano/issues/6855, which also references
meltano test
(which I haven't used before). Maybe worth exploring: https://docs.meltano.com/reference/command-line-interface/#test
I think the general idea is you define `command`s with names beginning with
test
(e.g.
test-connection
), and then use
meltano test
to run them - so you could feasibly have test commands defined for all your taps and targets and then run
meltano test --all
.
s
Ohh .. Thanks for sharing. Let me go through
a
Are you thinking about this in a CICD context? Interesting idea