Skip to content

Strip credentials from origin URL in deploy telemetry - #7331

Draft
pietern wants to merge 1 commit into
mainfrom
pietern/f01-6842-telemetry-origin-url
Draft

pietern wants to merge 1 commit into
mainfrom
pietern/f01-6842-telemetry-origin-url

Conversation

@pietern

@pietern pietern commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Changes

Strip credentials from the git origin URL before it goes into deploy telemetry. bundleGitInfo assumed the URL was already stripped, but only the local .git route does that; a URL from bundle.git.origin_url or the workspace API went through as written. The stripping in Repository.OriginUrl() moves into git.StripURLCredentials, which telemetry now uses too.

DMS and deploy metadata still receive the value as written; left for a follow-up.

Why

#6842 added the origin URL to deploy telemetry, assuming its credentials were already stripped.

Tests

  • TestStripURLCredentials in libs/git and a wiring test in bundle/phases.
  • New acceptance test bundle/telemetry/deploy-git-origin-url-credentials shows the token stripped.

This pull request and its description were written by Isaac.

@github-actions github-actions Bot added the DABs DABs related issues label Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Commit: 35adebc02 | Workflow run

Regression test report

Selected 1 changed tests (limit=20, 0 not selected)

1 tests: regression=1 unreleased=0 coverage=0 failing=0
test branch main (5bda5d4) latest (v1.23.0)
TestAccept/bundle/telemetry/deploy-git-origin-url-credentials/DMS= ✅ ❌ ❌
TestAccept/bundle/telemetry/deploy-git-origin-url-credentials/DMS=: branch ✅ | main (5bda5d4) ❌ | latest (v1.23.0) ❌

main (5bda5d4):

acceptance_test.go:1342: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1342
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1083
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:660
        	Error:      	Not equal: 
        	            	expected: "\n>>> [CLI] bundle deploy\nUploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...\nFiles: 1 uploaded, 0 deleted\nResources: 0 created, 0 changed, 0 deleted, 0 unchanged\n\n>>> cat [OUTPUT_DIR]/out.requests.txt\n{\n  \"git\": {\n    \"origin_url\": \"https://github.com/databricks/cli\"\n  }\n}\n"
        	            	actual  : "\n>>> [CLI] bundle deploy\nUploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...\nFiles: 1 uploaded, 0 deleted\nResources: 0 created, 0 changed, 0 deleted, 0 unchanged\n\n>>> cat [OUTPUT_DIR]/out.requests.txt\n{\n  \"git\": {\n    \"origin_url\": \"https://user:token@github.com/databricks/cli\"\n  }\n}\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -9,3 +9,3 @@
        	            	   "git": {
        	            	-    "origin_url": "https://github.com/databricks/cli"
        	            	+    "origin_url": "https://user:token@github.com/databricks/cli"
        	            	   }
        	Test:       	TestAccept/bundle/telemetry/deploy-git-origin-url-credentials/DMS=
        	Messages:   	bundle/telemetry/deploy-git-origin-url-credentials/output.txt vs /tmp/TestAcceptbundletelemetrydeploy-git-origin-url-credentialsDM3261421084/002/output.txt
FAIL

latest (v1.23.0):

acceptance_test.go:1342: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1342
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1083
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:660
        	Error:      	Not equal: 
        	            	expected: "\n>>> [CLI] bundle deploy\nUploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...\nFiles: 1 uploaded, 0 deleted\nResources: 0 created, 0 changed, 0 deleted, 0 unchanged\n\n>>> cat [OUTPUT_DIR]/out.requests.txt\n{\n  \"git\": {\n    \"origin_url\": \"https://github.com/databricks/cli\"\n  }\n}\n"
        	            	actual  : "\n>>> [CLI] bundle deploy\nUploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...\nFiles: 1 uploaded, 0 deleted\nResources: 0 created, 0 changed, 0 deleted, 0 unchanged\n\n>>> cat [OUTPUT_DIR]/out.requests.txt\n{\n  \"git\": null\n}\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -8,5 +8,3 @@
        	            	 {
        	            	-  "git": {
        	            	-    "origin_url": "https://github.com/databricks/cli"
        	            	-  }
        	            	+  "git": null
        	            	 }
        	Test:       	TestAccept/bundle/telemetry/deploy-git-origin-url-credentials/DMS=
        	Messages:   	bundle/telemetry/deploy-git-origin-url-credentials/output.txt vs /tmp/TestAcceptbundletelemetrydeploy-git-origin-url-credentialsDM3678701501/002/output.txt
FAIL

Comment thread libs/localenv/uv.go Resolved
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 35adebc

Run: 41829396628

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 271 16 4:16
✅​ aws-windows-latest-4core-16gb 273 14 3:46
✅​ azure linux-2core-8gb 270 16 4:23
✅​ azure-windows-latest-4core-16gb 272 14 3:34
✅​ gcp linux-2core-8gb 271 16 5:14
✅​ gcp-windows-latest-4core-16gb 273 14 4:00
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:40 aws-windows-latest-4core-16gb TestAccept
3:28 azure-windows-latest-4core-16gb TestAccept
3:14 gcp-windows-latest-4core-16gb TestAccept

bundleGitInfo assumed load_git_details had already stripped userinfo from
bundle.git.origin_url, but that only happens on the local .git route. A URL
set in databricks.yml, or returned by the workspace API for a Git folder,
was sent to telemetry as written, including any embedded token.

Strip userinfo when building the telemetry git info so every route is
covered. Extract the stripping from Repository.OriginUrl into
git.StripURLCredentials and use it for telemetry too.

Co-authored-by: Isaac <no-reply@databricks.com>
@pietern
pietern force-pushed the pietern/f01-6842-telemetry-origin-url branch from e28ea52 to 35adebc Compare November 4, 2026 12:26

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DABs DABs related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants