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

[Feature Request]: Define a culture to use when sorting objects #3722

Open
MariusStorhaug opened this issue Aug 26, 2023 · 5 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@MariusStorhaug
Copy link
Contributor

MariusStorhaug commented Aug 26, 2023

Description

Add -Culture 'en-US' to all Sort-Object calls, so that sorting does not depend on the environment and culture of the one running the readme gen scripts.

From #3665
image

Seems this pipeline recently failed due to sorting issues.

@MariusStorhaug MariusStorhaug added the enhancement New feature or request label Aug 26, 2023
@MariusStorhaug
Copy link
Contributor Author

MariusStorhaug commented Aug 26, 2023

Can be done multiple ways...

@MariusStorhaug
Copy link
Contributor Author

MariusStorhaug commented Aug 26, 2023

Alternative 1:

Be sure to always include the following when Sort-Object is used.

Sort-Object (...) -Culture 'en-US'

@MariusStorhaug
Copy link
Contributor Author

MariusStorhaug commented Aug 26, 2023

Alternative 2
If we add the following block on scripts, it would not be something that we would need to think about for new usage of Sort-Object.

$PSDefaultParameterValues = @{
  'Sort-Object:Culture'='en-US'
}

@AlexanderSehr
Copy link
Contributor

Hey @MariusStorhaug, good call. I haven't seen this issue in quite some time actually. However, if it still exists (and from what you said I take it that's the case), I agree that we should do something about it.

That said, I guess Alternative 2 seems to be the safer option - though I have to admit I haven't seen such an implementation anywhere yet.

@MariusStorhaug
Copy link
Contributor Author

@AlexanderSehr AlexanderSehr added this to the Azure Verfified Modules (AVM) - CI Issues milestone May 19, 2024
@AlexanderSehr AlexanderSehr self-assigned this May 19, 2024
@AlexanderSehr AlexanderSehr added bug Something isn't working and removed enhancement New feature or request labels May 19, 2024
AlexanderSehr added a commit to Azure/bicep-registry-modules that referenced this issue May 20, 2024
## Description

- Added `-Culture 'en-US'` to all `Sort-Object` operations to mitigate
issues some contributors with a different configured culture have
- Re-ran the generation for all files (no changes)

Related to Azure/ResourceModules#3722, but
needs to be fixed there seperately

## Type of Change

<!-- Use the check-boxes [x] on the options that are relevant. -->

- [x] Update to CI Environment or utlities (Non-module effecting
changes)
- [ ] Azure Verified Module updates:
- [ ] Bugfix containing backwards compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [ ] Someone has opened a bug report issue, and I have included "Closes
#{bug_report_issue_number}" in the PR description.
- [ ] The bug was found by the module author, and no one has opened an
issue to report it yet.
- [ ] Feature update backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [ ] Breaking changes and I have bumped the MAJOR version in
`version.json`.
  - [ ] Update to documentation

---------

Co-authored-by: Erika Gressi <[email protected]>
hundredacres pushed a commit to hundredacres/bicep-registry-modules that referenced this issue Jun 19, 2024
…1976)

## Description

- Added `-Culture 'en-US'` to all `Sort-Object` operations to mitigate
issues some contributors with a different configured culture have
- Re-ran the generation for all files (no changes)

Related to Azure/ResourceModules#3722, but
needs to be fixed there seperately

## Type of Change

<!-- Use the check-boxes [x] on the options that are relevant. -->

- [x] Update to CI Environment or utlities (Non-module effecting
changes)
- [ ] Azure Verified Module updates:
- [ ] Bugfix containing backwards compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [ ] Someone has opened a bug report issue, and I have included "Closes
#{bug_report_issue_number}" in the PR description.
- [ ] The bug was found by the module author, and no one has opened an
issue to report it yet.
- [ ] Feature update backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [ ] Breaking changes and I have bumped the MAJOR version in
`version.json`.
  - [ ] Update to documentation

---------

Co-authored-by: Erika Gressi <[email protected]>
@AlexanderSehr AlexanderSehr removed this from the Azure Verfified Modules (AVM) - CI Issues milestone Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: To do
Status: Needs triage
Development

No branches or pull requests

2 participants