Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow querying groups by UUID #1286

Merged
merged 1 commit into from
Jul 29, 2024
Merged

Conversation

kian99
Copy link
Contributor

@kian99 kian99 commented Jul 29, 2024

Description

This PR allows a user to reference JIMM groups by UUID much like we do for application-offers, models, controllers, etc.

Fixes CSS-9900

As a drive-by fix I noticed our group validation regex enforces group names to be at least 6 characters long. I've reduced that to 3.

Engineering checklist

Check only items that apply

  • Documentation updated
  • Covered by unit tests
  • Covered by integration tests

@kian99 kian99 requested a review from a team as a code owner July 29, 2024 07:54
@@ -12,7 +12,7 @@ const (
)

var (
validGroupName = regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9._-]{4,}[a-zA-Z0-9]$")
validGroupName = regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9._-]+[a-zA-Z0-9]$")
Copy link
Contributor

Choose a reason for hiding this comment

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

why did you change this? to comply with both uuid and name format?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, the description of the PR mentions the reason. It currently enforces that names must be 6 characters long - first group, second group 4 or more times, last group. The + makes the match "one or more" instead. So now the minimum length of a group name is 3.

@kian99 kian99 merged commit 3d50be2 into canonical:v3 Jul 29, 2024
3 checks passed
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.

3 participants