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

Allow the ability for use-recent-api-version linter rule duration to be configurable #8869

Closed
jtracey93 opened this issue Nov 2, 2022 · 6 comments · Fixed by #10344
Closed
Assignees
Labels
devdiv Related to Bicep tooling efforts in DevDiv enhancement New feature or request P2 This is important to be completed, but you may not get to it story: linter
Milestone

Comments

@jtracey93
Copy link

Creating as per the discussion in #8013 (comment)

We should consider allowing the use-recent-api-version linter rule duration to be configurable as this may be different per consumer of the rule rather than a hardcoded value/duration

@jtracey93 jtracey93 added the enhancement New feature or request label Nov 2, 2022
@ghost ghost added the Needs: Triage 🔍 label Nov 2, 2022
@slavizh
Copy link
Contributor

slavizh commented Nov 3, 2022

Additionally I would prefer to be able to configure the rule in a way to always warn me when there is a new version no matter the period and no matter that the new version is preview. We want to keep our templates up to date and currently this rule does not fully work in certain situations for us.

@alex-frankel alex-frankel added this to the v0.14 milestone Nov 9, 2022
@alex-frankel alex-frankel moved this to Todo in Bicep Dec 6, 2022
@puicchan puicchan modified the milestones: v0.14, v0.15 Dec 6, 2022
@stephaniezyen stephaniezyen modified the milestones: v0.15, v0.16 Feb 3, 2023
@puicchan puicchan added devdiv Related to Bicep tooling efforts in DevDiv P2 This is important to be completed, but you may not get to it labels Mar 23, 2023
@puicchan puicchan modified the milestones: v0.16, v0.17 Mar 28, 2023
@StephenWeatherford StephenWeatherford moved this from Todo to In Progress in Bicep Apr 5, 2023
@ugreg
Copy link

ugreg commented Apr 5, 2023

@StephenWeatherford since this is no in progress curious on when this may be released. Does this mean that since the Milestone it is assigned to is due by May 01, 2023, we will be able to take advantage of this configuration sometime in May 2023?

@StephenWeatherford
Copy link
Contributor

@ugreg Yes. Working on it now.

@StephenWeatherford
Copy link
Contributor

@slavizh Stan...

Additionally I would prefer to be able to configure the rule in a way to always warn me when there is a new version no matter the period and no matter that the new version is preview. We want to keep our templates up to date and currently this rule does not fully work in certain situations for us.

Could you provide more details? I'm adding a new max-allowed-age-in-days property to the use-recent-api-version rule. If you set it to zero, then only the most recent apiVersion is allowed. With the exception that an older non-preview version is preferred over a newer preview version (same as currently behaves). For example, the most recent versions of Microsoft.DataMigration/services are:

  • microsoft.DataMigration/services@2021-06-30 (newest non-preview version)
  • microsoft.DataMigration/services@2021-10-30-preview
  • microsoft.DataMigration/services@2022-01-30-preview
  • microsoft.DataMigration/services@2022-03-30-preview (newest version)

If you specify services@2022-03-30-preview:

param location string
resource storageaccount 'Microsoft.DataMigration/services@2022-03-30-preview' = {
  name: 'name'
  location: location
  kind: 'StorageV2'
  sku: {
    name: 'Premium_LRS'
  }
}

it gives this warning:

Use more recent API version for 'Microsoft.DataMigration/services'. '2022-03-30-preview' is 371 days old, should be no more than 0 days old, or the most recent. Acceptable versions: 2021-06-30

This behavior was taken from the ARMTTK.

Are you saying you'd like a configuration to turn off the preference of non-preview for preview, so that 2022-03-30-preview is accepted if it's the newest, even if there's an old non-preview version? Thx.

@slavizh
Copy link
Contributor

slavizh commented Apr 6, 2023

@StephenWeatherford yes, exactly that. As every Azure team develops differently and sometimes preview is the only one available with specific feature or it is the latest, we prefer during our development to know that there is a newer version even if preview. We can decide on per RP bases if we should now update the version or not. When our end users deploy our solutions they basically have different bicepconfig file than the one we use in development so they do not see these warnings. We basically guarantee and support what we have developed works.

@StephenWeatherford
Copy link
Contributor

@StephenWeatherford yes, exactly that. As every Azure team develops differently and sometimes preview is the only one available with specific feature or it is the latest, we prefer during our development to know that there is a newer version even if preview. We can decide on per RP bases if we should now update the version or not. When our end users deploy our solutions they basically have different bicepconfig file than the one we use in development so they do not see these warnings. We basically guarantee and support what we have developed works.

@slavizh Thanks. Added #10345

@StephenWeatherford StephenWeatherford moved this from In Progress to In Review in Bicep Apr 7, 2023
@github-project-automation github-project-automation bot moved this from In Review to Done in Bicep Apr 11, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
devdiv Related to Bicep tooling efforts in DevDiv enhancement New feature or request P2 This is important to be completed, but you may not get to it story: linter
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

7 participants