thoughtspot / cs_tools

Scale your ThoughtSpot adoption with tools created by the ThoughtSpot Solutions Consulting organization.
https://thoughtspot.github.io/cs_tools/
Other
8 stars 6 forks source link

Option --config is ignored on scriptability import method #135

Open felipemm opened 4 months ago

felipemm commented 4 months ago

First Stop

Platform Configuration

│           Info snapshot taken on 2024-05-14                                                                          │
│                                                                                                                      │
│               CS Tools: 1.5.5                                                                                        │
│         Python Version: Python 3.9.16 (main, Jan  4 2023, 11:12:52)                                                  │
│    [Clang 14.0.0 (clang-1400.0.29.202)]                                                                              │
│            System Info: Darwin (detail: macOS-12.7.5-x86_64-i386-64bit)                                              │
│      Configs Directory: /Users/ {anonymous} /Library/Application Support/cs_tools                                    │
│    Activate VirtualEnv: source "/Users/ {anonymous} /Library/Application Support/cs_tools/.cs_tools/bin/activate"    │
│          Platform Tags: macosx-12.6-x86_64   

Description

I am trying to move TML content between different clusters, in order to achieve that I need to have 2 config files (one for prod and one for dev), and assign the correct config based on the operation I need to do (export from prod using config A, import into dev using config B). However, the --config argument seems to be ignored

image

boonhapus commented 4 months ago

Oh that's not good @felipemm , what happens if you put --config dev at the very end of the command instead?

felipemm commented 4 months ago

hmmm it worked (after the path argument), but then I came accross another issue:

image

I checked the config and it is able to log in:

image

I also tried to add dev config as the default, but same error

felipemm commented 4 months ago

Ok I see why, I'm trying to import connections that I exported, but I did not updated it with the credentials.

However, I think there is still a bug here since CSToolError class does not take arguments.

boonhapus commented 4 months ago

Thanks @felipemm , let me check with my colleague on this and #136 rca as well and then we'll push an update

boonhapus commented 3 months ago

We've partially resolved this one (the CSToolsError) with 1.5.6 ... I will have to work more on the --config ordering though. For now, the workaround is to include --config only at the end of the line, when there are arguments involved. We typically build around CLI options (things that being with a double dash --) so this is less of a problem.

The issue lies in this implementation , it just needs to be a smarter algorithm with proper supporting tests.

felipemm commented 3 months ago

awesome, thanks @boonhapus!