|
62 | 62 | pip install -e .
|
63 | 63 | pip install pyarrow
|
64 | 64 |
|
| 65 | + - name: Create debugging patch script |
| 66 | + run: | |
| 67 | + cat > patch_for_debugging.py << 'EOF' |
| 68 | + #!/usr/bin/env python3 |
| 69 | + |
| 70 | + def patch_code(): |
| 71 | + with open('src/databricks/sql/auth/token_federation.py', 'r') as f: |
| 72 | + content = f.read() |
| 73 | + |
| 74 | + # Add verbose request debugging |
| 75 | + modified = content.replace( |
| 76 | + 'try:\n # Make the token exchange request', |
| 77 | + 'try:\n import urllib.parse\n # Debug full request\n print(f"Token endpoint: {self.token_endpoint}")\n print(f"Request parameters: {urllib.parse.urlencode(params)}")\n print(f"Request headers: {headers}")\n # Make the token exchange request' |
| 78 | + ) |
| 79 | + |
| 80 | + # Add verbose response debugging |
| 81 | + modified = modified.replace( |
| 82 | + 'response = requests.post(self.token_endpoint, data=params, headers=headers)', |
| 83 | + 'response = requests.post(self.token_endpoint, data=params, headers=headers)\n print(f"Response status: {response.status_code}")\n print(f"Response headers: {dict(response.headers)}")\n print(f"Response body: {response.text}")' |
| 84 | + ) |
| 85 | + |
| 86 | + # Improve error handling |
| 87 | + modified = modified.replace( |
| 88 | + 'except RequestException as e:', |
| 89 | + 'except RequestException as e:\n if hasattr(e, "response") and e.response:\n print(f"Error response status: {e.response.status_code}")\n print(f"Error response headers: {dict(e.response.headers)}")\n print(f"Error response text: {e.response.text}")' |
| 90 | + ) |
| 91 | + |
| 92 | + with open('src/databricks/sql/auth/token_federation.py', 'w') as f: |
| 93 | + f.write(modified) |
| 94 | +
|
| 95 | + if __name__ == "__main__": |
| 96 | + patch_code() |
| 97 | + EOF |
| 98 | + |
| 99 | + chmod +x patch_for_debugging.py |
| 100 | + |
| 101 | + - name: Apply debugging patches to token_federation.py |
| 102 | + run: python patch_for_debugging.py |
| 103 | + |
65 | 104 | - name: Get GitHub OIDC token
|
66 | 105 | id: get-id-token
|
67 | 106 | uses: actions/github-script@v7
|
|
0 commit comments