tableau / connector-plugin-sdk

SDK for Developing Tableau Connector Plugins
https://tableau.github.io/connector-plugin-sdk/
MIT License
108 stars 107 forks source link

[BUG] connector packager failure if a custom parameter does not present in .tdr #1076

Closed xsgao-github closed 1 year ago

xsgao-github commented 1 year ago

Describe the bug According to this doc, tableau.github.io/connector-plugin-sdk/docs/api-reference#connection-normalizer, I don't have to declare custom parameters in connectionResolver.tdr, Tableau is able to figure out them using connection-fields.xml at runtime.

Yes, it works when I use flat files in Tableau via -DConnectPluginsPath=, but when I use connector-packager, it errors out.

(.venv) connector-plugin-sdk/connector-packager$ git status
On branch master
Your branch is up to date with 'origin/master'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        packaged-connector/

nothing added to commit but untracked files present (use "git add" to track)
(.venv) connector-plugin-sdk/connector-packager$ python setup.py install
...
(.venv) connector-plugin-sdk/connector-packager$ pip list
Package            Version
------------------ -------
connector-packager 2.1.0
defusedxml         0.7.1
elementpath        4.0.1
packaging          23.0
pip                22.2.1
setuptools         63.2.0
tdvt               2.7.0
xmlschema          2.2.1
(.venv) connector-plugin-sdk/connector-packager$ python -m connector_packager.package ../../tdvt_workspace/plugins/trino_jdbc             
The log path /Users/sgao/GitHub/tableau-plugin/connector-plugin-sdk/connector-packager exists
XML Validation failed for connectionResolver.tdr
XML validation failed. 1 violations found.
Validation failed. Check /Users/sgao/GitHub/tableau-plugin/connector-plugin-sdk/connector-packager/packaging_logs.txt for more information.

Within the log:

2023-02-16 00:19:07,511 [DEBUG] | Attribute 'vendor1' in connection-fields but not in required-attributes list.
2023-02-16 00:19:07,511 [ERROR] | XML validation failed. 1 violations found.

My connectionResolver.tdr:

...
      <required-attributes>
        <attribute-list>
          <attr>server</attr>
          <attr>port</attr>
          <attr>dbname</attr>
          <attr>authentication</attr>
          <attr>username</attr>
          <attr>password</attr>
          <attr>sslmode</attr>
          <!-- attr>vendor1</attr>
          <attr>v-krb-principal</attr>
          <attr>v-krb-service</attr>
          <attr>v-krb-service-pattern</attr>
          <attr>v-krb-rdns</attr>
          <attr>v-krb-config-path</attr>
          <attr>v-krb-keytab-path</attr>
          <attr>v-krb-cache-path</attr>
          <attr>v-ssl-truststore-type</attr>
          <attr>v-ssl-truststore-path</attr>
          <attr>v-ssl-truststore-password</attr -->
        </attribute-list>
      </required-attributes>
    </connection-normalizer>
  </connection-resolver>
</tdr>

If I uncomment those parameters, the connector packager works.

(.venv) connector-plugin-sdk/connector-packager$ python -m connector_packager.package ../../tdvt_workspace/plugins/trino_jdbc
The log path /Users/sgao/GitHub/tableau-plugin/connector-plugin-sdk/connector-packager exists
Validation succeeded.

Detected vendor-defined fields:
['vendor1', 'v-krb-principal', 'v-krb-service', 'v-krb-service-pattern', 'v-krb-rdns', 'v-krb-config-path', 'v-krb-keytab-path', 'v-krb-cache-path', 'v-ssl-truststore-type', 'v-ssl-truststore-path', 'v-ssl-truststore-password']
Vendor-defined fields will be logged and persisted to Tableau workbook xml in plain text. You must confirm that the user inputs for fields listed above do not contain PII before distributing this connector to customers.

Detected minimum Tableau version required: 2020.4
-Connector uses Connection Dialogs V2, which was added in the 2020.3 release
-min-tableau-version set to 2020.4, since that is higher than calculated version of 2020.3

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

About you: Name: Song Gao Company: Starburst Data

rosswbrown commented 1 year ago

Based on the answers and changes in #1072 this is being closed as by design. We'll ensure any future documentation changes in this area also includes supporting changes within the packaging step.