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

Support locale in consumption budgets #23509

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

stawik-mesa
Copy link

Resolves #22025

@stawik-mesa stawik-mesa marked this pull request as ready for review October 12, 2023 10:48
Copy link
Member

@manicminer manicminer left a comment

Choose a reason for hiding this comment

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

@stawik-mesa Thanks for opening this PR! This is mostly looking good, but we'll want to ensure that we have test coverage for this property for each of the updated resources. These can be added to the "complete" test config where one exists, or a test config where this block is already specified. Additionally, new optional properties in most cases require a default value to be specified in the schema, so that we don't incorrectly send blank values.

If you can look at adding these, I'll review again and run the tests and we should be in a good position to merge this. Please feel free to reach out if you'd like some additional pointers. Thanks!

internal/services/consumption/consumption_budget_base.go Outdated Show resolved Hide resolved
Comment on lines 80 to 84
"locale": {
Type: pluginsdk.TypeString,
Optional: true,
ValidateFunc: validation.StringInSlice(budgets.PossibleValuesForCultureCode(), false),
},
Copy link
Member

Choose a reason for hiding this comment

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

As above we will probably need a default value here.

Co-authored-by: Tom Bamford <tom@bamford.io>
@stawik-mesa
Copy link
Author

@manicminer Thank you for the reviews.

If the default value is used, a GET request doesn't have the property so its absent.
And if you want to use the default the POST must not have the property either.
How should we proceed here?

@manicminer
Copy link
Member

@stawik-mesa Sorry for the delay in replying, I've commented inline (above) regarding the default value.

Co-authored-by: Tom Harvey <tombuildsstuff@users.noreply.github.com>
@stawik-mesa
Copy link
Author

@manicminer @tombuildsstuff Seems legit to make it computed. I have added it now. Is there anything else missing from my side?
Can we merge it?

Copy link

This PR is being labeled as "stale" because it has not been updated for 30 or more days.

If this PR is still valid, please remove the "stale" label. If this PR is blocked, please add it to the "Blocked" milestone.

If you need some help completing this PR, please leave a comment letting us know. Thank you!

@github-actions github-actions bot added the stale label Mar 18, 2024
@stawik-mesa
Copy link
Author

Can someone please take a look? @manicminer @tombuildsstuff ?
Thank you and best regards

@AndreasAugustin
Copy link

Hi @stawik-mesa @manicminer @tombuildsstuff .
This PR will also close #25619

@ajmms

This comment was marked as off-topic.

@stawik-mesa
Copy link
Author

Hi @manicminer & @tombuildsstuff any change to get this merged?

Best regards
Lukas

@katbyte
Copy link
Collaborator

katbyte commented Jun 21, 2024

Hey @stawik-mesa - i was looking at this today and while the PR looks good it appears the test are all failing now with:

unexpected status 400 (400 Bad Request) with error: 400: Unsupported locale parameter . Try en-us to set language as English for the alerts or visit https://go.microsoft.com/fwlink/?linkid=2139450 to see all supported locales

should we be using en-us instead of en-US?

@stawik-mesa
Copy link
Author

Hey @stawik-mesa - i was looking at this today and while the PR looks good it appears the test are all failing now with:

unexpected status 400 (400 Bad Request) with error: 400: Unsupported locale parameter . Try en-us to set language as English for the alerts or visit https://go.microsoft.com/fwlink/?linkid=2139450 to see all supported locales

should we be using en-us instead of en-US?

Hi @katbyte, I have changed it to en-us. Can you please run the workflows again to check if all issues are resolved now?

Thank you ;)

@katbyte
Copy link
Collaborator

katbyte commented Jun 26, 2024

That does not appear to fix it :(

Budget Name: "acctestconsumptionbudgetsubscription-240626154625703496"): unexpected status 400 (400 Bad Request) with error: 400: Unsupported locale parameter . Try en-us to set language as English for the alerts or visit https://go.microsoft.com/fwlink/?linkid=2139450 to see all supported locales.

@AndreasAugustin
Copy link

That does not appear to fix it :(

Budget Name: "acctestconsumptionbudgetsubscription-240626154625703496"): unexpected status 400 (400 Bad Request) with error: 400: Unsupported locale parameter . Try en-us to set language as English for the alerts or visit https://go.microsoft.com/fwlink/?linkid=2139450 to see all supported locales.

@stawik-mesa possibly forgotten to adjust within internal/services/consumption/consumption_budget_resource_group_resource_test.go

@stawik-mesa
Copy link
Author

@AndreasAugustin @katbyte Can you check again. hopefully it's fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants