Skip to content

Add provider implementation matrix#261

Draft
nikatza wants to merge 1 commit intomainfrom
compatibility-matrix
Draft

Add provider implementation matrix#261
nikatza wants to merge 1 commit intomainfrom
compatibility-matrix

Conversation

@nikatza
Copy link
Copy Markdown
Contributor

@nikatza nikatza commented Mar 26, 2026

  • Add Go script to generate compatibility matrix
  • Add make target 'provider-matrix'
  • Update README with provider implementation table
  • Update go-makefile-maker and regenerate configs

Generated with Claude Code assistance

@nikatza nikatza force-pushed the compatibility-matrix branch 5 times, most recently from 729ef5a to 66addaa Compare March 26, 2026 16:11
@hardikdr hardikdr added the area/switch-automation Automation processes for network switch management and operations. label Mar 27, 2026
@hardikdr hardikdr added this to Roadmap Mar 27, 2026
@nikatza nikatza force-pushed the compatibility-matrix branch 12 times, most recently from 94693fc to 49722b9 Compare March 27, 2026 15:31
@nikatza nikatza marked this pull request as ready for review March 27, 2026 15:32
@nikatza nikatza requested a review from a team as a code owner March 27, 2026 15:32
@nikatza nikatza force-pushed the compatibility-matrix branch from 49722b9 to 8bbf68c Compare March 27, 2026 16:06
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.
@nikatza nikatza force-pushed the compatibility-matrix branch from 8bbf68c to b93e76e Compare March 27, 2026 16:07
@github-actions
Copy link
Copy Markdown

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/ironcore-dev/network-operator/hack 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/ironcore-dev/network-operator/hack/generate-provider-matrix.go 0.00% (ø) 0 0 0

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.

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.

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{
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.

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?

Comment on lines +142 to +153
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
}
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.

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.

@nikatza nikatza marked this pull request as draft March 31, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/switch-automation Automation processes for network switch management and operations.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants