Skip to content

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

Merged
anton-107 merged 8 commits intomainfrom
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 intomainfrom
anton-107/user-dns-name

Conversation

@anton-107
Copy link
Copy Markdown
Contributor

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

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
Copy link
Copy Markdown
Collaborator

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

Run: 17862412471

Env ✅​pass 🙈​skip
✅​ aws linux 311 528
✅​ aws windows 312 527
✅​ aws-ucws linux 423 426
✅​ aws-ucws windows 424 425
✅​ azure linux 311 527
✅​ azure windows 312 526
✅​ azure-ucws linux 423 425
✅​ azure-ucws windows 424 424
✅​ gcp linux 310 529
✅​ gcp windows 311 528

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 main September 18, 2025 09:00
@anton-107 anton-107 force-pushed the anton-107/user-dns-name branch from 6af25b7 to 67c402b Compare September 18, 2025 09:09
@anton-107 anton-107 changed the title introduce a ${workspace.current_user.dns_name} bundle variable Introduce 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
@anton-107 anton-107 force-pushed the anton-107/user-dns-name branch from 0013ca1 to 9cea6d4 Compare September 19, 2025 15:15
@anton-107 anton-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
@denik denik self-requested a review September 22, 2025 11:10
@anton-107 anton-107 merged commit c5dd3dd into main Sep 22, 2025
13 checks passed
@anton-107 anton-107 deleted the anton-107/user-dns-name branch September 22, 2025 11:17
Copy link
Copy Markdown
Contributor

@pietern pietern left a comment

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.

// 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-tagging bot 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))
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