Commit c05a471
authored
[chore][cmd/mdatagen] Use metadata.yaml as a schema source for references (#15272)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Previously, the schemagen loader used `config.schema.yaml` as the
standalone file format for schema references. This PR changes the source
of truth for cross-component schema references to `metadata.yaml` — the
same file that already exists in every component directory.
Instead of parsing a bare ConfigMetadata JSON-schema object, the loader
now reads the config: section from a component's `metadata.yaml`,
matching the structure that mdatagen already generates for every
component. The generated output is likewise renamed to metadata.yaml
(placed under internal/metadata/) and wrapped with the standard
`metadata.yaml` envelope (type, status, config), so it is usable as a
reference target by other components in the same way.
<!-- Issue number if applicable -->
#### Link to tracking issue
Fixes #15259
<!--Describe what testing was performed and which tests were added.-->
#### Testing
Existing unit tests in `internal/schemagen` and `cmd/mdatagen/internal`
were updated to reflect the new file name and Metadata wrapper format.
The persistToFile test was strengthened to verify a full round-trip
through loadFromFile. All tests pass.1 parent 495f2c5 commit c05a471
21 files changed
Lines changed: 318 additions & 1733 deletions
File tree
- cmd/mdatagen
- internal
- sampleconnector/internal/metadata
- sampleentityreceiver/internal/metadata
- sampleprocessor/internal/metadata
- samplereceiver/internal/metadata
- samplescraper
- internal/metadata
- templates
- filter
- internal/schemagen
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
37 | | - | |
38 | 36 | | |
39 | 37 | | |
40 | 38 | | |
| |||
50 | 48 | | |
51 | 49 | | |
52 | 50 | | |
53 | | - | |
54 | 51 | | |
55 | 52 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | 53 | | |
60 | 54 | | |
61 | 55 | | |
62 | 56 | | |
63 | | - | |
64 | | - | |
65 | 57 | | |
66 | 58 | | |
67 | 59 | | |
68 | 60 | | |
69 | | - | |
70 | 61 | | |
71 | 62 | | |
72 | 63 | | |
73 | 64 | | |
74 | 65 | | |
75 | 66 | | |
76 | 67 | | |
77 | | - | |
78 | 68 | | |
79 | | - | |
80 | 69 | | |
81 | 70 | | |
82 | | - | |
83 | 71 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | 72 | | |
91 | | - | |
92 | | - | |
93 | 73 | | |
94 | 74 | | |
95 | 75 | | |
96 | | - | |
97 | 76 | | |
98 | | - | |
99 | 77 | | |
100 | | - | |
101 | 78 | | |
102 | | - | |
103 | 79 | | |
104 | 80 | | |
105 | 81 | | |
| |||
239 | 215 | | |
240 | 216 | | |
241 | 217 | | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | 218 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
194 | 195 | | |
195 | 196 | | |
196 | 197 | | |
197 | | - | |
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| |||
542 | 542 | | |
543 | 543 | | |
544 | 544 | | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
545 | 576 | | |
546 | 577 | | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
547 | 581 | | |
548 | 582 | | |
549 | 583 | | |
| |||
0 commit comments