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

EPIC: Decouple Azure type information from a particular version of Bicep #5453

Open
14 of 23 tasks
anthony-c-martin opened this issue Dec 16, 2021 · 7 comments
Open
14 of 23 tasks
Labels
enhancement New feature or request story: dynamic type loading Collects all work items related to decoupling of Bicep types from compiler
Milestone

Comments

@anthony-c-martin
Copy link
Member

anthony-c-martin commented Dec 16, 2021

Currently Bicep types are embedded with a Bicep release - meaning there is often a lag between types being available, and usable in Bicep, and upgrading requires the user to upgrade their VSCode extension or Bicep CLI.

Now that Bicep has the ability to talk to OCI for the Bicep module registry, it would make sense to re-use this infrastructure to be able to deliver Bicep types on a shorter cadence, and avoid having to tie the types to a version of Bicep - meaning that upgrading/downgrading the Bicep version will not change the types that are used for validation.

We may want to use the import statement to lock Bicep to a particular set of types - e.g.:

import 'az@0.1'

Triage

Preview Give feedback

Todo

Preview Give feedback

In Progress

Preview Give feedback

Deprioritized

Preview Give feedback

Done

Preview Give feedback
  1. story: dynamic type loading
    asilverman
  2. asilverman
  3. story: dynamic type loading
    asilverman

Open questions/tasks

  • Implement publishing pipeline for providers
  • Removal of feature flag
  • Close on serialization format for types (types.json)
  • Build in ability to version the contract (to support back/format compatibility wile being able to make changes)
    • Old versions of Bicep need to be able to understand they don't support the new format (and show an error if the user is using an incompatible version of Bicep)
    • New versions of Bicep need to be able to support N numbers of older versioned format
  • Generalize to support other providers
  • Ensure we have a plan for airgapped clouds (and have verified it)
@anthony-c-martin anthony-c-martin added the enhancement New feature or request label Dec 16, 2021
@ghost ghost added the Needs: Triage 🔍 label Dec 16, 2021
@alex-frankel alex-frankel added this to the v1.0 milestone Dec 20, 2021
@stephaniezyen stephaniezyen moved this to Todo in Bicep Mar 24, 2022
@anthony-c-martin anthony-c-martin assigned asilverman and unassigned jeskew Apr 3, 2023
@asilverman asilverman moved this from Todo to In Progress in Bicep Jul 17, 2023
@asilverman asilverman modified the milestones: v1.0, v0.20 Jul 17, 2023
@asilverman asilverman added the story: dynamic type loading Collects all work items related to decoupling of Bicep types from compiler label Jul 17, 2023
@stephaniezyen stephaniezyen modified the milestones: v0.20, v0.21 Aug 9, 2023
@anthony-c-martin anthony-c-martin changed the title Decouple Azure type information from a particular version of Bicep EPIC: Decouple Azure type information from a particular version of Bicep Aug 31, 2023
@stephaniezyen stephaniezyen modified the milestones: v0.21, v0.22 Sep 6, 2023
@asilverman asilverman modified the milestones: v0.22, v0.23 Sep 29, 2023
@stephaniezyen stephaniezyen modified the milestones: v0.23, v0.24 Nov 2, 2023
@slavizh
Copy link
Contributor

slavizh commented Dec 13, 2023

I am not sure if this is the issue I should comment upon. In latest community call there was a demo for Az provider and the presenter said that they will paste link to the GitHub issue but I do not have that link as I was watching the recording. There was some debate around having define always the latest provider version something like:

provider 'br:biceptestdf.azurecr.io/bicep/proivders/az@latest'

I am not sure why it was said that every time you run your deployment the result will change based on what is pulled as latest. After all we define the API version for every RP and that version does not change. Even if there is a change in specific version, let's say version 2023-01-01 for storage account was updated and new property was added. It should not matter what version of the az provider I use as the actual update for 2023-01-01 for storage account happens in ARM (in the cloud on that resource provider). The only breaking change I can see happening is if you are using let's say 2020-01-01 for storage account and in the latest provider that version is no longer available. But even if t is no longer available in the published az provider that storage account version can still be available in Azure (ARM) as usually deprecation has some notice in advance. If that storage account version is deprecated fully (not available in ARM) than your template will not work at all no matter which az provider version you use.

@slavizh
Copy link
Contributor

slavizh commented Dec 13, 2023

Also I would prefer one time import via the main.bicep file and option to define the az provider version via bicepconfig and az CLI command.

@brwilkinson
Copy link
Collaborator

If the available type versions were discoverable in the config (intellisense), similar to resource type versions. Then it would be easy to manually update the settings. Without just using a 'latest' tag.

A linter rule to show that you are pinned to an old types version would also be useful.

@slavizh
Copy link
Contributor

slavizh commented Dec 17, 2023

No, discoverability instead of latest does not work for us. We have over 160 separate templates so updating each one of them is quite job. Currently we just update the bicep CLI and everything works so if this can be defined outside of bicep CLI we need latest.

@anthony-c-martin
Copy link
Member Author

No, discoverability instead of latest does not work for us. We have over 160 separate templates so updating each one of them is quite job. Currently we just update the bicep CLI and everything works so if this can be defined outside of bicep CLI we need latest.

@slavizh would #12202 support what you're looking for? The goal is for the default behavior to match the current behavior (each version of Bicep is released with a particular version of the Azure types, so upgrading your CLI will pick up the 'latest' types), while providing the flexibility to override it if desired.

@brwilkinson
Copy link
Collaborator

I guess I don't understand.

The types version is for a collection of types + versions.

We are statically setting the "type collection" version. Which includes all current types and all current type versions.

If a new version of a resource provider definition is released in Azure, then I don't have access to this.

However if a new "type collection" becomes available... I can bump this in bicep config, without updating the Bicep version.

Now I can write a new bicep file with the new resource api version. All other type versions in all other bicep templates are still available. No code changes required; I just now have access to the new api version from the new "type collection"?

Am I missing something?

@slavizh
Copy link
Contributor

slavizh commented Dec 18, 2023

@anthony-c-martin I still think latest or at least something like 1.x.x, 2.x.x, etc. is needed when you have some constrain to currently update bicep cli but you need the latest types for resource providers.

@stephaniezyen stephaniezyen modified the milestones: v0.24, v0.25 Jan 16, 2024
@anthony-c-martin anthony-c-martin modified the milestones: v0.25, v0.26 Feb 6, 2024
@stephaniezyen stephaniezyen modified the milestones: v0.26, v0.27 Mar 5, 2024
@stephaniezyen stephaniezyen modified the milestones: v0.27, v0.28 May 9, 2024
@stephaniezyen stephaniezyen moved this from In Progress to Todo in Bicep May 14, 2024
@stephaniezyen stephaniezyen modified the milestones: v0.28, v1.0 May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request story: dynamic type loading Collects all work items related to decoupling of Bicep types from compiler
Projects
Status: Todo
Development

No branches or pull requests

7 participants