hey everyone. I'm currently building a custom tap ...
# singer-tap-development
t
hey everyone. I'm currently building a custom tap for Bitbucket. I have reached the final stage and want to test it locally. However when I install it via
meltano add extractor tap-bitbucket --from-ref /absolute-path/tap-bitbucket/meltano.yml
Im getting the error
Plugin definition is invalid: missing properties (name, namespace).
My meltano plugin config looks like this
Copy code
version: 1
default_environment: local
environments:
  - name: local
  - name: dev
  - name: prod
send_anonymous_usage_stats: false
plugins:
  extractors:
    - name: tap-bitbucket
      namespace: tap_bitbucket
      pip_url: -e .
      capabilities:
        - catalog
        - discover
        - state
        - about
      settings:
        - name: auth_username
          kind: string
          sensitive: true
        - name: auth_token
          kind: string
          sensitive: true
        - name: workspaces
          kind: string
        - name: repositories
          kind: string
        - name: start_date
          kind: string
Would appreciate some help, Im a bit lost here.
v
If your goal is to test it locally I wouldn't worry about adding the extractor with
--from-ref
I'd probably do this
Copy code
cd /absolute-path/tap-bitbucket
meltano install
meltano invoke tap-bitbucket
t
by testing locally, i mean installing it in another repo/project and testing flow e2e. invoking the plugin from the plugin dir works fine, tests are green as well
v
https://docs.meltano.com/reference/command-line-interface/#:~:text=Using%20%2D%2Dfrom%2Dref%20allows,or%20testing%20of%20a%20plugin. I'd start with a draft PR to the meltano hub and follow those steps and the do the install from ref there as it looks like you're trying to use your meltano.yml file when the hub definition is slightly different I think specefically you'd need to drop the
plugins
, and
extracts
parent objects in your yaml file
The process here isn't as clean as it could be, maybe there's a better way but that's how I've done it 🤷
What you're saying is a good idea something like
meltano publish extractor-name
would be much nicer!
t
I think I got it now. whenever you call
meltano add
it calls the hub first and gets specifications from it, including settings and other info. then maps it to the actual repo/location of the plugin. it works after flattening the schema and keeping only data from plugins.extractors
e
Yeah, the structure expected in
--from-ref
differs slightly from
meltano.yml
. What I've done in some of my taps, is add a plugin.yaml that I can pull even remotely as
Copy code
meltano add extractor tap-clinicaltrials --from-ref=<https://raw.githubusercontent.com/edgarrmondragon/tap-clinicaltrials/main/plugin.yaml>
The
--from-ref
input should follow this spec: https://docs.meltano.com/reference/plugin-definition-syntax
t
thank you @visch and @Edgar Ramírez (Arch.dev) its more clearer now
âž• 1
🙌 1