Skip to content

internal: Add support for 'sensitive' JSON tag for bundle config fields#5896

Merged
andrewnester merged 14 commits into
mainfrom
feat/sensitive-fields
Jul 22, 2026
Merged

internal: Add support for 'sensitive' JSON tag for bundle config fields#5896
andrewnester merged 14 commits into
mainfrom
feat/sensitive-fields

Conversation

@andrewnester

Copy link
Copy Markdown
Contributor

Changes

Add support for 'sensitive' JSON tag for bundle config fields

Why

This allows us to mark certain fields (for example, secrets.value) as sensitive and let CLI handle masking it in command outputs.

Used in #5861

Tests

Added unit tests. Will be tests end to end with unit tests with UC secrets

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 49ea5f6

Run: 29924738401

Env 🟨​KNOWN 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 4 4 314 1057 12:59
💚​ aws windows 4 4 316 1055 6:15
🔄​ azure linux 1 4 4 313 1056 13:41
💚​ azure windows 4 4 316 1054 6:48
🟨​ gcp linux 3 1 4 313 1058 11:34
🟨​ gcp windows 3 1 4 315 1056 10:09
9 interesting tests: 4 SKIP, 3 KNOWN, 1 RECOVERED, 1 flaky
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🔄​ TestSyncIncrementalFileOverwritesFolder ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p
🟨​ TestFetchRepositoryInfoAPI_FromRepo 💚​R 💚​R 💚​R 💚​R 🟨​K 🟨​K
🟨​ TestFetchRepositoryInfoAPI_FromRepo/root 💚​R 💚​R 💚​R 💚​R 🟨​K 🟨​K
🟨​ TestFetchRepositoryInfoAPI_FromRepo/subdir 💚​R 💚​R 💚​R 💚​R 🟨​K 🟨​K
Top 8 slowest tests (at least 2 minutes):
duration env testname
3:31 gcp windows TestAccept
3:26 azure windows TestAccept
3:22 aws windows TestAccept
2:23 aws linux TestFilerRecursiveDelete/workspace_files
2:23 aws linux TestLock
2:21 azure windows TestFilerWorkspaceFilesExtensionsReadDir
2:11 aws linux TestFilerWorkspaceFilesExtensionsReadDir
2:09 gcp linux TestAccept/bundle/deploy/mlops-stacks/DATABRICKS_BUNDLE_ENGINE=direct

Comment thread bundle/config/mask.go Outdated
Comment thread bundle/config/mask.go Outdated
Comment thread cmd/bundle/validate.go Outdated
Comment thread libs/dyn/convert/struct_info.go
Comment thread libs/dyn/convert/struct_info.go Outdated
}
return si.Sensitive
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a few unit tests here in dyn/convert that demonstrates that this works in cases with embedded structs, anonymous structs, etc. Would also be good to include a user of these fields in the same package.

Comment thread cmd/bundle/validate.go Outdated
Comment thread bundle/config/mask_test.go Outdated
Comment thread bundle/config/validate/no_reference_to_sensitive_fields.go Outdated
Comment thread libs/dyn/yamlsaver/saver.go Outdated
Comment thread libs/dyn/value.go Outdated
Comment thread libs/dyn/convert/from_typed.go
@andrewnester
andrewnester requested a review from pietern July 15, 2026 15:32
Comment thread libs/dyn/convert/from_typed.go Outdated
Comment thread libs/dyn/convert/from_typed_test.go
case dyn.KindString:
// Preserve sensitive strings: NewValue would strip the secretString wrapper.
if src.IsSensitive() {
return src, nil

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means it is not possible to update the secret value in the typed tree.

If expected, please include this expectation in the comment.

@andrewnester
andrewnester enabled auto-merge July 22, 2026 12:24
@andrewnester
andrewnester added this pull request to the merge queue Jul 22, 2026
Merged via the queue into main with commit 40ee185 Jul 22, 2026
23 checks passed
@andrewnester
andrewnester deleted the feat/sensitive-fields branch July 22, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants