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] Add a possibility to specify partition key version for Hash partition key type #1921

Merged
merged 13 commits into from
May 22, 2024

Conversation

Agazoth
Copy link
Contributor

@Agazoth Agazoth commented May 13, 2024

Description

SQL database container defaults to 2 if omitted. This fixes that issue

Fixes #1852 (closed by accident)

Pipeline Reference

Pipeline
avm.res.document-db.database-account

Type of Change

  • 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

Checklist

  • I'm sure there are no other open Pull Requests for the same update/change
  • I have run Set-AVMModule locally to generate the supporting module files.
  • My corresponding pipelines / checks run clean and green without any errors or warnings

@Agazoth Agazoth requested review from a team as code owners May 13, 2024 13:29
@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Triage 🔍 Maintainers need to triage still Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue labels May 13, 2024
@matebarabas matebarabas changed the title fix: DocumentDB SQL version for Hash default is 2 fix: DocumentDB SQL version for Hash default is 2 - avm/res/document-db/database-account May 13, 2024
@matebarabas matebarabas added Class: Resource Module 📦 This is a resource module and removed Needs: Triage 🔍 Maintainers need to triage still labels May 13, 2024
@bryansan-msft
Copy link
Contributor

bryansan-msft commented May 17, 2024

@Agazoth I have multiple remarks here:

What is the issue you are having or is there a new feature you would like to use?
Were you trying to propose to make version 2 the new default?

PD: With your proposed changed I just realized I missed to delete Range from this allowed array. However, it is not worth to release a new version just for that.

@description('Optional. Default to Hash. Indicates the kind of algorithm used for partitioning.')
@allowed([
'Hash'
'MultiHash'
'Range'
])
param kind string = 'Hash'

@Agazoth
Copy link
Contributor Author

Agazoth commented May 17, 2024

@bryansan-msft thanks for your feedback!

I'm currently working on converting several deployments from using local modules/another module registry to AMV modules.

One of the larger deployments have a Cosmos DB, that has been deployed with a very basic setup, and it would not accept the current AVM module, because it had version 2 for Hash.

I see now, that this setting was actually requested by the original template author and you are probably right about keeping version on 1 (I wrongly assumed 2 would be the correct default).

I do however think, that it should be possible to change the version on hash, since there are 2 options. The setting cannot be changed after the resource is deployed, and we still need to flow version 2 to the deployment.

I would be glad to add the parameter to the module, if there is a branch I can append it to or I can create a new branch and pr. I could remove Ranged in the too :-)

@bryansan-msft
Copy link
Contributor

Well, then feel free to open a PR or modify this one to add an optional partition key version parameter for the UDT of SQL containers. Take into account the following:

  • The default version value of "Hash" partition key kind must remain 1.
  • This new parameter must be optional.
  • The version value of "MultiHash" partition key kind must always be 2.
  • Add tests in the SQL test suite for your changes.

@Agazoth
Copy link
Contributor Author

Agazoth commented May 21, 2024

Well, then feel free to open a PR or modify this one to add an optional partition key version parameter for the UDT of SQL containers. Take into account the following:

  • The default version value of "Hash" partition key kind must remain 1.
  • This new parameter must be optional.
  • The version value of "MultiHash" partition key kind must always be 2.
  • Add tests in the SQL test suite for your changes.

Done :-)

@bryansan-msft
Copy link
Contributor

Well, then feel free to open a PR or modify this one to add an optional partition key version parameter for the UDT of SQL containers. Take into account the following:

  • The default version value of "Hash" partition key kind must remain 1.
  • This new parameter must be optional.
  • The version value of "MultiHash" partition key kind must always be 2.
  • Add tests in the SQL test suite for your changes.

Done :-)

I will need you to resolve the conflict you are heaving in main.json

@Agazoth
Copy link
Contributor Author

Agazoth commented May 21, 2024

@bryansan-msft Alexander is pushing some punctuation updates to the file on the main branch. I merged his changes into my branch. It is updated now and good to go.

@AlexanderSehr
Copy link
Contributor

@bryansan-msft Alexander is pushing some punctuation updates to the file on the main branch. I merged his changes into my branch. It is updated now and good to go.

Sorry about that @Agazoth, we updated some tests as they were not correctly picking up nested properties to validate them - and with the fix we had to apply a couple small updates to a handful of modules.

@Agazoth
Copy link
Contributor Author

Agazoth commented May 22, 2024

@bryansan-msft Alexander is pushing some punctuation updates to the file on the main branch. I merged his changes into my branch. It is updated now and good to go.

Sorry about that @Agazoth, we updated some tests as they were not correctly picking up nested properties to validate them - and with the fix we had to apply a couple small updates to a handful of modules.

No problem @AlexanderSehr , we'll just catch the next run 😊

@bryansan-msft bryansan-msft changed the title fix: DocumentDB SQL version for Hash default is 2 - avm/res/document-db/database-account [Feature Request] Add a possibility to specify partition key version for Hash partition key type May 22, 2024
@bryansan-msft bryansan-msft merged commit da17f0d into Azure:main May 22, 2024
5 of 6 checks passed
hundredacres pushed a commit to hundredacres/bicep-registry-modules that referenced this pull request Jun 19, 2024
…for Hash partition key type (Azure#1921)

## Description

SQL database container defaults to 2 if omitted. This fixes that issue

Fixes Azure#1852 (closed by accident)


## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |

|[![avm.res.document-db.database-account](https://github.com/Agazoth/bicep-registry-modules/actions/workflows/avm.res.document-db.database-account.yml/badge.svg?branch=DocumentDBDefaultForHash)](https://github.com/Agazoth/bicep-registry-modules/actions/workflows/avm.res.document-db.database-account.yml)|

## Type of Change

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

- [ ] Update to CI Environment or utlities (Non-module effecting
changes)
- [ ] Azure Verified Module updates:
- [x] 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

## Checklist

- [x] I'm sure there are no other open Pull Requests for the same
update/change
- [x] I have run `Set-AVMModule` locally to generate the supporting
module files.
- [x] My corresponding pipelines / checks run clean and green without
any errors or warnings

<!-- Please keep up to day with the contribution guide at
https://aka.ms/avm/contribute/bicep -->

---------

Co-authored-by: Bryan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Class: Resource Module 📦 This is a resource module Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants