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 5 forks source link

Crash when running Git Branches Deploy #162

Closed sp-aaflalo closed 1 month ago

sp-aaflalo commented 1 month ago

First Stop

Platform Configuration

╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                               │
│           Info snapshot taken on 2024-07-30                                                                                   │
│                                                                                                                               │
│               CS Tools: 1.5.9                                                                                                 │
│         Python Version: Python 3.12.2 (main, Feb  6 2024, 20:19:44) [Clang 15.0.0 (clang-1500.3.9.4)]                         │
│            System Info: Darwin (detail: macOS-14.5-arm64-arm-64bit)                                                           │
│      Configs Directory: /Users/ {anonymous} /Library/Application Support/cs_tools                                             │
│    Activate VirtualEnv: source "/Users/ {anonymous} /Library/Application Support/cs_tools/.cs_tools/bin/activate"             │
│     System Python Path: /opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/bin/python3.12    │
│          Platform Tags: macosx-14.0-arm64                                                                                     │
│                                                                                                                               │

Description

Getting issue with deploying changes done on a prod branch to the prod organization.

[11:23:00] INFO     Attempting Basic authentication                                                                                                                                                                      thoughtspot.py:213
[11:23:01] INFO     Attempting Basic authentication in org id XXXXXX                                                                                                                                                  thoughtspot.py:213
                                          ╭──────────────────────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────────────────────╮                                           
                                          │ /Users/balor/Library/Application Support/cs_tools/.cs_tools/lib/python3.12/site-packages/cs_tools/cli/tools/git/branches.py:213 in branches_deploy │                                           
                                          │                                                                                                                                                    │                                           
                                          │   210 │   guids = []                                                                                                                               │                                           
                                          │   211 │   for _ in results:                                                                                                                        │                                           
                                          │   212 │   │   try:                                                                                                                                 │                                           
                                          │ ❱ 213 │   │   │   guids.append(_["file_name"].split(".")[0])                                                                                       │                                           
                                          │   214 │   │   except Exception as e:                                                                                                               │                                           
                                          │   215 │   │   │   rich_console.print(f"[b red]Error getting GUID for {_['file_name']}:  {e}")                                                      │                                           
                                          │   216 │   │   table.add_row(_["file_name"], _["status_code"], _["status_message"])                                                                 │                                           
                                          ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                           
                                          TypeError: string indices must be integers, not 'str'                                                                                                                                            

                                          During handling of the above exception, another exception occurred:                                                                                                                              

                                          ╭──────────────────────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────────────────────╮                                           
                                          │ /Users/balor/Library/Application Support/cs_tools/.cs_tools/lib/python3.12/site-packages/cs_tools/cli/tools/git/branches.py:215 in branches_deploy │                                           
                                          │                                                                                                                                                    │                                           
                                          │   212 │   │   try:                                                                                                                                 │                                           
                                          │   213 │   │   │   guids.append(_["file_name"].split(".")[0])                                                                                       │                                           
                                          │   214 │   │   except Exception as e:                                                                                                               │                                           
                                          │ ❱ 215 │   │   │   rich_console.print(f"[b red]Error getting GUID for {_['file_name']}:  {e}")                                                      │                                           
                                          │   216 │   │   table.add_row(_["file_name"], _["status_code"], _["status_message"])                                                                 │                                           
                                          │   217 │                                                                                                                                            │                                           
                                          │   218 │   rich_console.print(Align.center(table))                                                                                                  │                                           
                                          ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                           
                                          TypeError: string indices must be integers, not 'str'                                                                                                                                            

                                                                             ╭───────────────────── 😧  This is an unhandled error!  😧 ─────────────────────╮                                                                             
                                                                             │                                                                               │                                                                             
                                                                             │ If you encounter this message more than once, please help by letting us know! │                                                                             
                                                                             │                                                                               │                                                                             
                                                                             │           GitHub: https://github.com/thoughtspot/cs_tools/issues/new/choose   │                                                                             
                                                                             │                                                                               │                                                                             
                                                                             ╰──────────── Run cs_tools logs report to send us your last error. ─────────────╯   

Need to upload log files securely?

Send using the secure link.

sp-aaflalo commented 1 month ago

Happens when the call to deploy endpoint fails. Basically, it shouldn't try to process the response if it returns a 400.

I had branch protection enabled, which Thoughspot doesn't like. Going to have to discuss with our rep about this.

billdback-ts commented 1 month ago

@sp-aaflalo I've updated the git tool and committed changes. So they should be in the next release.