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

feat: Added diverse specs for User-defined types #1738

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

Conversation

AlexanderSehr
Copy link
Contributor

@AlexanderSehr AlexanderSehr commented Nov 27, 2024

Description

New structure-aligned version of #1711

Added diverse specs for User-defined types:

  • BCPNFR9 - Category: Inputs - Decorators
  • BCPNFR18 - Category: User-defined types - Specification
  • BCPNFR19 - Category: User-defined types - Naming
  • BCPNFR20 - Category: User-defined types - Export
  • BCPNFR21 - Category: User-defined types - Decorators
  • BCPRMNFR2 - Category: User-defined types - AVM-Common-Types

@AlexanderSehr
Copy link
Contributor Author

Dependend on #1737

@AlexanderSehr AlexanderSehr requested a review from eriqua November 28, 2024 20:26
@@ -20,7 +20,7 @@ tags: [
priority: 11010
---

#### ID: BCPNFR1 - Category: Inputs - Data Types
#### ID: BCPNFR1 - Category: Inputs - User-defined types - General
Copy link
Contributor

@matebarabas matebarabas Dec 2, 2024

Choose a reason for hiding this comment

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

@AlexanderSehr, I know this is not here to be reviewed yet, but I want to add an important comment: be aware that if you change this title, it will start breaking legacy links that are still pointing to the specs present on the old shared and Bicep/TF specific pages. This is unavoidable, and I'm not saying you shouldn't rename an article if the name is off, but you need to be aware of this side effect.

Copy link
Contributor Author

@AlexanderSehr AlexanderSehr Dec 2, 2024

Choose a reason for hiding this comment

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

Hey @matebarabas,
thanks for the comment. 💪 The spec is actually absolutely here to be reviewed - but - is unfortunately dependent on this PR which is pending a review by @eriqua :)
In any case, you have a point - yet I'd argue the title should be changed to make more sense in the context of the other specs (which are about specific topics in the space of UDTs).
Also, sure this could break references (if they happen to exist), but personally I am strongly against prioritizing backward compatibility over usability/correctness. Just to explain the angle I'm coming from 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So... can this comment be resolved, @matebarabas?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can any applicable link be updated via search and replace?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can any applicable link be updated via search and replace?

No, as the ones I was referring to are auto-generated based on the title. I agree to Alex's comment on not prioritizing backward compatibility if we feel something is just simply off. Feel free to resolve this.

So... can this comment be resolved, @matebarabas?

Yes please, that's what I was hoping to express by sending a thumb-up on your comment. :) I knew I should've been more explicit. :)

@AlexanderSehr AlexanderSehr marked this pull request as ready for review December 11, 2024 22:19
@AlexanderSehr AlexanderSehr enabled auto-merge (squash) December 11, 2024 22:19
@AlexanderSehr
Copy link
Contributor Author

Ready to go @eriqua :)

tags: [
Class-Resource, # MULTIPLE VALUES: this can be "Class-Resource" AND/OR "Class-Pattern" AND/OR "Class-Utility"
Type-NonFunctional, # SINGLE VALUE: this can be "Type-Functional" OR "Type-NonFunctional"
Category-Inputs/Outputs, # SINGLE VALUE: this can be "Category-Testing" OR "Category-Telemetry" OR "Category-Contribution/Support" OR "Category-Documentation" OR "Category-CodeStyle" OR "Category-Naming/Composition" OR "Category-Inputs/Outputs" OR "Category-Release/Publishing" Language-Bicep, # MULTIPLE VALUES: this can be "Language-Bicep" AND/OR "Language-Terraform"
Copy link
Contributor

Choose a reason for hiding this comment

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

Language-bicep tag looks commented out, please check

Persona-Owner, # MULTIPLE VALUES: this can be "Persona-Owner" AND/OR "Persona-Contributor"
Persona-Contributor, # MULTIPLE VALUES: this can be "Persona-Owner" AND/OR "Persona-Contributor"
Lifecycle-BAU, # SINGLE VALUE: this can be "Lifecycle-Initial" OR "Lifecycle-BAU" OR "Lifecycle-EOL"
Validation-TBD # SINGLE VALUE: this can be "Validation-Manual" OR "Validation-CI/Informational" OR "CI/Enforced"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use the right value for new specs? AFAIK the intention going forward is to assign the tacmg based on the current static validation situation, and update it every time we update static validation in BRM.
E.g., currently it should be Validation-Manual, since we don't have a static test. Once we add it, it should be updated to Validation-CI/Informational (if soft failure) or Enforced (if required)

Suggested change
Validation-TBD # SINGLE VALUE: this can be "Validation-Manual" OR "Validation-CI/Informational" OR "CI/Enforced"
Validation-Manual # SINGLE VALUE: this can be "Validation-Manual" OR "Validation-CI/Informational" OR "CI/Enforced"

Copy link
Contributor

Choose a reason for hiding this comment

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

This applies to all specs below

@@ -1,5 +1,5 @@
---
title: BCPNFR1 - Data Types
title: BCPNFR1 - User-defined types - General
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this one should temporarily be a SHOULD and not a MUST

param subnets subnetsType
type subnetsType = { ... }[]?
```
the type should instead be defined like
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
the type should instead be defined like
the type should be defined like


#### ID: BCPNFR21 - Category: User-defined types - Decorators

Similar to [BCPNFR9](#id-bcpnfr9---category-inputs---decorators), User-defined types MUST implement certain [decorators](https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/parameters#use-decorators), while they SHOULD others.
Copy link
Contributor

Choose a reason for hiding this comment

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

Not very clear. I'd suggest to divide into 2 paragraphs, covering the MUST and the SHOULD part


#### ID: BCPNFR9 - Category: Inputs - Decorators

Input parameters MUST make use of certain [decorators](https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/parameters#use-decorators), while they SHOULD make use of others whenever possible.
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment of the related for UDT

Decorators that SHOULD be implemented include but are not limited to `allowed`, `minValue`, `maxValue`, `minLength` & `maxLength` as they have a big impact on the module's usability.

```bicep
@desciption('My type''s description.')
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
@desciption('My type''s description.')
@description('My type''s description.')

Class-Resource, # MULTIPLE VALUES: this can be "Class-Resource" AND/OR "Class-Pattern" AND/OR "Class-Utility"
Class-Pattern, # MULTIPLE VALUES: this can be "Class-Resource" AND/OR "Class-Pattern" AND/OR "Class-Utility"
Type-NonFunctional, # SINGLE VALUE: this can be "Type-Functional" OR "Type-NonFunctional"
Category-Inputs/Outputs, # SINGLE VALUE: this can be "Category-Testing" OR "Category-Telemetry" OR "Category-Contribution/Support" OR "Category-Documentation" OR "Category-CodeStyle" OR "Category-Naming/Composition" OR "Category-Inputs/Outputs" OR "Category-Release/Publishing"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm getting confused between the title and this label. Should we add a label Category-UserDefinedTypes? Or are all falling into the Inputs/Outputs label?

Copy link
Contributor

Choose a reason for hiding this comment

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

@eriqua, this is used to control under which section of the specs page in question (e.g. bicep res page) the given spec will show up. Introducing anything new would require the shortcode and the page structure to be updated, so I strongly recommend trying to categorize what we need under one of the existing categories. These could work imho:

  • inputs/outputs
  • naming/composition (because of the latter)
  • codestyle

Copy link
Contributor

@eriqua eriqua Dec 12, 2024

Choose a reason for hiding this comment

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

Then I'm not sure of how useful categories are and I'm afraid we're locking ourselves into a process we ourselves enforced. Don't get me wrong but we are saying that adding a new label would be too complex and we prefer to enforce a different, not ideal one instead to overcome that complexity.
The fact that 3 different categories may apply for a single-valued label makes me wonder if we shouldn't rethink the category static approach. Looking forward to brainstorming that

Copy link
Contributor Author

@AlexanderSehr AlexanderSehr Dec 12, 2024

Choose a reason for hiding this comment

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

I think I tried to write it in a way that at least one of the specs shows up on two pages by adding both tags. I think that worked :D If I'm not mistaken I did that because it was for inputs & naming

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment