Skip to content

Leverage az provider list#3707

Merged
danielrbradley merged 8 commits into
masterfrom
leverage-az-provider-list
Dec 2, 2024
Merged

Leverage az provider list#3707
danielrbradley merged 8 commits into
masterfrom
leverage-az-provider-list

Conversation

@danielrbradley

@danielrbradley danielrbradley commented Nov 15, 2024

Copy link
Copy Markdown
Contributor

Fixes #2661

  1. Add inactive default versions report - which versions referenced from our default version are not currently marked as "live" by az provider list?
  2. When picking a new tracking version, select from the live versions only, if any are live. Fall back to all versions if az provider list doesn't include any.
  3. When checking for additional resources not in the default version, don't add new non-live versions.
  4. Move most unit testing into gen_calculateVersionMetadata_test from defaultVersion_test as it's as close to e2e as possible and requires less mocking.

@danielrbradley danielrbradley self-assigned this Nov 15, 2024
@github-actions

Copy link
Copy Markdown
Contributor

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@codecov

codecov Bot commented Nov 15, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 84.61538% with 12 lines in your changes missing coverage. Please review.

Project coverage is 56.80%. Comparing base (292977d) to head (50c3df9).
Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
provider/pkg/versioning/defaultVersion.go 92.15% 4 Missing ⚠️
provider/pkg/providerlist/providerlist.go 83.33% 3 Missing ⚠️
provider/pkg/versioning/build_schema.go 0.00% 2 Missing ⚠️
provider/pkg/versioning/gen.go 66.66% 2 Missing ⚠️
provider/cmd/pulumi-gen-azure-native/main.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3707      +/-   ##
==========================================
+ Coverage   56.41%   56.80%   +0.38%     
==========================================
  Files          74       74              
  Lines       11813    11838      +25     
==========================================
+ Hits         6664     6724      +60     
+ Misses       4652     4619      -33     
+ Partials      497      495       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@danielrbradley danielrbradley force-pushed the leverage-az-provider-list branch from 2081bb3 to e3086cc Compare November 19, 2024 11:56
@danielrbradley danielrbradley force-pushed the leverage-az-provider-list branch from d02d06d to f317565 Compare November 25, 2024 11:33
@danielrbradley danielrbradley force-pushed the leverage-az-provider-list branch from cdde558 to 33452f9 Compare November 25, 2024 21:35

@thomas11 thomas11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM with some docs wishlist items

Comment thread Makefile
Comment thread provider/pkg/providerlist/providerlist.go
- Use built-in `--query` option instead of needing jq installed.
- Move into `versions` directory where all other version data is.
- Add `defaultVersion` and `locations` fields for each resourceType.
Use existing openapi.ApiVersionToDate function
- Add new report highlighting which versions in the default lock are not listed as live.
- Remove old active report which was the same data as the 'az provider list' but reformatted.
- Pass indexedProviderList into BuildSpec function.
- Fall back to any version if none are live.
- Add documentation comments.
- Create providerSpecBuilder class to give access to global, immutable data across functions to avoid passing providerName and providerList everywhere.
- Simplify filtering candidate versions.

Test adding resources only if they're live
- If the resource is already added, don't remove it.
- If it's a new addition, but not yet live, don't add it.
- Test prefering live versions for tracking
- Combine default version tests
- Move lots of default version tests into the new calculateVersionMetadata tests which are a broader test and require less mocking.
@pulumi-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped in release v2.76.0.

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.

Use the Azure RP API when determining default API versions

3 participants