Skip to content

Introduce new bundle variable: ${workspace.current_user.domain_friendly_name} - #3623

Merged
anton-107 merged 8 commits into
mainfrom
anton-107/user-dns-name
Sep 22, 2025
Merged

Introduce new bundle variable: ${workspace.current_user.domain_friendly_name}#3623
anton-107 merged 8 commits into
mainfrom
anton-107/user-dns-name

Conversation

@anton-107

@anton-107anton-107 commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

Why

${workspace.current_user.domain_friendly_name} will allow bundle authors to prefix apps and database instances resources with caller's usernames (useful for development targets). Currently short_name does not always fit this purpose because it can contain characters that apps / database instances do not allow in the names of resources.

Tests

  • Existing tests
  • New unit test with transformation examples
  • Manual check that domain_friendly_name can be used as a bundle variable

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Sep 17, 2025

Copy link
Copy Markdown
Collaborator

Run: 17862412471

Env✅​pass🙈​skip
✅​aws linux311528
✅​aws windows312527
✅​aws-ucws linux423426
✅​aws-ucws windows424425
✅​azure linux311527
✅​azure windows312526
✅​azure-ucws linux423425
✅​azure-ucws windows424424
✅​gcp linux310529
✅​gcp windows311528

anton-107 added a commit that referenced this pull request Sep 18, 2025
…/textutil` (#3621)
## Why
<!-- Why are these changes needed? Provide the context that the reviewer
might be missing.
For example, were there any decisions behind the change that are not
reflected in the code itself? -->
- Text transformation logic can be useful outside the domain of working
with tags
- I am currently planning to re-use it for populating a dns-friendly
short user name in a following PR:
#3623
## Tests
<!-- How have you tested the changes? -->
Existing tests
<!-- If your PR needs to be included in the release notes for next
release,
add a separate entry in NEXT_CHANGELOG.md as part of your PR. -->
Base automatically changed from anton-107/textutil-transform to mainSeptember 18, 2025 09:00
@anton-107
anton-107force-pushed the anton-107/user-dns-name branch from 6af25b7 to 67c402bCompareSeptember 18, 2025 09:09
@anton-107anton-107 changed the title introduce a ${workspace.current_user.dns_name} bundle variableIntroduce new bundle variable: ${workspace.current_user.dns_name}Sep 18, 2025
@anton-107
anton-107 marked this pull request as ready for review September 18, 2025 09:25
Comment threadlibs/iamutil/user.go Outdated
@anton-107
anton-107force-pushed the anton-107/user-dns-name branch from 0013ca1 to 9cea6d4CompareSeptember 19, 2025 15:15
@anton-107anton-107 changed the title Introduce new bundle variable: ${workspace.current_user.dns_name}Introduce new bundle variable: ${workspace.current_user.domain_friendly_name}Sep 19, 2025
Comment threadacceptance/bundle/validate/job-references/output.txt
@denik
denik self-requested a review September 22, 2025 11:10
@anton-107
anton-107 merged commit c5dd3dd into mainSep 22, 2025
13 checks passed
@anton-107
anton-107 deleted the anton-107/user-dns-name branch September 22, 2025 11:17

@pieternpietern left a comment

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.

FYI the PR summary still mentions dns_name.

@@ -1,4 +1,4 @@
Local = true
Local = false

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.

What happened here?


// A short name for the user that is stripped off of non-alphanumeric character
// Can be used as a prefix for resources that use their name as part of their URL (e.g. Apps, Database Instances)
DomainFriendlyName string `json:"domain_friendly_name,omitempty" bundle:"readonly"`

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.

A short name for the user that is stripped off of non-alphanumeric characters.

Can also mention dashes instead of underscores.

Comment threadlibs/iamutil/user.go
// GetShortUserDomainFriendlyName returns a dns-friendly for of the user name based on short name
// We replace all non-alphanumeric characters with a dash (following Databricks Apps' naming requirements)
func GetShortUserDomainFriendlyName(user *iam.User) string {
name := GetShortUserName(user)

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 double normalization. This function already calls NormalizeString.

Doesn't below have the same effect, aside from also normalizing "é" into "e"?

deco-sdk-taggingBot added a commit that referenced this pull request Sep 24, 2025
## Release v0.270.0
### Notable Changes
* Add 'databricks bundle plan' command. This command shows the deployment plan for the current bundle configuration without making any changes. ([#3530](#3530))
### Bundles
* Add 'databricks bundle plan' command ([#3530](#3530))
* Add new Lakeflow Pipelines support for bundle generate ([#3568](#3568))
* Fix bundle deploy to not update permissions or grants for unbound resources ([#3642](#3642))
* Introduce new bundle variable: `${workspace.current_user.domain_friendly_name}` ([#3623](#3623))
* Improve the output of bundle run when bundle is not deployed ([#3652](#3652))
denik pushed a commit that referenced this pull request May 20, 2026
…/textutil` (#3621)
## Why
<!-- Why are these changes needed? Provide the context that the reviewer
might be missing.
For example, were there any decisions behind the change that are not
reflected in the code itself? -->
- Text transformation logic can be useful outside the domain of working
with tags
- I am currently planning to re-use it for populating a dns-friendly
short user name in a following PR:
#3623
## Tests
<!-- How have you tested the changes? -->
Existing tests
<!-- If your PR needs to be included in the release notes for next
release,
add a separate entry in NEXT_CHANGELOG.md as part of your PR. -->
denik pushed a commit that referenced this pull request May 20, 2026
…dly_name}` (#3623)
## Why
<!-- Why are these changes needed? Provide the context that the reviewer
might be missing.
For example, were there any decisions behind the change that are not
reflected in the code itself? -->
`${workspace.current_user.dns_name}` will allow bundle authors to prefix
apps and database instances resources with caller's usernames (useful
for development targets). Currently `short_name` does not always fit
this purpose because it can contain characters that apps / database
instances do not allow in the names of resources.
## Tests
<!-- How have you tested the changes? -->
- Existing tests
- New unit test with transformation examples
- Manual check that `dns_name` can be used as a bundle variable
<!-- If your PR needs to be included in the release notes for next
release,
add a separate entry in NEXT_CHANGELOG.md as part of your PR. -->
denik pushed a commit that referenced this pull request May 20, 2026
## Release v0.270.0
### Notable Changes
* Add 'databricks bundle plan' command. This command shows the deployment plan for the current bundle configuration without making any changes. ([#3530](#3530))
### Bundles
* Add 'databricks bundle plan' command ([#3530](#3530))
* Add new Lakeflow Pipelines support for bundle generate ([#3568](#3568))
* Fix bundle deploy to not update permissions or grants for unbound resources ([#3642](#3642))
* Introduce new bundle variable: `${workspace.current_user.domain_friendly_name}` ([#3623](#3623))
* Improve the output of bundle run when bundle is not deployed ([#3652](#3652))
Sign up for freeto 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

@anton-107@eng-dev-ecosystem-bot@pietern@denik