Skip to content

fix(mongodbflex): add regex to username validation#1603

Open
j1n-o9r wants to merge 2 commits into
mainfrom
fix/STACKITTPR-679-mongodbflex-username-validation
Open

fix(mongodbflex): add regex to username validation#1603
j1n-o9r wants to merge 2 commits into
mainfrom
fix/STACKITTPR-679-mongodbflex-username-validation

Conversation

@j1n-o9r

@j1n-o9r j1n-o9r commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Description

See #683 for details.

relates to STACKITTPR-679.

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see examples/ directory)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Acceptance tests got implemented or updated (see e.g. here)
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

@j1n-o9r
j1n-o9r marked this pull request as ready for review July 22, 2026 12:54
@j1n-o9r
j1n-o9r requested a review from a team as a code owner July 22, 2026 12:54
@j1n-o9r
j1n-o9r enabled auto-merge (squash) July 22, 2026 12:54

func configResources(version, backupSchedule, snapshotRetentionDays string) string {
var userResourceInvalidName = map[string]string{
"username": "-invalid-user-name",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can be unit-tested, no need to have this in an acceptance test.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See e.g.

resource.UnitTest(t, resource.TestCase{

@j1n-o9r
j1n-o9r force-pushed the fix/STACKITTPR-679-mongodbflex-username-validation branch 2 times, most recently from 2e48ebc to 4b3d235 Compare July 22, 2026 14:29
@j1n-o9r
j1n-o9r requested a review from rubenhoenle July 22, 2026 15:18
@j1n-o9r
j1n-o9r force-pushed the fix/STACKITTPR-679-mongodbflex-username-validation branch from 4b3d235 to 59144dd Compare July 22, 2026 16:22
@github-actions

Copy link
Copy Markdown

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/mongodbflex 0.00% (ø)
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/mongodbflex/user 26.88% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/mongodbflex/user/resource.go 24.70% (ø) 251 62 189

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/mongodbflex/mongodbflex_test.go

instanceId := uuid.NewString()
tfConfig := fmt.Sprintf(`
provider "stackit" {
mongodbflex_custom_endpoint = "http://localhost:12345"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is that custom endpoint needed?

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.

2 participants