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

New linter rule: use-recent-module-versions #14309

Merged
merged 18 commits into from
Jun 29, 2024

Conversation

StephenWeatherford
Copy link
Contributor

@StephenWeatherford StephenWeatherford commented Jun 12, 2024

Fixes #13553

Most changes are packages.lock.json and tests

  • PublicRegistryModuleMetadata* -> moved to Bicep.Core
  • IPublicRegistryModuleMetadataProvider -> changed so that it returns only what's currently in the cache at a given time (although it'll start a cache update in the background).
  • Linter rules can now access an IServiceProvider
  • New linter rule does not download module metadata info itself, but just uses current cache. Will display a warning until the cache is downloaded.
  • PublicRegistryModuleMetadataProvider worked into the artifact restoration process of OCI artifacts (as discussed in Bicep meeting). This way, the linter rule will not hold up compilation, and uses can make sure the cache is not downloaded using --no-restore (although in the current iteration there's no cache on disk so it will give an error in that mode from CLI - this could change in the future).
  • Only handles public modules for now, but is designed to be able to deal with private registries later
Microsoft Reviewers: Open in CodeFlow

@StephenWeatherford StephenWeatherford changed the title DRAFT DRAFT: use-recent-module-versions Jun 12, 2024
Copy link
Contributor

github-actions bot commented Jun 12, 2024

Test this change out locally with the following install scripts (Action run 9727303471)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 9727303471
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 9727303471"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 9727303471
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 9727303471"

Copy link
Contributor

github-actions bot commented Jun 12, 2024

Dotnet Test Results

   24 files   -     81     24 suites   - 81   5m 14s ⏱️ - 29m 17s
2 998 tests  -  7 913  2 998 ✅  -  7 911  0 💤  - 1  0 ❌  - 1 
5 990 runs   - 32 477  5 990 ✅  - 32 473  0 💤  - 3  0 ❌  - 1 

Results for commit f78f34b. ± Comparison against base commit 785c737.

♻️ This comment has been updated with latest results.

@StephenWeatherford StephenWeatherford force-pushed the sw/linter-new-avm-versions branch 3 times, most recently from 0a3194e to 5203fae Compare June 13, 2024 19:41
@StephenWeatherford StephenWeatherford marked this pull request as ready for review June 14, 2024 00:39
@StephenWeatherford StephenWeatherford changed the title DRAFT: use-recent-module-versions New linter rule: use-recent-module-versions Jun 14, 2024
Copy link
Contributor

@shenglol shenglol left a comment

Choose a reason for hiding this comment

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

:shipit:

@StephenWeatherford
Copy link
Contributor Author

@shenglol Thanks!

@StephenWeatherford StephenWeatherford merged commit 27b7ae2 into main Jun 29, 2024
44 checks passed
@StephenWeatherford StephenWeatherford deleted the sw/linter-new-avm-versions branch June 29, 2024 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inform/notify users in VS Code when a newer module version is available
2 participants