Proposal: Versioning of provider artifacts and provider resources #11894
Replies: 19 comments 5 replies
This comment was marked as off-topic.
This comment was marked as off-topic.
-
Regarding the Kubernetes part, I don't have an objection to matching the k8s versioning conventions. However, the 1.0.0 placeholder is due to the provider being baked into Bicep. Are we planning to switch that provider to pull it dynamically as well? |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
This proposal does attempt to address the problem of being able to quickly understand which Az resource types are available in a given Az package, but I have the following concerns:
In general, I'm not in favor of this proposal over using semver. Consistency is really my most important concern, but I also feel like we're over-optimizing on solving a particular (very Azure-centric) problem without fully understanding the details - for example, I would want to ask the question "Why do we feel we can't solve this problem with tooling or documentation?". That said, I fully agree version/type discoverability is an important problem to solve, and appreciate the thought you've put into it here. |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment has been hidden.
This comment has been hidden.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment has been hidden.
This comment has been hidden.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
@asilverman I think probably easiest to discuss offline - I can talk you through my objections in more detail. To give a simpler counterpoint: Assumptions:
The benefit of this proposal is that a user can purely use the version of the package to determine which resource types are supported. However, if we accept assumptions 1 & 2, this is not true - there will be cases where they need to arbitrarily increase the version, or snap to "latest" to deal with inaccuracies or omissions. At this point I really can't see any benefit over semver - the version is just an opaque string.
I'll fill you in on this - background on the release process is crucial for this proposal. |
Beta Was this translation helpful? Give feedback.
-
I agree that we should be able to automatically detect resource body breaking changes. Cribbing from @shenglol's suggestion, I would propose the following algorithm for detecting the type of change to make:
*: Can be detected with an automated CI pipeline Semver requires that any new feature result in a minor version bump, and rolling new resource types or API versions in patch releases breaks this expectation. Following the above would mean that almost all updates would be a new minor version, with some not infrequent major version bumps when RP teams remove preview API versions. Patch versions would be theoretically possible but would never happen in practice. That said, I would argue that semver is the wrong approach to take here because it introduces cognitive overhead without providing any of the affordances we see from semver with code dependencies. We have no plans to introduce features that would make semantic versioning useful, so tracking the semantic version of a provider increases complexity without increasing utility. The main reason for this is that the current syntax requires that template authors pin a specific version of a provider. Semver matching notation (e.g., Secondly, there's no actual runtime effect of pinning a version and ignoring updates. Users could check their templates against an older version of the AZ provider, but they can't actually use it at runtime. Both RP contracts and az template functions will always use the latest version of the AZ provider (i.e., whatever the currently deployed state of ARM and ARM RPs might be). The primary consideration for a user is therefore, how close is my version of the provider to the current state of the world? Phrased different, how current is my version of the provider? You can't tell that from a semantic version, but you can tell it from a date. I would argue that we should also support a special sentinel version value (e.g., For non-Az providers, is the plan to have multiple versions of the server side code running? If so, semver would make sense, as the import communicated in the template would be respected at deploy time. This capability seems particularly important for providers that talk to different instances of something (e.g., |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
After numerous rounds of internal discussions, we have arrived at the decision that neither semantic versioning nor the use of dates as version identifiers will fully address our requirements. Instead, we have chosen to adopt the basic semantic versioning format, denoted as
Normal versionA normal version number MUST be in the format of Version number
|
Beta Was this translation helpful? Give feedback.
-
TL;DR
We propose to relax the constraint on provider import declaration so that they are not required to conform to the format semantic versioning.
We propose that each provider should define their version scheme and allow any valid OCI tag descriptor as a version value.
We propose that provider author shall determine how the resource types are version descriptors are resolved.
We believe that doing the above will improve the user experience by making it self-evident for the user what types are loaded from a provider declaration syntax.
Overview
The current implementation of Bicep describes the ability to import type namespaces and Bicep extensibility providers using the following syntax per the Bicep documentation: Import Bicep namespaces
The syntax object used to parse the statements above constrains the version to the right of the '@' character to be a semantic version string format as enforced by the code below.
bicep/src/Bicep.Core/Syntax/ImportSpecification.cs
Lines 23 to 30 in ac299a3
bicep/src/Bicep.Core/Syntax/ImportSpecification.cs
Lines 65 to 78 in ac299a3
We propose to relax the enforcement of the import version and delegate the concern of versioning to provider developers, in the sections below we will provide the motivation for doing this and how this change results in a better overall user experience for resource type provider authors and Bicep file creators alike.
We propose the language enforcement of the
ImportSpecification
string be relaxed to match a valid OCI image tag so that authors have more flexibility in delivering their package contents to users.Motivation
In the following sections we will describe the limitations with the current design using examples.
Example 1: The Azure provider
In the import statement currently used to load the azure types provider (
import '[email protected]'
) the version ('1.0.0') is a placeholder. The versioning of the types is reflected in the NuGet package reference version (fromBicep.Core.csproj
), as shown below:bicep/src/Bicep.Core/Bicep.Core.csproj
Line 43 in ac299a3
The definitions are generated via a console application (azure/bicep-types-az ) that is triggered manually for each Bicep release. The NuGet package version is then updated to reflect that the new types are a result of that generation event.
Inspection of the underlying types reveals that they follow the Azure REST API versioning specification, this specification defines a version as a date (e.g. 2023-11-01-preview, 2023-01-10).
bicep/src/Bicep.Core.Samples/Files/baselines/AKS_LF/main.bicep
Lines 27 to 56 in 7524201
This creates a challenge for our customers since any semantic version of the azure types provider doesn't hint about what versions will be supported in the types package.
Example 2: The Kubernetes Provider
In the import statement currently used to load the Kubernetes types provider (
import '[email protected]'
) the version ('1.0.0') is a placeholder. The versioning of the types is reflected in the NuGet package reference version (fromBicep.Core.csproj
), as shown below:bicep/src/Bicep.Core/Bicep.Core.csproj
Line 44 in ac299a3
The actual definitions are generated are derived from a Kubernetes OpenApi spec (see here). These type definitions for Kubernetes are updated to v1.25.3 of Kubernetes and are not updated in between releases of Bicep.
These constraints customers to declare manifests that are compatible with Kubernetes clusters with versions v1.23 to v1.28 and there is no compatibility guarantee once Kubernetes versions evolve.
The customer has no hint about this potential problem since the version in the provider ('1.0.0') is a placeholder.
We propose that the Kubernetes provider is versioned using the versioning scheme of Kubernetes (e.g. '1.25.3', '1.28.0', etc...)
The types would match the OpenAPI specification for that release of Kubernetes and the underlying resource types would be versioned according to the Kubernetes API Server scheme (v1, v1beta1, v1alpha1, etc..). Its worth noting that such a version would also be OCI compliant, for example
mcr.microsoft.com/bicep/providers/kubernetes:1.25.3
Discussion on the Challenges
latest
specification and are willing to take the risk of their deployment breaking. For example in the deployment to a staging environment that is not production.stable
version of a package. For example with thekubernetes
provider, maybe all the user wants is to have a resource type package tracking the latestPATCH
version for aMAJOR.MINOR
release. If we allow customers to specify OCI tags, then the user could gesture it in the following way:Beta Was this translation helpful? Give feedback.
All reactions