Conversation
729ef5a to
66addaa
Compare
94693fc to
49722b9
Compare
49722b9 to
8bbf68c
Compare
Add a Go tool (hack/generate-provider-matrix.go) that produces a Markdown compatibility matrix showing which core API types each provider implements. How it works: - Uses reflect.Type.Implements() to test each provider against the provider.*Provider interfaces defined in internal/provider/ - Self-validates by parsing Go AST of the provider package to ensure the hardcoded interfaceMap stays in sync with source interfaces - Discovers provider-specific types (config extensions and standalone CRDs) by scanning provider API directories for Register*Dependency calls and SchemeBuilder.Register calls - Resolves interface names to Kubernetes Kind names by correlating core _types.go filenames with Register*Dependency function names, then validating against the runtime scheme - Writes docs/provider-compatibility.md (full matrix) and updates a summary table in README.md between sentinel markers The new `make provider-matrix` target is also wired as a dependency of `make docs`, so the matrix is always regenerated with the API reference docs.
8bbf68c to
b93e76e
Compare
Merging this branch will not change overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. |
There was a problem hiding this comment.
There is no navigation entry for this page. How would I navigate to it from the Documentation? 😅
|
|
||
| // interfaceMap maps provider interface names to their reflect.Type. | ||
| // generate-provider-matrix fails if it finds a different set of Provider interfaces in the source code. | ||
| var interfaceMap = map[string]reflect.Type{ |
There was a problem hiding this comment.
The reflect.Type returned by reflect.TypeFor has a Name() func, couldn't we just use that instead of having to define the string names ourselves? If so, this could just become a list, no?
| exts, err := scanConfigExtensions(prov.apiDir) | ||
| if err != nil { | ||
| fmt.Fprintf(os.Stderr, "Warning: failed to scan config configurations for %s: %v\n", prov.name, err) | ||
| } | ||
| configurations[prov.name] = exts | ||
|
|
||
| standalone, err := scanStandaloneTypes(prov.apiDir) | ||
| if err != nil { | ||
| fmt.Fprintf(os.Stderr, "Warning: failed to scan standalone types for %s: %v\n", prov.name, err) | ||
| } | ||
| standaloneTypes[prov.name] = standalone | ||
| } |
There was a problem hiding this comment.
Are we sure we want to list the provider configurations and standalone types in this documentation page? I thought it was just concerned with the compatibility of the core types with the different providers.
Generated with Claude Code assistance