feat(mdatagen): add automatic feature gate documentation generation
Description
Implements automatic documentation generation for component feature gates via mdatagen.
Component authors can now declare feature gates in metadata.yaml, and mdatagen will automatically generate standardized markdown documentation including gate IDs, stages, descriptions, version information, and reference links.
Key Changes:
- Extended
metadata-schema.yamlwithfeature_gatessection - Added
FeatureGatetypes with validation (required fields, valid stages, version format) - Created documentation template rendering feature gates as markdown table
- Integrated into existing documentation generation pipeline
- Added test coverage and usage documentation
Link to tracking issue
~~Fixes~~ (edit by @mx-psi) Updates #14067
Testing
- All 282 tests passing
- Added
TestRunContents/feature_gates.yamltest case - Validated documentation generation and error handling
- Lint checks passing
Documentation
- Added "Feature Gates Documentation" section to
cmd/mdatagen/README.mdwith usage examples - Generated example visible in
cmd/mdatagen/internal/testdata/documentation.md
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: sAchin-680 / name: SACHIN KUMAR (0d5f5579ba99482b81bdec2e2daa70febeaff731, 1bf8cd695dbf8531b1f860a31388e26e8b428297, 2bdcaedcd5aba3cfb2bd4a3fadf8a217bfbc2771, 548f80eabe471c4236757e80f473ea988bb8092e, b0b6fcaad13c345f46e15e3bf2321dd5520780ec, b6e64cecba573cac7de87a6ad4c80ac747e429d1, e5207d941d3be8156e7a77a688da26011e459549, f83b3305ef10a74037fe87ea97cdf0adf2eee14a)
Codecov Report
:x: Patch coverage is 94.87179% with 2 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 92.14%. Comparing base (2e9c827) to head (b6e64ce).
:warning: Report is 28 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| cmd/mdatagen/internal/metadata.go | 94.73% | 1 Missing and 1 partial :warning: |
:x: Your patch check has failed because the patch coverage (94.87%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.
Additional details and impacted files
@@ Coverage Diff @@
## main #14130 +/- ##
==========================================
- Coverage 92.15% 92.14% -0.02%
==========================================
Files 666 666
Lines 41441 41479 +38
==========================================
+ Hits 38191 38219 +28
- Misses 2213 2219 +6
- Partials 1037 1041 +4
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Done in f92d1f8!
- Ran
make gogenerate, - Added 'mycomponent' to metadata-schema.yaml status.class,
- Added 'mycomponent' to cspell.json,
- Reverted all autoformatting changes - now only 2 clean additions vs main (no IDE formatting)
The schema file now has zero unrelated changes.
Thanks @sAchin-680! Looks like just a space in the generated file's import list and it should be good to go to pass the CI checks
Hey @codeboten. Fixed the import spacing in generated_package_test.go. Should be good to go now.
This PR was marked stale due to lack of activity. It will be closed in 14 days.